summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ppc4xx
diff options
context:
space:
mode:
authorye xingchen <ye.xingchen@zte.com.cn>2022-12-06 17:14:50 +0800
committerVinod Koul <vkoul@kernel.org>2023-01-18 17:43:47 +0530
commitfaab12342f5a4579f066a9e9dcfa97d3e60cf36f (patch)
treee9be03504f0d662a7ee11895b4471b2eb6f45fbe /drivers/dma/ppc4xx
parent3dfaa68fa89afd7a926cc3c5f0388b52f489609b (diff)
downloadlinux-stable-faab12342f5a4579f066a9e9dcfa97d3e60cf36f.tar.gz
linux-stable-faab12342f5a4579f066a9e9dcfa97d3e60cf36f.tar.bz2
linux-stable-faab12342f5a4579f066a9e9dcfa97d3e60cf36f.zip
dmaengine: ppc4xx: Convert to use sysfs_emit()/sysfs_emit_at() APIs
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202212061714501297954@zte.com.cn Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/ppc4xx')
-rw-r--r--drivers/dma/ppc4xx/adma.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 6b5e91f26afc..686c270ef710 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4299,9 +4299,8 @@ static ssize_t devices_show(struct device_driver *dev, char *buf)
for (i = 0; i < PPC440SPE_ADMA_ENGINES_NUM; i++) {
if (ppc440spe_adma_devices[i] == -1)
continue;
- size += scnprintf(buf + size, PAGE_SIZE - size,
- "PPC440SP(E)-ADMA.%d: %s\n", i,
- ppc_adma_errors[ppc440spe_adma_devices[i]]);
+ size += sysfs_emit_at(buf, size, "PPC440SP(E)-ADMA.%d: %s\n",
+ i, ppc_adma_errors[ppc440spe_adma_devices[i]]);
}
return size;
}
@@ -4309,9 +4308,8 @@ static DRIVER_ATTR_RO(devices);
static ssize_t enable_show(struct device_driver *dev, char *buf)
{
- return snprintf(buf, PAGE_SIZE,
- "PPC440SP(e) RAID-6 capabilities are %sABLED.\n",
- ppc440spe_r6_enabled ? "EN" : "DIS");
+ return sysfs_emit(buf, "PPC440SP(e) RAID-6 capabilities are %sABLED.\n",
+ ppc440spe_r6_enabled ? "EN" : "DIS");
}
static ssize_t enable_store(struct device_driver *dev, const char *buf,
@@ -4362,7 +4360,7 @@ static ssize_t poly_show(struct device_driver *dev, char *buf)
reg &= 0xFF;
#endif
- size = snprintf(buf, PAGE_SIZE, "PPC440SP(e) RAID-6 driver "
+ size = sysfs_emit(buf, "PPC440SP(e) RAID-6 driver "
"uses 0x1%02x polynomial.\n", reg);
return size;
}