mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-07 04:11:42 +00:00
Done with cocci script:
@@
identifier d_show;
identifier dev, attr, buf;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
return
- sprintf(buf,
+ sysfs_emit(buf,
...);
...>
}
@@
identifier d_show;
identifier dev, attr, buf;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
return
- snprintf(buf, PAGE_SIZE,
+ sysfs_emit(buf,
...);
...>
}
@@
identifier d_show;
identifier dev, attr, buf;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
return
- scnprintf(buf, PAGE_SIZE,
+ sysfs_emit(buf,
...);
...>
}
@@
identifier d_show;
identifier dev, attr, buf;
expression chr;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
return
- strcpy(buf, chr);
+ sysfs_emit(buf, chr);
...>
}
@@
identifier d_show;
identifier dev, attr, buf;
identifier len;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
len =
- sprintf(buf,
+ sysfs_emit(buf,
...);
...>
return len;
}
@@
identifier d_show;
identifier dev, attr, buf;
identifier len;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
len =
- snprintf(buf, PAGE_SIZE,
+ sysfs_emit(buf,
...);
...>
return len;
}
@@
identifier d_show;
identifier dev, attr, buf;
identifier len;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
len =
- scnprintf(buf, PAGE_SIZE,
+ sysfs_emit(buf,
...);
...>
return len;
}
@@
identifier d_show;
identifier dev, attr, buf;
identifier len;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
- len += scnprintf(buf + len, PAGE_SIZE - len,
+ len += sysfs_emit_at(buf, len,
...);
...>
return len;
}
@@
identifier d_show;
identifier dev, attr, buf;
expression chr;
@@
ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
{
...
- strcpy(buf, chr);
- return strlen(buf);
+ return sysfs_emit(buf, chr);
}
Link: https://lore.kernel.org/r/7f406fa8e3aa2552c022bec680f621e38d1fe414.1602122879.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
|
||
|---|---|---|
| .. | ||
| affinity.c | ||
| affinity.h | ||
| aspm.c | ||
| aspm.h | ||
| chip_registers.h | ||
| chip.c | ||
| chip.h | ||
| common.h | ||
| debugfs.c | ||
| debugfs.h | ||
| device.c | ||
| device.h | ||
| driver.c | ||
| efivar.c | ||
| efivar.h | ||
| eprom.c | ||
| eprom.h | ||
| exp_rcv.c | ||
| exp_rcv.h | ||
| fault.c | ||
| fault.h | ||
| file_ops.c | ||
| firmware.c | ||
| hfi.h | ||
| init.c | ||
| intr.c | ||
| iowait.c | ||
| iowait.h | ||
| ipoib_main.c | ||
| ipoib_rx.c | ||
| ipoib_tx.c | ||
| ipoib.h | ||
| Kconfig | ||
| mad.c | ||
| mad.h | ||
| Makefile | ||
| mmu_rb.c | ||
| mmu_rb.h | ||
| msix.c | ||
| msix.h | ||
| netdev_rx.c | ||
| netdev.h | ||
| opa_compat.h | ||
| opfn.c | ||
| opfn.h | ||
| pcie.c | ||
| pio_copy.c | ||
| pio.c | ||
| pio.h | ||
| platform.c | ||
| platform.h | ||
| qp.c | ||
| qp.h | ||
| qsfp.c | ||
| qsfp.h | ||
| rc.c | ||
| rc.h | ||
| ruc.c | ||
| sdma_txreq.h | ||
| sdma.c | ||
| sdma.h | ||
| sysfs.c | ||
| tid_rdma.c | ||
| tid_rdma.h | ||
| trace_ctxts.h | ||
| trace_dbg.h | ||
| trace_ibhdrs.h | ||
| trace_iowait.h | ||
| trace_misc.h | ||
| trace_mmu.h | ||
| trace_rc.h | ||
| trace_rx.h | ||
| trace_tid.h | ||
| trace_tx.h | ||
| trace.c | ||
| trace.h | ||
| uc.c | ||
| ud.c | ||
| user_exp_rcv.c | ||
| user_exp_rcv.h | ||
| user_pages.c | ||
| user_sdma.c | ||
| user_sdma.h | ||
| verbs_txreq.c | ||
| verbs_txreq.h | ||
| verbs.c | ||
| verbs.h | ||
| vnic_main.c | ||
| vnic_sdma.c | ||
| vnic.h | ||