mbox series

[0/4] drivers core: Use sysfs_emit functions

Message ID cover.1599501047.git.joe@perches.com
Headers show
Series drivers core: Use sysfs_emit functions | expand

Message

Joe Perches Sept. 7, 2020, 5:58 p.m. UTC
This is a sample block of conversions for drivers/base from next-20200903.
It requires the suggested patch that adds sysfs_emit pafunctions from
https://lore.kernel.org/lkml/a9054fb521e65f2809671fa9c18e2453061e9d91.1598744610.git.joe@perches.com/

Convert and neaten the various uses of sprintf family functions to
sysfs_emit and sysfs_emit_at

Joe Perches (4):
  drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
  drivers core: Remove strcat uses around sysfs_emit and neaten
  drivers core: Reindent a couple uses around sysfs_emit
  drivers core: Miscellaneous changes for sysfs_emit

 drivers/base/arch_topology.c            |  2 +-
 drivers/base/cacheinfo.c                | 32 ++++++++-----
 drivers/base/class.c                    |  2 +-
 drivers/base/core.c                     | 27 ++++++-----
 drivers/base/cpu.c                      | 50 ++++++++++----------
 drivers/base/dd.c                       |  2 +-
 drivers/base/firmware_loader/fallback.c |  2 +-
 drivers/base/memory.c                   | 59 +++++++++++------------
 drivers/base/node.c                     | 47 ++++++++----------
 drivers/base/platform.c                 |  8 ++--
 drivers/base/power/sysfs.c              | 63 +++++++++++++------------
 drivers/base/power/wakeup_stats.c       | 12 ++---
 drivers/base/soc.c                      | 10 ++--
 13 files changed, 159 insertions(+), 157 deletions(-)

Comments

Greg Kroah-Hartman Sept. 8, 2020, 8:27 a.m. UTC | #1
On Mon, Sep 07, 2020 at 10:58:05AM -0700, Joe Perches wrote:
> Convert the various sprintf fmaily calls in sysfs device show functions
> to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.

But no sysfs_emit_at() calls are used in this patch :(

thanks,

greg k-h
Joe Perches Sept. 8, 2020, 8:33 a.m. UTC | #2
On Tue, 2020-09-08 at 10:27 +0200, Greg Kroah-Hartman wrote:
> On Mon, Sep 07, 2020 at 10:58:05AM -0700, Joe Perches wrote:
> > Convert the various sprintf fmaily calls in sysfs device show functions
> > to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
> 
> But no sysfs_emit_at() calls are used in this patch :(

Try patch 4.

No instance where it was appropriate to use sysfs_emit_at
matched the cocci script requirements in this directory.