From: Deepak R Varma <mh12gx2825@gmail.com>
To: Helen Koike <helen@koikeco.de>
Cc: Sumera Priyadarsini <sylphrenadin@gmail.com>,
outreachy-kernel@googlegroups.com, Ian Abbott <abbotti@mev.co.uk>,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [Outreachy kernel] [PATCH] staging: comedi: Use sysfs_emit for show(device *...) functions
Date: Mon, 19 Oct 2020 06:57:10 +0530 [thread overview]
Message-ID: <20201019012710.GA76378@ubuntu204> (raw)
In-Reply-To: <CAPW4XYaGEv-LOxcR=dZ9QWwtsck3nvmkC2Jb=JMc+Q2LRrRSjg@mail.gmail.com>
On Sun, Oct 18, 2020 at 09:21:24PM -0300, Helen Koike wrote:
> Hi Deepak,
>
> On Sun, Oct 18, 2020 at 3:45 PM Deepak R Varma <mh12gx2825@gmail.com> wrote:
> >
> > On Mon, Oct 19, 2020 at 12:01:24AM +0530, Sumera Priyadarsini wrote:
> > > On Sun, 18 Oct, 2020, 11:40 PM Deepak R Varma, <mh12gx2825@gmail.com> wrote:
> > >
> > > > Convert snprintf calls in device show functions to sysfs_emit
> > > > for PAGE_SIZE buffer safety.
> > > > Warning generated by: scripts/coccinelle/api/device_attr_show.cocci
> > > >
> > > > Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
> > > > ---
> > > > drivers/staging/comedi/comedi_fops.c | 8 ++++----
> > > > 1 file changed, 4 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > b/drivers/staging/comedi/comedi_fops.c
> > > > index d99231c737fb..5b8ba0c84a8e 100644
> > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > @@ -396,7 +396,7 @@ static ssize_t max_read_buffer_kb_show(struct device
> > > > *csdev,
> > > > mutex_unlock(&dev->mutex);
> > > >
> > > > comedi_dev_put(dev);
> > > > - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> > > > + return sysfs_emit(buf, "%u\n", size);
> > > > }
> > > >
> > > > static ssize_t max_read_buffer_kb_store(struct device *csdev,
> > > > @@ -452,7 +452,7 @@ static ssize_t read_buffer_kb_show(struct device
> > > > *csdev,
> > > > mutex_unlock(&dev->mutex);
> > > >
> > > > comedi_dev_put(dev);
> > > > - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> > > > + return sysfs_emit(buf, "%u\n", size);
> > > > }
> > > >
> > > > static ssize_t read_buffer_kb_store(struct device *csdev,
> > > > @@ -509,7 +509,7 @@ static ssize_t max_write_buffer_kb_show(struct device
> > > > *csdev,
> > > > mutex_unlock(&dev->mutex);
> > > >
> > > > comedi_dev_put(dev);
> > > > - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> > > > + return sysfs_emit(buf, "%u\n", size);
> > > > }
> > > >
> > > > static ssize_t max_write_buffer_kb_store(struct device *csdev,
> > > > @@ -565,7 +565,7 @@ static ssize_t write_buffer_kb_show(struct device
> > > > *csdev,
> > > > mutex_unlock(&dev->mutex);
> > > >
> > > > comedi_dev_put(dev);
> > > > - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> > > > + return sysfs_emit(buf, "%u\n", size);
> > > > }
> > > >
> > > > static ssize_t write_buffer_kb_store(struct device *csdev,
> > > > --
> > > > 2.25.1
> > > >
> > >
> > > Hi Deepak,
> > >
> > > I was just about to send a V2 for the previous patchset I sent which
> > > included this file as well. No issues since I've not sent it yet- I'll
> > > remove this file from my V2. But please give me a heads-up the next time so
> > > we are not working on the same files. :-)
> > >
> > > Thanks, and regards,
> > > Sumera
> > >
> >
> > Sure. I should have informed you. My bad.
> > I also sent in patches for the other two files as well. So you can look
> > for other issues to fix.
>
> Nice work you are doing with the contribution period :)
>
> I just want to second what Sumera said.
> Since Sumera had already replied in the past email thread[1] (which you also
> replied, so I guess you saw her reply there), she mentioned she would submit
> V2 with those changes.
>
> [1] https://groups.google.com/g/outreachy-kernel/c/-VkRW5siDic/m/vGVf6Ft0AwAJ
>
> In a community workflow, when a person sends a patch and people request
> changes, we usually wait for the original author to submit v2, even if you
> know how to fix it quickly.
> And if, for some reason, you need that change now (which wasn't the case),
> it is a good practice to ask the author if you can send v2 on their behalf.
>
> You can expect the same from others too. I hope this helps a bit, clarifying how
> the community works :)
>
> Keep the nice work!
>
> Regards,
> Helen
>
Hi Helen,
That makes perfect sense. It was my bad. I should not have modified
these files. I will remember your advise going forward.
Hi Sumera,
Once again, sorry for the overstepping. I will keep the protocol in mind
going forward.
For now, I am happy if you would like to get these patches on your name
since you started with these. Absolutely fine with me.
Thank you,
Deepak.
> >
> > Thanks.
> > Deepak.
> >
> > > --
> > > > You received this message because you are subscribed to the Google Groups
> > > > "outreachy-kernel" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send an
> > > > email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > To view this discussion on the web visit
> > > > https://groups.google.com/d/msgid/outreachy-kernel/20201018180954.GA39024%40ubuntu204
> > > > .
> > > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20201018184550.GA53720%40ubuntu204.
next prev parent reply other threads:[~2020-10-19 1:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-18 18:09 [PATCH] staging: comedi: Use sysfs_emit for show(device *...) functions Deepak R Varma
2020-10-18 18:31 ` [Outreachy kernel] " Sumera Priyadarsini
2020-10-18 18:45 ` Deepak R Varma
2020-10-19 0:21 ` Helen Koike
2020-10-19 1:27 ` Deepak R Varma [this message]
2020-10-19 6:12 ` Sumera Priyadarsini
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=20201019012710.GA76378@ubuntu204 \
--to=mh12gx2825@gmail.com \
--cc=abbotti@mev.co.uk \
--cc=gregkh@linuxfoundation.org \
--cc=helen@koikeco.de \
--cc=hsweeten@visionengravers.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=sylphrenadin@gmail.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 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.