mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alex Dewar <alex.dewar90@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	"David S. Miller" <davem@davemloft.net>,
	Nayna Jain <nayna@linux.ibm.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Sourabh Jain <sourabhjain@linux.ibm.com>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 0/2] simple sysfs wrappers for single values
Date: Sat, 29 Aug 2020 18:23:13 -0700	[thread overview]
Message-ID: <fbc74484451e2ef75fbb65665186035301550a1b.camel@perches.com> (raw)
In-Reply-To: <81c3499a5a09a82ddb4f3aa2bd9bfde1c0192b9e.camel@perches.com>

On Sat, 2020-08-29 at 17:28 -0700, Joe Perches wrote:
> On Sun, 2020-08-30 at 00:37 +0100, Alex Dewar wrote:
> > Hi all,
> > 
> > I've noticed there seems to have been a fair amount of discussion around
> > the subject of possible helper methods for use in the context of sysfs
> > show methods (which I haven't had a chance to go through in detail yet
> > -- sorry!), so I thought I'd send out a couple of patches I've been
> > working on for this, in case it's of any interest to anyone.
> 
> If you really want to do this, I suggest you get use
> wrappers like sysfs_emit_string, sysfs_emit_int, sysfs_emit_u64
> though I don't see _that_ much value.

Just fyi:

the treewide converted sysfs_emit uses
end up with these integer outputs:

$ git grep -P -oh 'sysfs_emit\(buf, "%\d*[luixd]*\\n"' | \
  sort | uniq -c | sort -rn
   1482 sysfs_emit(buf, "%d\n"
    549 sysfs_emit(buf, "%u\n"
    118 sysfs_emit(buf, "%ld\n"
    100 sysfs_emit(buf, "%lu\n"
     78 sysfs_emit(buf, "%llu\n"
     62 sysfs_emit(buf, "%i\n"
     47 sysfs_emit(buf, "%x\n"
     24 sysfs_emit(buf, "%lld\n"
     12 sysfs_emit(buf, "%llx\n"
     12 sysfs_emit(buf, "%08x\n"
     12 sysfs_emit(buf, "%02x\n"
     10 sysfs_emit(buf, "%016llx\n"
      8 sysfs_emit(buf, "%04x\n"
      6 sysfs_emit(buf, "%lx\n"
      5 sysfs_emit(buf, "%02d\n"
      4 sysfs_emit(buf, "%04d\n"
      2 sysfs_emit(buf, "%08lx\n"
      1 sysfs_emit(buf, "%li\n"
      1 sysfs_emit(buf, "%4x\n"
      1 sysfs_emit(buf, "%0x\n"
      1 sysfs_emit(buf, "%06x\n"
      1 sysfs_emit(buf, "%03x\n"
      1 sysfs_emit(buf, "%01x\n"
> 


  reply	other threads:[~2020-08-30  1:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29 23:37 Alex Dewar
2020-08-29 23:37 ` [PATCH RFC 1/2] sysfs: add helpers for safely showing simple strings Alex Dewar
2020-08-29 23:37 ` [PATCH RFC 2/2] sysfs: add helper macro for showing simple integer values Alex Dewar
2020-08-30  9:13   ` Greg Kroah-Hartman
2020-09-02 15:31     ` Alex Dewar
2020-08-30  0:28 ` [PATCH RFC 0/2] simple sysfs wrappers for single values Joe Perches
2020-08-30  1:23   ` Joe Perches [this message]
2020-09-02 15:29     ` Alex Dewar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbc74484451e2ef75fbb65665186035301550a1b.camel@perches.com \
    --to=joe@perches.com \
    --cc=alex.dewar90@gmail.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=dan.j.williams@intel.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=nayna@linux.ibm.com \
    --cc=rafael@kernel.org \
    --cc=sourabhjain@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®