All of lore.kernel.org
 help / color / mirror / Atom feed
* format string mismatch in arch/sparc/kernel/sysfs.c
@ 2014-05-18 13:52 Toralf Förster
  2014-05-18 17:32 ` Sam Ravnborg
  2014-05-18 17:45 ` Toralf Förster
  0 siblings, 2 replies; 3+ messages in thread
From: Toralf Förster @ 2014-05-18 13:52 UTC (permalink / raw)
  To: sparclinux

Hi,

I'm just wondering if the format mismatch error is intentionally left in the code or not :

[arch/sparc/kernel/sysfs.c:154]: (warning) %ld in format string (no. 1) requires 'long *' but the argument type is 'unsigned long *'.


8a25a2fd arch/sparc/kernel/sysfs.c   (Kay Sievers      2011-12-21 14:29:42 -0800 149) static ssize_t store_mmustat_enable(struct device *s,
8a25a2fd arch/sparc/kernel/sysfs.c   (Kay Sievers      2011-12-21 14:29:42 -0800 150)                   struct device_attribute *attr, const char *buf,
4a0b2b4d arch/sparc64/kernel/sysfs.c (Andi Kleen       2008-07-01 18:48:41 +0200 151)                   size_t count)
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 152) {
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 153)   unsigned long val, err;
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 154)   int ret = sscanf(buf, "%ld", &val);               <--------------
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 155)
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 156)   if (ret != 1)
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 157)           return -EINVAL;
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 158)
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 159)   err = run_on_cpu(s->id, write_mmustat_enable, val);
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 160)   if (err)
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 161)           return -EIO;
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 162)
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 163)   return count;
d887ab3a arch/sparc64/kernel/sysfs.c (David Miller     2007-06-03 23:38:09 -0700 164) }

-- 
Toralf


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: format string mismatch in arch/sparc/kernel/sysfs.c
  2014-05-18 13:52 format string mismatch in arch/sparc/kernel/sysfs.c Toralf Förster
@ 2014-05-18 17:32 ` Sam Ravnborg
  2014-05-18 17:45 ` Toralf Förster
  1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2014-05-18 17:32 UTC (permalink / raw)
  To: sparclinux

Hi Torlaf.

> I'm just wondering if the format mismatch error is intentionally left in the code or not :
> 
> [arch/sparc/kernel/sysfs.c:154]: (warning) %ld in format string (no. 1) requires 'long *' but the argument type is 'unsigned long *'.

This is something we should fix.
My gcc does not give this warning - how did you produce the warning above?
Also we use -Werror on purpose to catch warnings so they get fixed - so
your build should have errored out.

Do you care to send a patch so you get proper attribution.

	Sam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: format string mismatch in arch/sparc/kernel/sysfs.c
  2014-05-18 13:52 format string mismatch in arch/sparc/kernel/sysfs.c Toralf Förster
  2014-05-18 17:32 ` Sam Ravnborg
@ 2014-05-18 17:45 ` Toralf Förster
  1 sibling, 0 replies; 3+ messages in thread
From: Toralf Förster @ 2014-05-18 17:45 UTC (permalink / raw)
  To: sparclinux

On 05/18/2014 07:32 PM, Sam Ravnborg wrote:
> Hi Torlaf.
> 
>> I'm just wondering if the format mismatch error is intentionally left in the code or not :
>>
>> [arch/sparc/kernel/sysfs.c:154]: (warning) %ld in format string (no. 1) requires 'long *' but the argument type is 'unsigned long *'.
> 
> This is something we should fix.
patch will be send out soon.

> My gcc does not give this warning - how did you produce the warning above?
Well, I got it with cppcheck - a nifty tool for static code checkin. I
stumbled over it a while ago - it still under development ofc.

> Also we use -Werror on purpose to catch warnings so they get fixed - so
> your build should have errored out.
> 
great

> Do you care to send a patch so you get proper attribution.

> 
> 	Sam
> 


-- 
Toralf


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-18 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-18 13:52 format string mismatch in arch/sparc/kernel/sysfs.c Toralf Förster
2014-05-18 17:32 ` Sam Ravnborg
2014-05-18 17:45 ` Toralf Förster

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.