public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jean Delvare <khali@linux-fr.org>
Cc: djwong@us.ibm.com, mhoffman@lightlink.com,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: Re: [resend] [PATCH v2] ibmaem: New driver for  power/energy meters in IBM System X hardware
Date: Tue, 6 May 2008 23:11:14 -0700	[thread overview]
Message-ID: <20080506231114.d5a0b6e7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080507080105.5484c58a@hyperion.delvare>


On Wed, 7 May 2008 08:01:05 +0200 Jean Delvare <khali@linux-fr.org> wrote:

> On Tue, 6 May 2008 17:36:07 -0700, Andrew Morton wrote:
> > A checkpatch version which you might not have says
> > 
> > WARNING: consider using strict_strtol in preference to simple_strtol
> > #1015: FILE: drivers/hwmon/ibmaem.c:918:
> > +       int temp = simple_strtol(buf, NULL, 10); \
> > 
> > total: 0 errors, 1 warnings, 1221 lines checked
> > 
> > because the code as you have it will accept input of the form "12foo". 
> > strict_strtol() will error on that.
> 
> As a side note, I really wonder why this new function wasn't named just
> strtol(), especially if the general idea is to get rid of the "simple"
> variant after some time.

didn't think of doing that.

But:

y:/home/akpm> cat t.c
#include <stdlib.h>
#include <stdio.h>

main()
{
        unsigned long u = strtoul("12foo", 0, 10);
        printf("%lu\n", u);
}
y:/home/akpm> gcc t.c
y:/home/akpm> ./a.out
12


strtoul() has different behaviour.

      reply	other threads:[~2008-05-07  6:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03  4:55 [PATCH] i5k_amb: Support Intel 5400 chipset Darrick J. Wong
2008-05-05 20:56 ` Andrew Morton
2008-05-05 21:22   ` [lm-sensors] " Jean Delvare
2008-05-05 21:39     ` Andrew Morton
2008-05-05 23:04   ` ibmaem driver status? Darrick J. Wong
2008-05-06 21:04     ` Andrew Morton
2008-05-06 22:38       ` [resend] [PATCH v2] ibmaem: New driver for power/energy meters in IBM System X hardware Darrick J. Wong
2008-05-07  0:32         ` Andrew Morton
2008-05-07  0:36         ` Andrew Morton
2008-05-07  6:01           ` Jean Delvare
2008-05-07  6:11             ` Andrew Morton [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=20080506231114.d5a0b6e7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=djwong@us.ibm.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mhoffman@lightlink.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