Michael Buesch wrote: > On Friday 14 August 2009 00:15:07 Larry Finger wrote: >> The b43 driver generates the following sparse warnings: >> >> CHECK drivers/net/wireless/b43/phy_g.c >> drivers/net/wireless/b43/phy_g.c:974:35: warning: cast truncates bits from constant value (ffff7fff becomes 7fff) >> CHECK drivers/net/wireless/b43/wa.c >> drivers/net/wireless/b43/wa.c:385:53: warning: cast truncates bits from constant value (ffff00ff becomes ff) >> drivers/net/wireless/b43/wa.c:403:48: warning: cast truncates bits from constant value (ffff00ff becomes ff) >> drivers/net/wireless/b43/wa.c:405:48: warning: cast truncates bits from constant value (ffff00ff becomes ff) >> drivers/net/wireless/b43/wa.c:415:50: warning: cast truncates bits from constant value (ffff0fff becomes fff) >> >> Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> >> --- >> >> John, >> >> There is no hurry for this material. >> >> Larry >> --- >> >> Index: wireless-testing/drivers/net/wireless/b43/phy_g.c >> =================================================================== >> --- wireless-testing.orig/drivers/net/wireless/b43/phy_g.c >> +++ wireless-testing/drivers/net/wireless/b43/phy_g.c >> @@ -971,7 +971,7 @@ b43_radio_interference_mitigation_enable >> b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B); >> >> if (phy->rev >= 3) { >> - b43_phy_mask(dev, 0x048A, (u16)~0x8000); >> + b43_phy_mask(dev, 0x048A, (u16)(~0x8000 & 0xFFFF)); > > Uh come on... > The u16 cast already is stupid as hell, but this is becoming braindead. > The code is perfectly fine. Sparse should instead provide an option to disable > this fragile check. John, Just drop this patch. The code is OK as is. Larry -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html