All of lore.kernel.org
 help / color / mirror / Atom feed
* build warning in drivers/macintosh/rack-meter.c
@ 2018-03-16  5:46 Stephen Rothwell
  2018-03-16  9:37 ` Aaro Koskinen
  2018-03-16 10:22 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Rothwell @ 2018-03-16  5:46 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, PowerPC; +Cc: Aaro Koskinen

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

Hi all,

These warnings have beeen around for a while now;

drivers/macintosh/rack-meter.c:157:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(rdma->buf1, 0, ARRAY_SIZE(rdma->buf1));
  ^~~~~~
drivers/macintosh/rack-meter.c:158:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(rdma->buf2, 0, ARRAY_SIZE(rdma->buf2));
  ^~~~~~

Introduced by commit

  4f7bef7a9f69 ("drivers: macintosh: rack-meter: fix bogus memsets")

I guess updating to a newer compiler has started generating these.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: build warning in drivers/macintosh/rack-meter.c
  2018-03-16  5:46 build warning in drivers/macintosh/rack-meter.c Stephen Rothwell
@ 2018-03-16  9:37 ` Aaro Koskinen
  2018-03-16  9:50   ` Stephen Rothwell
  2018-03-16 10:22 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2018-03-16  9:37 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Michael Ellerman, Benjamin Herrenschmidt, PowerPC

Hi,

On Fri, Mar 16, 2018 at 04:46:14PM +1100, Stephen Rothwell wrote:
> These warnings have beeen around for a while now;
> 
> drivers/macintosh/rack-meter.c:157:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
>   memset(rdma->buf1, 0, ARRAY_SIZE(rdma->buf1));
>   ^~~~~~
> drivers/macintosh/rack-meter.c:158:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
>   memset(rdma->buf2, 0, ARRAY_SIZE(rdma->buf2));
>   ^~~~~~
> 
> Introduced by commit
> 
>   4f7bef7a9f69 ("drivers: macintosh: rack-meter: fix bogus memsets")
> 
> I guess updating to a newer compiler has started generating these.

Eh, that's really embarrassing. Obviously it should be sizeof(). I can send
a fix for this and test on Xserve.

A.

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

* Re: build warning in drivers/macintosh/rack-meter.c
  2018-03-16  9:37 ` Aaro Koskinen
@ 2018-03-16  9:50   ` Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2018-03-16  9:50 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: Michael Ellerman, Benjamin Herrenschmidt, PowerPC

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

Hi Aaro,

On Fri, 16 Mar 2018 11:37:47 +0200 Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
>
> I can send a fix for this and test on Xserve.

Excellent.  (I should send emails about more old warnings :-))

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: build warning in drivers/macintosh/rack-meter.c
  2018-03-16  5:46 build warning in drivers/macintosh/rack-meter.c Stephen Rothwell
  2018-03-16  9:37 ` Aaro Koskinen
@ 2018-03-16 10:22 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-03-16 10:22 UTC (permalink / raw)
  To: Stephen Rothwell, Benjamin Herrenschmidt, PowerPC; +Cc: Aaro Koskinen

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi all,
>
> These warnings have beeen around for a while now;
>
> drivers/macintosh/rack-meter.c:157:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
>   memset(rdma->buf1, 0, ARRAY_SIZE(rdma->buf1));
>   ^~~~~~
> drivers/macintosh/rack-meter.c:158:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
>   memset(rdma->buf2, 0, ARRAY_SIZE(rdma->buf2));
>   ^~~~~~
>
> Introduced by commit
>
>   4f7bef7a9f69 ("drivers: macintosh: rack-meter: fix bogus memsets")

Yep looks like a bug.

Aaro, can you send a patch?

cheers

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

end of thread, other threads:[~2018-03-16 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16  5:46 build warning in drivers/macintosh/rack-meter.c Stephen Rothwell
2018-03-16  9:37 ` Aaro Koskinen
2018-03-16  9:50   ` Stephen Rothwell
2018-03-16 10:22 ` Michael Ellerman

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.