From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: mm-commits@vger.kernel.org, mathieu.desnoyers@polymtl.ca,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: + markers-dont-risk-null-deref-in-marker-checkpatch-fixes.patch added to -mm tree
Date: Thu, 28 Feb 2008 23:36:24 +0100 [thread overview]
Message-ID: <9a8748490802281436h350bccafy88bb059d63fe3b74@mail.gmail.com> (raw)
In-Reply-To: <200802280334.m1S3YbWM013644@imap1.linux-foundation.org>
On 28/02/2008, akpm@linux-foundation.org <akpm@linux-foundation.org> wrote:
>
> The patch titled
> markers-dont-risk-null-deref-in-marker-checkpatch-fixes
> has been added to the -mm tree. Its filename is
> markers-dont-risk-null-deref-in-marker-checkpatch-fixes.patch
>
<snip>
> Subject: markers-dont-risk-null-deref-in-marker-checkpatch-fixes
> From: Andrew Morton <akpm@linux-foundation.org>
>
Andrew, I very much do not agree with you and/or checkpatch here :
> WARNING: braces {} are not necessary for single statement blocks
> #34: FILE: kernel/marker.c:715:
> + if (!entry) {
> + goto end;
> + }
>
> total: 0 errors, 1 warnings, 29 lines checked
>
> ./patches/markers-dont-risk-null-deref-in-marker.patch has style problems, please review. If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
>
> Please run checkpatch prior to sending patches
>
> Cc: Jesper Juhl <jesper.juhl@gmail.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> kernel/marker.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff -puN kernel/marker.c~markers-dont-risk-null-deref-in-marker-checkpatch-fixes kernel/marker.c
> --- a/kernel/marker.c~markers-dont-risk-null-deref-in-marker-checkpatch-fixes
> +++ a/kernel/marker.c
> @@ -702,9 +702,8 @@ int marker_probe_unregister(const char *
>
> mutex_lock(&markers_mutex);
> entry = get_marker(name);
> - if (!entry) {
> + if (!entry)
> goto end;
> - }
> if (entry->rcu_pending)
> rcu_barrier();
> old = marker_entry_remove_probe(entry, probe, probe_private);
> @@ -712,9 +711,8 @@ int marker_probe_unregister(const char *
> marker_update_probes(); /* may update entry */
> mutex_lock(&markers_mutex);
> entry = get_marker(name);
> - if (!entry) {
> + if (!entry)
> goto end;
> - }
> entry->oldptr = old;
> entry->rcu_pending = 1;
> /* write rcu_pending before calling the RCU callback */
While it is entirely true that the compiler has no need for the extra
{} they are very nice for human readers/editors of the code - and if
what's inside happens to be a macro, also potentially safer.
I left them in very much on purpose.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
parent reply other threads:[~2008-02-28 22:36 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200802280334.m1S3YbWM013644@imap1.linux-foundation.org>]
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=9a8748490802281436h350bccafy88bb059d63fe3b74@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mm-commits@vger.kernel.org \
/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®