public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Dave Jones <davej@redhat.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: make checkpatch warn about memset with swapped arguments.
Date: Thu, 17 Mar 2011 15:56:24 -0700	[thread overview]
Message-ID: <m2wrjxtkyv.fsf@firstfloor.org> (raw)
In-Reply-To: <20110317045209.GA18656@redhat.com> (Dave Jones's message of "Thu, 17 Mar 2011 00:52:09 -0400")

Dave Jones <davej@redhat.com> writes:

> Because the second and third arguments of memset have the same type,
> it turns out to be really easy to mix them up.
>
> This bug comes up time after time, so checkpatch should really
> be checking for it at patch submission time.

Or we just readd an optimized bzero() and recommend people use that
instead of memset for zero? And then there won't be too many users left.

I always felt classic BSD was much more sensible regarding this than
ANSI-C.

It's better to avoid errors in the first place than to check for
them later.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

      parent reply	other threads:[~2011-03-17 22:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17  4:52 make checkpatch warn about memset with swapped arguments Dave Jones
2011-03-17 19:36 ` Steven Rostedt
2011-03-17 20:02   ` Dave Jones
2011-03-17 20:37     ` Steven Rostedt
2011-03-17 21:11       ` Andrew Morton
2011-03-17 21:32         ` Dave Jones
2011-03-17 21:57           ` Andrew Morton
2011-03-17 22:04             ` Steven Rostedt
2011-03-17 21:38         ` Steven Rostedt
2011-03-17 21:51           ` Dave Jones
2011-03-17 22:56 ` Andi Kleen [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=m2wrjxtkyv.fsf@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@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