From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: devel@driverdev.osuosl.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, navin patidar <navinp@cdac.in>,
Valentina Manea <valentina.manea.m@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: usbip: stub_main.c: Cleaning up missing null-terminate after strncpy call
Date: Fri, 13 Jun 2014 00:39:16 +0300 [thread overview]
Message-ID: <20140612213916.GX5500@mwanda> (raw)
In-Reply-To: <CAFo99gbu5GxKSyDEfo+wpzHkjQdxqDhXF9irtCUcCNjFG2GUBQ@mail.gmail.com>
On Thu, Jun 12, 2014 at 11:09:20PM +0200, Rickard Strandqvist wrote:
> I agree that you should not do patches just to silence a static control program.
>
> Concerning (len >= BUSID_SIZE) I agree! But I usually try to change as
> little as possible in the patches I do. But perhaps I should not think
> that way.
The "one thing per patch" rule is tricky for a lot of people when they
start upstream kernel programming.
1) If you are going to need to backport a patch then write the simplest
version you can and do any cleanup in a later patch.
2) Most of these patches will not need to back ported. The "one thing"
is about how you describe the patch. You're allowed to make minor
closely related changes. In this case the one thing would be, "Clean up
string handling in xxx()". The commit message would say:
cppcheck has a false positive here. I looked at the code and it's ok,
but a bit messy. I have cleaned it up by doing:
1) use strclpy() or whatever
2) cleanup a condition
3) remove obvious comments
4) blah blah blah
The new code is simpler and doesn't generate a cppcheck warning.
Where checkpatch.pl get into trouble is that they say "I am doing one
thing and it is to fix everything in filename.c". That's everything and
not "one thing".
regards,
dan carpenter
prev parent reply other threads:[~2014-06-12 21:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 21:39 [PATCH] staging: usbip: stub_main.c: Cleaning up missing null-terminate after strncpy call Rickard Strandqvist
2014-06-10 6:57 ` Dan Carpenter
2014-06-10 20:48 ` Rickard Strandqvist
2014-06-11 5:45 ` Dan Carpenter
2014-06-12 21:09 ` Rickard Strandqvist
2014-06-12 21:39 ` Dan Carpenter [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=20140612213916.GX5500@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=navinp@cdac.in \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=valentina.manea.m@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox