All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepak R Varma <drv@mailo.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: outreachy@lists.linux.dev,
	Sven Van Asbroeck <TheSven73@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: fieldbus: replace snprintf in show functions with sysfs_emit
Date: Wed, 9 Nov 2022 13:16:02 +0530	[thread overview]
Message-ID: <Y2taurqOvGiPo3jB@qemulion> (raw)
In-Reply-To: <Y2tXEibm2QxH37FK@kroah.com>

On Wed, Nov 09, 2022 at 08:30:26AM +0100, Greg Kroah-Hartman wrote:
> On Wed, Nov 09, 2022 at 11:26:52AM +0530, Deepak R Varma wrote:
> > The show() methods should only use sysfs_emit() when formatting values
> > to be returned to the user space.
> > Ref: Documentation/filesystems/sysfs.rst
> > Issue identified by coccicheck.
> >
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> >  	/*
> > -	 * card_name was provided by child driver, could potentially be long.
> > -	 * protect against buffer overrun.
> > +	 * sysfs provides PAGE_SIZE long buffer to take care of potentially
>
> No need to ever mention PAGE_SIZE at all, this comment should just be:
> 	/* card_name was provided by child driver */

Sure. I will update the comment in the revision.

>
> But the larger question is, why did you only convert one of the sysfs
> show functions in this file?  Why not do them all?

I was limiting it to what is reported by coccicheck. I will review other such
show functions and send a consolidated patch.

Thank you,
./drv

>
> thanks,
>
> greg k-h
>



      reply	other threads:[~2022-11-09  7:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  5:56 [PATCH v2] staging: fieldbus: replace snprintf in show functions with sysfs_emit Deepak R Varma
2022-11-09  7:30 ` Greg Kroah-Hartman
2022-11-09  7:46   ` Deepak R Varma [this message]

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=Y2taurqOvGiPo3jB@qemulion \
    --to=drv@mailo.com \
    --cc=TheSven73@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=outreachy@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.