Skip to contentSkip to conversation

mwl8: fix build warning.

PATCH RESEND In review Rami Rosen 2 participants 3 messages Apr 21, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Rami Rosen

author
#0 lore raw

PATCH RESEND 1/1 mwl8: fix build warning.

This patch fixes a build warning in mwl8.c.
(Marvell TOPDOG wireless driver)

The warning it fixes is: "large integer implicitly truncated to unsigned type."

The rx_ctrl member of the mwl8k_rx_desc struct is 8 bit (__u8 ), whereas trying to assign it a 32 bit value (which is returned from cpu_to_le32()) causes the compiler to issue
a truncation warning.

--
(wireless-next)

drivers/net/wireless/mwl8k.c +0 -0
index 57a0268..8bc016c 100644
@@ -893,8 +893,7 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw,

int index)

               rx_desc->next_rx_desc_phys_addr =
                       cpu_to_le32(rxq->rx_desc_dma
                                               + nexti * sizeof(*rx_desc));
-               rx_desc->rx_ctrl =
-                       cpu_to_le32(MWL8K_RX_CTRL_OWNED_BY_HOST);
+               rx_desc->rx_ctrl = MWL8K_RX_CTRL_OWNED_BY_HOST;
       }

       return 0;
#1 lore raw
Quoted 5 lines · Rami Rosen

This patch fixes a build warning in mwl8.c.
(Marvell TOPDOG wireless driver)

The warning it fixes is: "large integer implicitly truncated to unsigned type."

Quoted 7 lines

The rx_ctrl member of the mwl8k_rx_desc struct is 8 bit (__u8 ), whereas trying to assign it a 32 bit value (which is returned from cpu_to_le32()) causes the compiler to issue
a truncation warning.

Oh, duh...I should have looked for the obvious answer... :-)

Thanks,

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#2 lore raw
In reply to Rami Rosen
Quoted 30 lines · Rami Rosen

This patch fixes a build warning in mwl8.c.
(Marvell TOPDOG wireless driver)

The warning it fixes is: "large integer implicitly truncated to unsigned type."

The rx_ctrl member of the mwl8k_rx_desc struct is 8 bit (__u8 ), whereas trying to assign it a 32 bit value (which is returned from cpu_to_le32()) causes the compiler to issue
a truncation warning.

--
(wireless-next)

drivers/net/wireless/mwl8k.c +1 -2
index 57a0268..8bc016c 100644
@@ -893,8 +893,7 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw,
 int index)
               rx_desc->next_rx_desc_phys_addr =
                       cpu_to_le32(rxq->rx_desc_dma
                                               + nexti * sizeof(*rx_desc));
-               rx_desc->rx_ctrl =
-                       cpu_to_le32(MWL8K_RX_CTRL_OWNED_BY_HOST);
+               rx_desc->rx_ctrl = MWL8K_RX_CTRL_OWNED_BY_HOST;
       }
 
Quoted 1 line
       return 0;

This patch is whitspace damaged. I manually recreated it since it is so simple, but please do be more careful with future patches.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.