All of lore.kernel.org
 help / color / mirror / Atom feed
* fix sparse warning in horizon atm driver.
@ 2005-11-09  5:57 Dave Jones
  2005-11-09 21:07 ` David S. Miller
  2005-11-10 16:00 ` chas williams - CONTRACTOR
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Jones @ 2005-11-09  5:57 UTC (permalink / raw)
  To: Linux Kernel

these vars get fed u32's, and are OR'd with u32's.
Chances are they were meant to be u32's.

I don't have hardware to test this, but I can't fathom
why a u16 would be used here.

drivers/atm/horizon.c:1564:12: warning: cast truncates bits from constant value (40000000 becomes 0)
drivers/atm/horizon.c:1565:12: warning: cast truncates bits from constant value (40000000 becomes 0)
drivers/atm/horizon.c:1569:12: warning: cast truncates bits from constant value (80000000 becomes 0)
drivers/atm/horizon.c:1570:12: warning: cast truncates bits from constant value (80000000 becomes 0)

Signed-off-by: Dave Jones <davej@redhat.com>

--- linus/drivers/atm/horizon.c~	2005-11-09 00:51:50.000000000 -0500
+++ linus/drivers/atm/horizon.c	2005-11-09 00:55:36.000000000 -0500
@@ -1511,8 +1511,8 @@ static inline short setup_idle_tx_channe
     // a.k.a. prepare the channel and remember that we have done so.
     
     tx_ch_desc * tx_desc = &memmap->tx_descs[tx_channel];
-    u16 rd_ptr;
-    u16 wr_ptr;
+    u32 rd_ptr;
+    u32 wr_ptr;
     u16 channel = vcc->channel;
     
     unsigned long flags;

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

* Re: fix sparse warning in horizon atm driver.
  2005-11-09  5:57 fix sparse warning in horizon atm driver Dave Jones
@ 2005-11-09 21:07 ` David S. Miller
  2005-11-10 16:00 ` chas williams - CONTRACTOR
  1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2005-11-09 21:07 UTC (permalink / raw)
  To: davej; +Cc: linux-kernel

From: Dave Jones <davej@redhat.com>
Date: Wed, 9 Nov 2005 00:57:39 -0500

> these vars get fed u32's, and are OR'd with u32's.
> Chances are they were meant to be u32's.
> 
> I don't have hardware to test this, but I can't fathom
> why a u16 would be used here.
> 
> drivers/atm/horizon.c:1564:12: warning: cast truncates bits from constant value (40000000 becomes 0)

Hmmm... I would merge this directly, but I'd like Chas Williams
(the ATM maintainer) to glance it over first.  Can you forward
it to him (CC:'ing the linux-atm list, also mentioned in MAINTAINERS,
of course)?  Thanks.

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

* Re: fix sparse warning in horizon atm driver.
  2005-11-09  5:57 fix sparse warning in horizon atm driver Dave Jones
  2005-11-09 21:07 ` David S. Miller
@ 2005-11-10 16:00 ` chas williams - CONTRACTOR
  2005-11-10 20:56   ` David S. Miller
  1 sibling, 1 reply; 4+ messages in thread
From: chas williams - CONTRACTOR @ 2005-11-10 16:00 UTC (permalink / raw)
  To: Dave Jones, davem; +Cc: Linux Kernel

In message <20051109055739.GA630@redhat.com>,Dave Jones writes:
>these vars get fed u32's, and are OR'd with u32's.
>Chances are they were meant to be u32's.
>
>I don't have hardware to test this, but I can't fathom
>why a u16 would be used here.

i guess someone got confused over BUFFER_PTR_MASK.  this patch 
looks fine to me.


[ATM]: [horizon] fix sparse warnings

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Chas Williams <cmas@cmf.nrl.navy.mil>

--- linus/drivers/atm/horizon.c~	2005-11-09 00:51:50.000000000 -0500
+++ linus/drivers/atm/horizon.c	2005-11-09 00:55:36.000000000 -0500
@@ -1511,8 +1511,8 @@ static inline short setup_idle_tx_channe
     // a.k.a. prepare the channel and remember that we have done so.
     
     tx_ch_desc * tx_desc = &memmap->tx_descs[tx_channel];
-    u16 rd_ptr;
-    u16 wr_ptr;
+    u32 rd_ptr;
+    u32 wr_ptr;
     u16 channel = vcc->channel;
     
     unsigned long flags;

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

* Re: fix sparse warning in horizon atm driver.
  2005-11-10 16:00 ` chas williams - CONTRACTOR
@ 2005-11-10 20:56   ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2005-11-10 20:56 UTC (permalink / raw)
  To: chas3, chas; +Cc: davej, linux-kernel

From: "chas williams - CONTRACTOR" <chas@cmf.nrl.navy.mil>
Date: Thu, 10 Nov 2005 11:00:39 -0500

> [ATM]: [horizon] fix sparse warnings
> 
> Signed-off-by: Dave Jones <davej@redhat.com>
> Signed-off-by: Chas Williams <cmas@cmf.nrl.navy.mil>

Applied, thanks everyone.

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

end of thread, other threads:[~2005-11-10 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09  5:57 fix sparse warning in horizon atm driver Dave Jones
2005-11-09 21:07 ` David S. Miller
2005-11-10 16:00 ` chas williams - CONTRACTOR
2005-11-10 20:56   ` David S. Miller

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.