drivers/net: fix (sparse) warnings
Subsystems (10)
cover drivers/net: fix (sparse) warnings
The following series fixes a couple of (sparse) warnings.
---
Hannes Eder (43):
drivers/net/wireless/prism54: fix sparse warning: fix signedness drivers/net/wireless/ipw2x00: fix sparse warnings: fix signedness drivers/net/wireless/b43: fix warning: format not a string literal and no ... drivers/net/wireless/ath9k: fix sparse warnings: Should it be static? drivers/net/wireless: fix sparse warnings: fix signedness drivers/net/wireless: fix sparse warnings: symbol shadows an earlier one drivers/net/wireless: fix sparse warning: context imbalance drivers/net/wan: fix sparse warning: symbol shadows an earlier one drivers/net/wan: fix warning: format not a string literal and no ... drivers/net/usb: fix sparse warnings: Should it be static? drivers/net/tulip: fix sparse warning: symbol shadows an earlier one drivers/net/tulip: fix warning: format not a string literal and no ... drivers/net/tokenring: fix sparse warning: cast truncates bits from const value drivers/net/tokenring: fix sparse warning: symbol shadows an earlier one drivers/net/tokenring: fix warning: format not a string literal and no ... drivers/net/skfp: fix sparse warning: move decls to header file drivers/net/sfc: fix sparse warnings: Should it be static? drivers/net/sfc: fix sparse warning: symbol shadows an earlier one drivers/net/pcmcia: fix warning: format not a string literal and no ... drivers/net/ixgbe: fix sparse warning: Should it be static? drivers/net/igb: fix sparse warning: symbol shadows an earlier one drivers/net/hamradio: fix sparse warnings: fix signedness drivers/net/hamradio: fix sparse warning: symbol shadows an earlier one drivers/net/hamradio: fix sparse warning: context imbalance drivers/net/hamradio: fix warning: format not a string literal and no ... drivers/net/e1000e: fix sparse warning: Should it be static? drivers/net/cxgb3: fix sparse warnings: fix signedness drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one drivers/net/bonding: fix sparse warning: symbol shadows an earlier one drivers/net/bonding: fix sparse warnings: context imbalance drivers/net/atlx: fix sparse warnings: fix signedness drivers/net/atl1e: fix sparse warnings: fix signedness drivers/net/arcnet: fix sparse warning: symbol shadows an earlier one drivers/net/s2io.c: fix sparse warning: symbol shadows an earlier one drivers/net/r6040.c: fix sparse warning: Using plain integer as NULL pointer drivers/net/ppp*.c: fix sparse warnings: fix signedness drivers/net/ni65.c: fix sparse warnings: fix signedness drivers/net/lance.c: fix sparse warnings: fix signedness drivers/net/niu.c: fix sparse warning: symbol shadows an earlier one drivers/net/ns83820.c: fix sparse warnings: fix signedness drivers/net/ni65.c: fix sparse warnings: symbol shadows an earlier one drivers/net/e2100.c: fix sparse warning: symbol shadows an earlier one drivers/net/at1700.c: fix sparse warning: symbol shadows an earlier one
drivers/net/arcnet/arcnet.c | 1 - drivers/net/at1700.c | 2 +- drivers/net/atl1e/atl1e.h | 2 +- drivers/net/atl1e/atl1e_param.c | 2 +- drivers/net/atlx/atl1.c | 2 +- drivers/net/atlx/atl2.c | 2 +- drivers/net/bonding/bond_alb.c | 8 ++++++++ drivers/net/bonding/bond_main.c | 14 +++++++++++--- drivers/net/cxgb3/ael1002.c | 3 ++- drivers/net/cxgb3/cxgb3_main.c | 3 +-- drivers/net/e1000e/82571.c | 2 +- drivers/net/e2100.c | 6 +++--- drivers/net/hamradio/6pack.c | 4 ++-- drivers/net/hamradio/bpqether.c | 5 ++++- drivers/net/hamradio/mkiss.c | 9 +++++---- drivers/net/hamradio/scc.c | 3 ++- drivers/net/hamradio/yam.c | 9 +++++---- drivers/net/igb/igb_main.c | 4 ++-- drivers/net/ixgbe/ixgbe_82598.c | 2 +- drivers/net/lance.c | 11 ++++++----- drivers/net/ni65.c | 11 +++++------ drivers/net/niu.c | 2 +- drivers/net/ns83820.c | 2 +- drivers/net/pcmcia/axnet_cs.c | 2 +- drivers/net/ppp_generic.c | 2 +- drivers/net/pppoe.c | 2 +- drivers/net/pppol2tp.c | 2 +- drivers/net/r6040.c | 4 ++-- drivers/net/s2io.c | 1 - drivers/net/sfc/mtd.c | 3 +++ drivers/net/sfc/tenxpress.c | 7 +++---- drivers/net/skfp/h/smc.h | 17 +++++++++++++++++ drivers/net/skfp/hwmtm.c | 9 --------- drivers/net/skfp/pcmplc.c | 3 --- drivers/net/skfp/skfddi.c | 3 --- drivers/net/skfp/smt.c | 10 ---------- drivers/net/tokenring/lanstreamer.c | 2 -- drivers/net/tokenring/madgemc.c | 2 -- drivers/net/tokenring/olympic.c | 1 - drivers/net/tokenring/smctr.c | 3 ++- drivers/net/tokenring/smctr.h | 2 +- drivers/net/tulip/de4x5.c | 7 ++++--- drivers/net/tulip/media.c | 8 +++----- drivers/net/tulip/winbond-840.c | 2 +- drivers/net/usb/hso.c | 10 +++++----- drivers/net/usb/smsc95xx.c | 2 +- drivers/net/wan/lapbether.c | 3 ++- drivers/net/wan/sbni.c | 17 +++++++++-------- drivers/net/wan/z85230.c | 3 ++- drivers/net/wireless/airo.c | 6 ++---- drivers/net/wireless/ath9k/eeprom.c | 8 ++++---- drivers/net/wireless/b43/main.c | 10 +++++----- drivers/net/wireless/ipw2x00/ipw2100.c | 9 +++++---- drivers/net/wireless/prism54/isl_ioctl.c | 3 ++- drivers/net/wireless/prism54/oid_mgt.c | 2 +- drivers/net/wireless/strip.c | 2 ++ drivers/net/wireless/wavelan.c | 8 ++++---- include/linux/hdlcdrv.h | 2 +- 58 files changed, 150 insertions(+), 136 deletions(-)
PATCH 1/43 drivers/net/at1700.c: fix sparse warning: symbol shadows an earlier one
Impact: Move variable declaration to a more inner scope.
Fix this sparse warning:
drivers/net/at1700.c:846:21: warning: symbol 'i' shadows an earlier one drivers/net/at1700.c:831:13: originally declared here
--- drivers/net/at1700.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/at1700.c +1 -1
@@ -828,7 +828,6 @@ set_rx_mode(struct net_device *dev)struct net_local *lp =netdev_priv (dev);unsigned char mc_filter[8 ];/* Multicast hash filter */ unsigned long flags; -int i;if (dev->flags &IFF_PROMISC ) {memset (mc_filter,0xff ,sizeof (mc_filter));
@@ -857,6 +856,7 @@ set_rx_mode(struct net_device *dev)spin_lock_irqsave (&lp->lock, flags);if (memcmp (mc_filter, lp->mc_filter,sizeof (mc_filter))) { +int i;int saved_bank =inw (ioaddr +CONFIG_0 );/* Switch to bank 1 and set the multicast table. */ outw ((saved_bank & ~0x0C00 ) |0x0480 , ioaddr +CONFIG_0 );
Re: [PATCH 01/43] drivers/net/at1700.c: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:11:55 +0100
Quoted 7 lines
Impact: Move variable declaration to a more inner scope.
Fix this sparse warning:
drivers/net/at1700.c:846:21: warning: symbol 'i' shadows an earlier onedrivers/net/at1700.c:831:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 2/43 drivers/net/e2100.c: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Remove redundant inner scope variable and while being at it make use of ARRAY_SIZE instead of a hardcoded number.
Fix this sparse warning:
drivers/net/e2100.c:219:56: warning: symbol 'i' shadows an earlier one drivers/net/e2100.c:181:13: originally declared here
--- drivers/net/e2100.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e2100.c +3 -3
@@ -216,13 +216,13 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)printk (" %02X" , station_addr[i]);if (dev->irq <2 ) { -int irqlist[] = {15 ,11 ,10 ,12 ,5 ,9 ,3 ,4 }, i; -for (i =0 ; i <8 ; i++) +int irqlist[] = {15 ,11 ,10 ,12 ,5 ,9 ,3 ,4 }; +for (i =0 ; i <ARRAY_SIZE (irqlist); i++)if (request_irq (irqlist[i],NULL ,0 ,"bogus" ,NULL ) != -EBUSY ) { dev->irq = irqlist[i];break ; } -if (i >=8 ) { +if (i >=ARRAY_SIZE (irqlist)) {printk (" unable to get IRQ %d.\n" , dev->irq); retval = -EAGAIN ; goto out;
Re: [PATCH 02/43] drivers/net/e2100.c: fix sparse warning: symbol shadows an earlier one
Hi Hannes,
it is ok to replace a fixed boarder with ARRAY_SIZE()
in this special case i would success the following additional cleanup (untestet !!)
static int set_free_irq(struct net_device *dev)
{
int irqlist[] = {15,11,10,12,5,9,3,4}, i;
for (i = 0; i < ARRAY_SIZE(irqlist); i++)
if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) {
dev->irq = irqlist[i];
return 0;
}
return -1;
}....
if (dev->irq < 2) {
if ( set_free_irq(dev) < 0) {
printk(" unable to get IRQ %d.\n", dev->irq);
retval = -EAGAIN;
goto out;
}for me this looks more readable.
getting a free interrupt from a list mus be a common problem ? I am not in driver programming perhaps such a code is already in place somewhere ?
comments ?
re,
wh
Quoted 41 lines · Hannes Eder
Impact: Remove redundant inner scope variable and while being at it make use of
ARRAY_SIZEinstead of a hardcoded number.Fix this sparse warning:
drivers/net/e2100.c:219:56: warning: symbol 'i' shadows an earlier onedrivers/net/e2100.c:181:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>--- drivers/net/e2100.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)drivers/net/e2100.c +3
-4@@ -216,13 +216,13 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)printk (" %02X" , station_addr[i]);if (dev->irq <2 ) { -int irqlist[] = {15 ,11 ,10 ,12 ,5 ,9 ,3 ,4 }, i; -for (i =0 ; i <8 ; i++) +int irqlist[] = {15 ,11 ,10 ,12 ,5 ,9 ,3 ,4 }; +for (i =0 ; i <ARRAY_SIZE (irqlist); i++)if (request_irq (irqlist[i],NULL ,0 ,"bogus" ,NULL ) != -EBUSY ) { dev->irq = irqlist[i];break ; } -if (i >=8 ) { +if (i >=ARRAY_SIZE (irqlist)) {printk (" unable to get IRQ %d.\n" , dev->irq); retval = -EAGAIN ; goto out; --To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/43] drivers/net/e2100.c: fix sparse warning: symbol shadows an earlier one
Quoted 27 lines · walter harms
Hi Hannes,
it is ok to replace a fixed boarder withARRAY_SIZE()
in this special case i would success the following additional cleanup (untestet !!)static int
set_free_irq(struct net_device *dev)
{
int irqlist[] = {15,11,10,12,5,9,3,4}, i;for (i = 0; i < ARRAY_SIZE(irqlist); i++) if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) { dev->irq = irqlist[i]; return 0; } return -1; }....
if (dev->irq < 2) { if ( set_free_irq(dev) < 0) { printk(" unable to get IRQ %d.\n", dev->irq); retval = -EAGAIN; goto out; }
Quoted 4 lines
for me this looks more readable.
getting a free interrupt from a list mus be a common problem ? I am not in driver programming perhaps such a code is already in place somewhere ?
I am a great fan of refactoring but in that case I would just leave it as is. If extracting a method I would extract a little more here.
Best,
Hannes
Re: [PATCH 02/43] drivers/net/e2100.c: fix sparse warning: symbol shadows an earlier one
Quoted 28 lines · Hannes Eder
Quoted 27 lines · walter harms
Hi Hannes,
it is ok to replace a fixed boarder withARRAY_SIZE()
in this special case i would success the following additional cleanup (untestet !!)static int
set_free_irq(struct net_device *dev)
{
int irqlist[] = {15,11,10,12,5,9,3,4}, i;for (i = 0; i < ARRAY_SIZE(irqlist); i++) if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) { dev->irq = irqlist[i]; return 0; } return -1; }....
if (dev->irq < 2) { if ( set_free_irq(dev) < 0) { printk(" unable to get IRQ %d.\n", dev->irq); retval = -EAGAIN; goto out; }
Quoted 8 lines
Quoted 4 lines
for me this looks more readable.
getting a free interrupt from a list mus be a common problem ? I am not in driver programming perhaps such a code is already in place somewhere ?
I am a great fan of refactoring but in that case I would just leave it as is. If extracting a method I would extract a little more here.
Me too,
i hope the driver maintainer reads it and will react accordingly.
re,
wh
Re: [PATCH 02/43] drivers/net/e2100.c: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderFrom: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:12:10 +0100
Quoted 8 lines
Impact: Remove redundant inner scope variable and while being at it make use of
ARRAY_SIZEinstead of a hardcoded number.Fix this sparse warning:
drivers/net/e2100.c:219:56: warning: symbol 'i' shadows an earlier onedrivers/net/e2100.c:181:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 3/43 drivers/net/ni65.c: fix sparse warnings: symbol shadows an earlier one
In reply to Hannes EderImpact: Remove redundant variable declaration or move them to a more inner scope.
Fix this sparse warnings:
drivers/net/ni65.c:900:37: warning: symbol 'p' shadows an earlier one drivers/net/ni65.c:874:21: originally declared here drivers/net/ni65.c:925:21: warning: symbol 'p' shadows an earlier one drivers/net/ni65.c:874:21: originally declared here drivers/net/ni65.c:945:29: warning: symbol 'k' shadows an earlier one drivers/net/ni65.c:926:15: originally declared here
--- drivers/net/ni65.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/ni65.c +2 -4
@@ -897,7 +897,6 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)if (csr0 &CSR0_ERR ) { -struct priv *p = dev->ml_priv;if (debuglevel >1 )printk (KERN_ERR "%s: general error: %04x.\n" ,dev->name,csr0);if (csr0 &CSR0_BABL )
@@ -922,8 +921,7 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)int j;for (j=0 ;j<RMDNUM ;j++) { -struct priv *p = dev->ml_priv; -int i,k,num1,num2; +int i, num2;for (i=RMDNUM -1 ;i>0 ;i--) { num2 = (p->rmdnum + i) & (RMDNUM -1 );if (!(p->rmdhead[num2].u.s.status &RCV_OWN ))
@@ -931,6 +929,7 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id) }if (i) { +int k, num1;for (k=0 ;k<RMDNUM ;k++) { num1 = (p->rmdnum + k) & (RMDNUM -1 );if (!(p->rmdhead[num1].u.s.status &RCV_OWN ))
@@ -942,7 +941,6 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)if (debuglevel >0 ) {char buf[256 ],*buf1; -int k; buf1 = buf;for (k=0 ;k<RMDNUM ;k++) {sprintf (buf1,"%02x " ,(p->rmdhead[k].u.s.status));/* & RCV_OWN) ); */
Re: [PATCH 03/43] drivers/net/ni65.c: fix sparse warnings: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:12:23 +0100
Quoted 11 lines
Impact: Remove redundant variable declaration or move them to a more inner scope.
Fix this sparse warnings:
drivers/net/ni65.c:900:37: warning: symbol 'p' shadows an earlier onedrivers/net/ni65.c:874:21: originally declared heredrivers/net/ni65.c:925:21: warning: symbol 'p' shadows an earlier onedrivers/net/ni65.c:874:21: originally declared heredrivers/net/ni65.c:945:29: warning: symbol 'k' shadows an earlier onedrivers/net/ni65.c:926:15: originally declared here
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 4/43 drivers/net/ns83820.c: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness) drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness) drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness) drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness)
--- drivers/net/ns83820.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ns83820.c +1 -1
@@ -409,7 +409,7 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */struct rx_info {spinlock_t lock;int up; -long idle; +unsigned long idle;struct sk_buff *skbs[NR_RX_DESC ];
Re: [PATCH 04/43] drivers/net/ns83820.c: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:12:36 +0100
Quoted 7 lines
Fix this sparse warnings:
drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness)drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness)drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness)drivers/net/ns83820.c:479:36: warning: incorrect type in argument 2 (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 5/43 drivers/net/niu.c: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Move variable declaration to a more inner scope.
Fix this sparse warning:
drivers/net/niu.c:2399:21: warning: symbol 'err' shadows an earlier one drivers/net/niu.c:2287:13: originally declared here
--- drivers/net/niu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/niu.c +1 -1
@@ -2284,7 +2284,6 @@ static int serdes_init_10g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;unsigned long ctrl_reg, test_cfg_reg, pll_cfg, i;u64 ctrl_val, test_cfg_val, sig, mask, val; -int err;u64 reset_val;switch (np->port) {
@@ -2337,6 +2336,7 @@ static int serdes_init_10g_serdes(struct niu *np)/* Initialize all 4 lanes of the SERDES. */ for (i =0 ; i <4 ; i++) {u32 rxtx_ctrl, glue0; +int err; err =esr_read_rxtx_ctrl (np, i, &rxtx_ctrl);if (err)
Re: [PATCH 05/43] drivers/net/niu.c: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:12:48 +0100
Quoted 7 lines
Impact: Move variable declaration to a more inner scope.
Fix this sparse warning:
drivers/net/niu.c:2399:21: warning: symbol 'err' shadows an earlier onedrivers/net/niu.c:2287:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 6/43 drivers/net/lance.c: fix sparse warnings: fix signedness
In reply to Hannes EderImpact: Besides from fixing the signedness issue remove some whitespace to obey to the 80 character limit.
Fix this sparse warnings:
drivers/net/lance.c:399:19: warning: incorrect type in assignment (different signedness) drivers/net/lance.c:654:29: warning: incorrect type in argument 2 (different signedness)
--- drivers/net/lance.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/lance.c +6 -5
@@ -391,7 +391,8 @@ MODULE_LICENSE("GPL");*/ static int __init do_lance_probe (struct net_device *dev) { -int *port, result; +unsigned int *port; +int result;if (high_memory <=phys_to_virt (16 *1024 *1024 )) lance_need_isa_bounce_buffers =0 ;
@@ -456,13 +457,13 @@ out:static int __init lance_probe1 (struct net_device *dev,int ioaddr,int irq,int options) {struct lance_private *lp; -long dma_channels;/* Mark spuriously-busy DMA channels */ +unsigned long dma_channels;/* Mark spuriously-busy DMA channels */ int i, reset_val, lance_version;const char *chipname;/* Flags for specific chips or boards. */ -unsigned char hpJ2405A =0 ;/* HP ISA adaptor */ -int hp_builtin =0 ;/* HP on-board ethernet. */ -static int did_version;/* Already printed version info. */ +unsigned char hpJ2405A =0 ;/* HP ISA adaptor */ +int hp_builtin =0 ;/* HP on-board ethernet. */ +static int did_version;/* Already printed version info. */ unsigned long flags;int err = -ENOMEM ;void __iomem *bios;
Re: [PATCH 06/43] drivers/net/lance.c: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:13:24 +0100
Quoted 8 lines
Impact: Besides from fixing the signedness issue remove some whitespace to obey to the 80 character limit.
Fix this sparse warnings:
drivers/net/lance.c:399:19: warning: incorrect type in assignment (different signedness)drivers/net/lance.c:654:29: warning: incorrect type in argument 2 (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 7/43 drivers/net/ni65.c: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/ni65.c:488:36: warning: incorrect type in argument 2 (different signedness)
--- drivers/net/ni65.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ni65.c +2 -2
@@ -481,8 +481,9 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)else {if (dev->dma =0 ) {/* 'stuck test' from lance.c */ -long dma_channels = ((inb (DMA1_STAT_REG ) >>4 ) &0x0f ) | - (inb (DMA2_STAT_REG ) &0xf0 ); + unsigned long dma_channels + ((inb(DMA1_STAT_REG) >> 4) & 0x0f) + | (inb (DMA2_STAT_REG ) &0xf0 );for (i=1 ;i<5 ;i++) {int dma = dmatab[i];if (test_bit (dma,&dma_channels) ||request_dma (dma,"ni6510" ))
Re: [PATCH 07/43] drivers/net/ni65.c: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:13:39 +0100
Quoted 4 lines
Fix this sparse warnings:
drivers/net/ni65.c:488:36: warning: incorrect type in argument 2 (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 8/43 drivers/net/ppp*.c: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/ppp_generic.c:919:43: warning: incorrect type in argument 1 (different signedness) drivers/net/pppoe.c:1195:43: warning: incorrect type in argument 1 (different signedness) drivers/net/pppol2tp.c:2666:43: warning: incorrect type in argument 1 (different signedness)
--- drivers/net/ppp_generic.c | 2 +- drivers/net/pppoe.c | 2 +- drivers/net/pppol2tp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ppp_generic.c +1 -1
@@ -183,7 +183,7 @@ static atomic_t ppp_unit_count = ATOMIC_INIT(0);static atomic_t channel_count =ATOMIC_INIT (0 );/* per-net private data for this module */ -static unsigned int ppp_net_id; +static int ppp_net_id;struct ppp_net {/* units to ppp mapping */ struct idr units_idr;
drivers/net/pppoe.c +1 -1
@@ -97,7 +97,7 @@ static const struct proto_ops pppoe_ops;static struct ppp_channel_ops pppoe_chan_ops;/* per-net private data for this module */ -static unsigned int pppoe_net_id; +static int pppoe_net_id;struct pppoe_net {/* * we could use _single_ hash table for all
drivers/net/pppol2tp.c +1 -1
@@ -232,7 +232,7 @@ static struct ppp_channel_ops pppol2tp_chan_ops = { pppol2tp_xmit , NULL };static struct proto_ops pppol2tp_ops;/* per-net private data for this module */ -static unsigned int pppol2tp_net_id; +static int pppol2tp_net_id;struct pppol2tp_net {struct list_head pppol2tp_tunnel_list;rwlock_t pppol2tp_tunnel_list_lock;
Re: [PATCH 08/43] drivers/net/ppp*.c: fix sparse warnings: fix signedness
[Hannes Eder - Sat, Feb 14, 2009 at 10:13:52PM +0100]
| Fix this sparse warnings: | drivers/net/ppp_generic.c:919:43: warning: incorrect type in argument 1 (different signedness) | drivers/net/pppoe.c:1195:43: warning: incorrect type in argument 1 (different signedness) | drivers/net/pppol2tp.c:2666:43: warning: incorrect type in argument 1 (different signedness) | | Signed-off-by: Hannes Eder <[email protected]>
...
Thanks Hannes,
- Cyrill -
Re: [PATCH 08/43] drivers/net/ppp*.c: fix sparse warnings: fix signedness
[Cyrill Gorcunov - Sun, Feb 15, 2009 at 12:29:48AM +0300]
| [Hannes Eder - Sat, Feb 14, 2009 at 10:13:52PM +0100] | | Fix this sparse warnings: | | drivers/net/ppp_generic.c:919:43: warning: incorrect type in argument 1 (different signedness) | | drivers/net/pppoe.c:1195:43: warning: incorrect type in argument 1 (different signedness) | | drivers/net/pppol2tp.c:2666:43: warning: incorrect type in argument 1 (different signedness) | | | | Signed-off-by: Hannes Eder <[email protected]> | ... | | Thanks Hannes, | | Acked-by: Cyrill Gorcunov <[email protected]> | | - Cyrill -
Btw I think the same fix could be applied ondrivers/net/tun.c (if you have time for :)
- Cyrill -
Re: [PATCH 08/43] drivers/net/ppp*.c: fix sparse warnings: fix signedness
Quoted 16 lines · Cyrill Gorcunov
[Cyrill Gorcunov - Sun, Feb 15, 2009 at 12:29:48AM +0300]
| [Hannes Eder - Sat, Feb 14, 2009 at 10:13:52PM +0100] | | Fix this sparse warnings: | | drivers/net/ppp_generic.c:919:43: warning: incorrect type in argument 1 (different signedness) | | drivers/net/pppoe.c:1195:43: warning: incorrect type in argument 1 (different signedness) | | drivers/net/pppol2tp.c:2666:43: warning: incorrect type in argument 1 (different signedness) | | | | Signed-off-by: Hannes Eder <[email protected]> | ... | | Thanks Hannes, | | Acked-by: Cyrill Gorcunov <[email protected]> | | - Cyrill -
Quoted 2 lines
Btw I think the same fix could be applied on
drivers/net/tun.c(if you have time for :)
This was fixed by this commit:
commit 745417e20684e4951afcabfe74583a3884e54980
Author: Gerrit Renker <[email protected]> Date: Sun Jan 4 17:14:46 2009 -0800
which is in the linux-next tree.
BTW, how can I check from which tree this commit came into the linux-next tree?
-Hannes
Re: [PATCH 08/43] drivers/net/ppp*.c: fix sparse warnings: fix signedness
[Hannes Eder - Sat, Feb 14, 2009 at 10:57:24PM +0100]
...
| > Btw I think the same fix could be applied on | > drivers/net/tun.c (if you have time for :) | | This was fixed by this commit: | commit 745417e20684e4951afcabfe74583a3884e54980 | Author: Gerrit Renker <[email protected]> | Date: Sun Jan 4 17:14:46 2009 -0800 | | which is in the linux-next tree.
Ah, good to know, thanks!
| | BTW, how can I check from which tree this commit came into the linux-next tree? | | -Hannes |
Not sure if it possible to find. if the commit was pulled without additional comments -- the only thing could be obtained -- is commit id itself. You better to ask someone who knows git well, not me :)
- Cyrill -
Re: [PATCH 08/43] drivers/net/ppp*.c: fix sparse warnings: fix signedness
In reply to Cyrill GorcunovFrom: Cyrill Gorcunov <[email protected]>
Date: Sun, 15 Feb 2009 00:29:48 +0300
Quoted 7 lines
[Hannes Eder - Sat, Feb 14, 2009 at 10:13:52PM +0100]
| Fix this sparse warnings: | drivers/net/ppp_generic.c:919:43: warning: incorrect type in argument 1 (different signedness) | drivers/net/pppoe.c:1195:43: warning: incorrect type in argument 1 (different signedness) | drivers/net/pppol2tp.c:2666:43: warning: incorrect type in argument 1 (different signedness) | | Signed-off-by: Hannes Eder <[email protected]>
Quoted 5 lines
...
Thanks Hannes,
Acked-by Cyrill Gorcunov <[email protected]>
Applied.
PATCH 9/43 drivers/net/r6040.c: fix sparse warning: Using plain integer as NULL pointer
In reply to Hannes EderFix this sparse warnings:
drivers/net/r6040.c:487:31: warning: Using plain integer as NULL pointer drivers/net/r6040.c:492:31: warning: Using plain integer as NULL pointer
--- drivers/net/r6040.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/r6040.c +2 -2
@@ -484,12 +484,12 @@ static int r6040_close(struct net_device *dev)/* Free Descriptor memory */ if (lp->rx_ring) {pci_free_consistent (pdev,RX_DESC_SIZE , lp->rx_ring, lp->rx_ring_dma); - lp->rx_ring =0 ; + lp->rx_ring =NULL ; }if (lp->tx_ring) {pci_free_consistent (pdev,TX_DESC_SIZE , lp->tx_ring, lp->tx_ring_dma); - lp->tx_ring =0 ; + lp->tx_ring =NULL ; }return 0 ;
Re: [PATCH 09/43] drivers/net/r6040.c: fix sparse warning: Using plain integer as NULL pointer
Hello Hannes,
Le Saturday 14 February 2009 22:14:04 Hannes Eder, vous avez écrit :
Quoted 3 lines
Fix this sparse warnings:
drivers/net/r6040.c:487:31: warning: Using plain integer as NULL pointerdrivers/net/r6040.c:492:31: warning: Using plain integer as NULL pointer
Good catch, thanks.
Quoted 2 lines
Signed-off-by Hannes Eder <[email protected]>
Signature · 4 lines
Best regards, Florian Fainelli Email : [email protected] http://openwrt.org -------------------------------
David Miller
maintainerRe: [PATCH 09/43] drivers/net/r6040.c: fix sparse warning: Using plain integer as NULL pointer
From: Florian Fainelli <[email protected]>
Date: Sun, 15 Feb 2009 15:00:06 +0100
Quoted 7 lines
Hello Hannes,
Le Saturday 14 February 2009 22:14:04 Hannes Eder, vous avez écrit :
Quoted 3 lines
Fix this sparse warnings:
drivers/net/r6040.c:487:31: warning: Using plain integer as NULL pointerdrivers/net/r6040.c:492:31: warning: Using plain integer as NULL pointer
Quoted 5 lines
Good catch, thanks.
Quoted 2 lines
Signed-off-by Hannes Eder <[email protected]>Acked-by Florian Fainelli <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/43 drivers/net/s2io.c: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Remove redundant inner scope variable.
Fix this sparse warning:
drivers/net/s2io.c:7223:21: warning: symbol 'i' shadows an earlier one drivers/net/s2io.c:7184:13: originally declared here
--- drivers/net/s2io.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/s2io.c +0 -1
@@ -7220,7 +7220,6 @@ static int s2io_card_up(struct s2io_nic * sp)/* Initialise napi */ if (config->napi) { -int i;if (config->intr_type =MSI_X ) {for (i =0 ; i < sp->config.rx_ring_num; i++)napi_enable (&sp->mac_control.rings[i].napi);
Re: [PATCH 10/43] drivers/net/s2io.c: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:14:31 +0100
Quoted 7 lines
Impact: Remove redundant inner scope variable.
Fix this sparse warning:
drivers/net/s2io.c:7223:21: warning: symbol 'i' shadows an earlier onedrivers/net/s2io.c:7184:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
Re: [PATCH 10/43] drivers/net/s2io.c: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderFrom: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:14:31 +0100
Quoted 7 lines
Impact: Remove redundant inner scope variable.
Fix this sparse warning:
drivers/net/s2io.c:7223:21: warning: symbol 'i' shadows an earlier onedrivers/net/s2io.c:7184:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 11/43 drivers/net/arcnet: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Remove redundant inner scope variable.
Fix this sparse warning:
drivers/net/arcnet/arcnet.c:383:21: warning: symbol 'count' shadows an earlier one drivers/net/arcnet/arcnet.c:375:13: originally declared here
--- drivers/net/arcnet/arcnet.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/arcnet/arcnet.c +0 -1
@@ -380,7 +380,6 @@ int arcnet_open(struct net_device *dev)return -ENODEV ;BUGLVL (D_PROTO ) { -int count;BUGMSG (D_PROTO ,"protocol map (default is '%c'): " , arc_proto_default->suffix);for (count =0 ; count <256 ; count++)
Re: [PATCH 11/43] drivers/net/arcnet: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:14:45 +0100
Quoted 7 lines
Impact: Remove redundant inner scope variable.
Fix this sparse warning:
drivers/net/arcnet/arcnet.c:383:21: warning: symbol 'count' shadows an earlier onedrivers/net/arcnet/arcnet.c:375:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 12/43 drivers/net/atl1e: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/atl1e/atl1e_main.c:716:39: warning: incorrect type in argument 2 (different signedness) drivers/net/atl1e/atl1e_param.c:57:1: warning: incorrect type in initializer (different signedness) drivers/net/atl1e/atl1e_param.c:68:1: warning: incorrect type in initializer (different signedness) drivers/net/atl1e/atl1e_param.c:81:1: warning: incorrect type in initializer (different signedness) drivers/net/atl1e/atl1e_param.c:92:1: warning: incorrect type in initializer (different signedness)
--- drivers/net/atl1e/atl1e.h | 2 +- drivers/net/atl1e/atl1e_param.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/atl1e/atl1e.h +1 -1
@@ -448,7 +448,7 @@ struct atl1e_adapter {/* All Descriptor memory */ dma_addr_t ring_dma;void *ring_vir_addr; -int ring_size; +u32 ring_size;struct atl1e_tx_ring tx_ring;struct atl1e_rx_ring rx_ring;
drivers/net/atl1e/atl1e_param.c +1 -1
@@ -41,7 +41,7 @@#define ATL1E_PARAM (x, desc) \ static int __devinitdata x[ATL1E_MAX_NIC + 1] = ATL1E_PARAM_INIT; \ - static int num_##x; \ + static unsigned int num_##x; \ module_param_array_named(x, x, int, &num_##x, 0); \ MODULE_PARM_DESC(x, desc);
Re: [PATCH 12/43] drivers/net/atl1e: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:14:58 +0100
Quoted 8 lines
Fix this sparse warnings:
drivers/net/atl1e/atl1e_main.c:716:39: warning: incorrect type in argument 2 (different signedness)drivers/net/atl1e/atl1e_param.c:57:1: warning: incorrect type in initializer (different signedness)drivers/net/atl1e/atl1e_param.c:68:1: warning: incorrect type in initializer (different signedness)drivers/net/atl1e/atl1e_param.c:81:1: warning: incorrect type in initializer (different signedness)drivers/net/atl1e/atl1e_param.c:92:1: warning: incorrect type in initializer (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 13/43 drivers/net/atlx: fix sparse warnings: fix signedness
In reply to Hannes EderImpact: While being at it: statics do not need to be initialized with 0.
Fix this sparse warnings:
drivers/net/atlx/atl1.c:109:1: warning: incorrect type in initializer (different signedness) drivers/net/atlx/atl2.c:2870:1: warning: incorrect type in initializer (different signedness) drivers/net/atlx/atl2.c:2880:1: warning: incorrect type in initializer (different signedness) drivers/net/atlx/atl2.c:2894:1: warning: incorrect type in initializer (different signedness) drivers/net/atlx/atl2.c:2904:1: warning: incorrect type in initializer (different signedness) drivers/net/atlx/atl2.c:2913:1: warning: incorrect type in initializer (different signedness)
--- drivers/net/atlx/atl1.c | 2 +- drivers/net/atlx/atl2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/atlx/atl1.c +1 -1
@@ -105,7 +105,7 @@* Default Value: 100 (200us) */ static int __devinitdata int_mod_timer[ATL1_MAX_NIC +1 ] =ATL1_PARAM_INIT ; -static int num_int_mod_timer; +static unsigned int num_int_mod_timer;module_param_array_named (int_mod_timer, int_mod_timer, int, &num_int_mod_timer,0 );MODULE_PARM_DESC (int_mod_timer,"Interrupt moderator timer" );
drivers/net/atlx/atl2.c +1 -1
@@ -2854,7 +2854,7 @@ static void atl2_force_ps(struct atl2_hw *hw)#else #define ATL2_PARAM (X , desc) \ static int __devinitdata X[ATL2_MAX_NIC+1] = ATL2_PARAM_INIT; \ - static int num_##X = 0; \ + static unsigned int num_##X; \ module_param_array_named(X, X, int, &num_##X, 0); \ MODULE_PARM_DESC(X, desc);#endif
Re: [PATCH 13/43] drivers/net/atlx: fix sparse warnings: fix signedness
Quoted 11 lines · On Sat, 14 Feb 2009 22:15:17 +0100 Hannes Eder <[email protected]> wrote:
Impact: While being at it: statics do not need to be initialized with 0.
Fix this sparse warnings:
drivers/net/atlx/atl1.c:109:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2870:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2880:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2894:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2904:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2913:1: warning: incorrect type in initializer (different signedness)Signed-off-by Hannes Eder <[email protected]>
Quoted 36 lines
--- drivers/net/atlx/atl1.c | 2 +- drivers/net/atlx/atl2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/net/atlx/atl1.c +1
-1@@ -105,7 +105,7 @@* Default Value: 100 (200us) */ static int __devinitdata int_mod_timer[ATL1_MAX_NIC +1 ] =ATL1_PARAM_INIT ; -static int num_int_mod_timer; +static unsigned int num_int_mod_timer;module_param_array_named (int_mod_timer, int_mod_timer, int, &num_int_mod_timer,0 );MODULE_PARM_DESC (int_mod_timer,"Interrupt moderator timer" );drivers/net/atlx/atl2.c +1
-2@@ -2854,7 +2854,7 @@ static void atl2_force_ps(struct atl2_hw *hw)#else #define ATL2_PARAM (X , desc) \ static int __devinitdata X[ATL2_MAX_NIC+1] = ATL2_PARAM_INIT; \ - static int num_##X = 0; \ + static unsigned int num_##X; \ module_param_array_named(X, X, int, &num_##X, 0); \ MODULE_PARM_DESC(X, desc);#endif --To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 13/43] drivers/net/atlx: fix sparse warnings: fix signedness
In reply to Hannes EderFrom: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:15:17 +0100
Quoted 11 lines
Impact: While being at it: statics do not need to be initialized with 0.
Fix this sparse warnings:
drivers/net/atlx/atl1.c:109:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2870:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2880:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2894:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2904:1: warning: incorrect type in initializer (different signedness)drivers/net/atlx/atl2.c:2913:1: warning: incorrect type in initializer (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 14/43 drivers/net/bonding: fix sparse warnings: context imbalance
In reply to Hannes EderImpact: Attribute functions with __acquires(...) and/or __releases(...).
Fix this sparse warnings:
drivers/net/bonding/bond_alb.c:1675:9: warning: context imbalance in 'bond_alb_handle_active_change' - unexpected unlock drivers/net/bonding/bond_alb.c:1742:9: warning: context imbalance in 'bond_alb_set_mac_address' - unexpected unlock drivers/net/bonding/bond_main.c:1025:17: warning: context imbalance in 'bond_do_fail_over_mac' - unexpected unlock drivers/net/bonding/bond_main.c:3195:13: warning: context imbalance in 'bond_info_seq_start' - wrong count at exit drivers/net/bonding/bond_main.c:3234:13: warning: context imbalance in 'bond_info_seq_stop' - unexpected unlock
--- drivers/net/bonding/bond_alb.c | 8 ++++++++ drivers/net/bonding/bond_main.c | 8 ++++++++ 2 files changed, 16 insertions(+), 0 deletions(-)
drivers/net/bonding/bond_alb.c +8 -0
@@ -1628,6 +1628,10 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char* no other locks may be held. */ void bond_alb_handle_active_change (struct bonding *bond,struct slave *new_slave) + __releases(&bond->curr_slave_lock) + __releases(&bond->lock) + __acquires(&bond->lock) + __acquires(&bond->curr_slave_lock) {struct slave *swap_slave;int i;
@@ -1704,6 +1708,10 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave* Called with RTNL */ int bond_alb_set_mac_address (struct net_device *bond_dev,void *addr) + __releases(&bond->curr_slave_lock) + __releases(&bond->lock) + __acquires(&bond->lock) + __acquires(&bond->curr_slave_lock) {struct bonding *bond =netdev_priv (bond_dev);struct sockaddr *sa = addr;
drivers/net/bonding/bond_main.c +8 -0
@@ -1002,6 +1002,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, structstatic void bond_do_fail_over_mac (struct bonding *bond,struct slave *new_active,struct slave *old_active) + __releases(&bond->curr_slave_lock) + __releases(&bond->lock) + __acquires(&bond->lock) + __acquires(&bond->curr_slave_lock) {u8 tmp_mac[ETH_ALEN ];struct sockaddr saddr;
@@ -3193,6 +3197,8 @@ out:#ifdef CONFIG_PROC_FS static void *bond_info_seq_start (struct seq_file *seq,loff_t *pos) + __acquires(&dev_base_lock) + __acquires(&bond->lock) {struct bonding *bond = seq->private;loff_t off =0 ;
@@ -3232,6 +3238,8 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) }static void bond_info_seq_stop (struct seq_file *seq,void *v) + __releases(&bond->lock) + __releases(&dev_base_lock) {struct bonding *bond = seq->private;
Re: [PATCH 14/43] drivers/net/bonding: fix sparse warnings: context imbalance
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:15:33 +0100
Quoted 10 lines
Impact: Attribute functions with
__acquires(...)and/or__releases(...).Fix this sparse warnings:
drivers/net/bonding/bond_alb.c:1675:9: warning: context imbalance in 'bond_alb_handle_active_change' - unexpected unlockdrivers/net/bonding/bond_alb.c:1742:9: warning: context imbalance in 'bond_alb_set_mac_address' - unexpected unlockdrivers/net/bonding/bond_main.c:1025:17: warning: context imbalance in 'bond_do_fail_over_mac' - unexpected unlockdrivers/net/bonding/bond_main.c:3195:13: warning: context imbalance in 'bond_info_seq_start' - wrong count at exitdrivers/net/bonding/bond_main.c:3234:13: warning: context imbalance in 'bond_info_seq_stop' - unexpected unlockSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 15/43 drivers/net/bonding: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Rename function scope variable.
Fix this sparse warning:
drivers/net/bonding/bond_main.c:4704:13: warning: symbol 'mode' shadows an earlier one drivers/net/bonding/bond_main.c:95:13: originally declared here
--- drivers/net/bonding/bond_main.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/bonding/bond_main.c +3 -3
@@ -4701,7 +4701,7 @@ static void bond_free_all(void)*/ int bond_parse_parm (const char *buf,const struct bond_parm_tbl *tbl) { -int mode =-1 , i, rv; +int modeint =-1 , i, rv;char *p, modestr[BOND_MAX_MODENAME_LEN +1 ] = {0 , };for (p = (char *)buf; *p; p++)
@@ -4711,13 +4711,13 @@ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)if (*p) rv =sscanf (buf,"%20s" , modestr);else - rv =sscanf (buf,"%d" , &mode); + rv =sscanf (buf,"%d" , &modeint);if (!rv)return -1 ;for (i =0 ; tbl[i].modename; i++) { -if (mode = tbl[i].mode) +if (modeint = tbl[i].mode)return tbl[i].mode;if (strcmp (modestr, tbl[i].modename) =0 )return tbl[i].mode;
Re: [PATCH 15/43] drivers/net/bonding: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:15:49 +0100
Quoted 7 lines
Impact: Rename function scope variable.
Fix this sparse warning:
drivers/net/bonding/bond_main.c:4704:13: warning: symbol 'mode' shadows an earlier onedrivers/net/bonding/bond_main.c:95:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 16/43 drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Move variable declaration as close to usage as possible.
Fix this sparse warning:
drivers/net/cxgb3/cxgb3_main.c:1586:21: warning: symbol 'cap' shadows an earlier one
--- drivers/net/cxgb3/cxgb3_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/cxgb3/cxgb3_main.c +1 -2
@@ -1565,7 +1565,6 @@ static int speed_duplex_to_caps(int speed, int duplex)static int set_settings (struct net_device *dev,struct ethtool_cmd *cmd) { -int cap;struct port_info *p =netdev_priv (dev);struct link_config *lc = &p->link_config;
@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)* being requested. */ if (cmd->autoneg =AUTONEG_DISABLE ) { - cap =speed_duplex_to_caps (cmd->speed, cmd->duplex); +int cap =speed_duplex_to_caps (cmd->speed, cmd->duplex);if (lc->supported & cap)return 0 ; }
Re: [PATCH 16/43] drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
Quoted 24 lines · Hannes Eder
Impact: Move variable declaration as close to usage as possible.
Fix this sparse warning:
drivers/net/cxgb3/cxgb3_main.c:1586:21: warning: symbol 'cap' shadows an earlier oneSigned-off-by Hannes Eder <[email protected]>--- drivers/net/cxgb3/cxgb3_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/net/cxgb3/cxgb3_main.c +0
-1@@ -1565,7 +1565,6 @@ static int speed_duplex_to_caps(int speed, int duplex)static int set_settings (struct net_device *dev,struct ethtool_cmd *cmd) { -int cap;struct port_info *p =netdev_priv (dev);struct link_config *lc = &p->link_config;
drivers/net/cxgb3/cxgb3_main.c static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) · line 1580
Quoted 8 lines
drivers/net/cxgb3/cxgb3_main.c +1
-1@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)* being requested. */ if (cmd->autoneg =AUTONEG_DISABLE ) { - cap =speed_duplex_to_caps (cmd->speed, cmd->duplex); +int cap =speed_duplex_to_caps (cmd->speed, cmd->duplex);if (lc->supported & cap)return 0 ; }
Hello Hannes,
it seems that "cap" can be dropped completely.
if (lc->supported & speed_duplex_to_caps(cmd->speed, cmd->duplex) )
return 0;
re,
wh
Re: [PATCH 16/43] drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
Quoted 37 lines · walter harms
Quoted 24 lines · Hannes Eder
Impact: Move variable declaration as close to usage as possible.
Fix this sparse warning:
drivers/net/cxgb3/cxgb3_main.c:1586:21: warning: symbol 'cap' shadows an earlier oneSigned-off-by Hannes Eder <[email protected]>--- drivers/net/cxgb3/cxgb3_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/net/cxgb3/cxgb3_main.c +0
-1@@ -1565,7 +1565,6 @@ static int speed_duplex_to_caps(int speed, int duplex)static int set_settings (struct net_device *dev,struct ethtool_cmd *cmd) { -int cap;struct port_info *p =netdev_priv (dev);struct link_config *lc = &p->link_config;drivers/net/cxgb3/cxgb3_main.c static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) · line 1580
Quoted 8 lines
drivers/net/cxgb3/cxgb3_main.c +1
-1@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)* being requested. */ if (cmd->autoneg =AUTONEG_DISABLE ) { - cap =speed_duplex_to_caps (cmd->speed, cmd->duplex); +int cap =speed_duplex_to_caps (cmd->speed, cmd->duplex);if (lc->supported & cap)return 0 ; }Hello Hannes,
it seems that "cap" can be dropped completely.
Quoted 2 lines
if (
lc->supported&speed_duplex_to_caps(cmd->speed, cmd->duplex))return 0;
Hi Walter,
You are right, but we would hit the 80 characters per line limit, 90 in this case, and a similar construct is used a few lines below so I suggest to leave it this way.
-Hannes
Re: [PATCH 16/43] drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderQuoted 7 lines · Hannes Eder
Impact: Move variable declaration as close to usage as possible.
Fix this sparse warning:
drivers/net/cxgb3/cxgb3_main.c:1586:21: warning: symbol 'cap' shadows an earlier oneSigned-off-by Hannes Eder <[email protected]>
Re: [PATCH 16/43] drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
From: Divy Le Ray <[email protected]>
Date: Sun, 15 Feb 2009 13:30:34 -0800
Quoted 9 lines
Quoted 7 lines · Hannes Eder
Impact: Move variable declaration as close to usage as possible.
Fix this sparse warning:
drivers/net/cxgb3/cxgb3_main.c:1586:21: warning: symbol 'cap' shadows an earlier oneSigned-off-by Hannes Eder <[email protected]>Acked-by Divy Le Ray <[email protected]>
Applied.
PATCH 17/43 drivers/net/cxgb3: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warning:
drivers/net/cxgb3/ael1002.c:1010:60: warning: incorrect type in argument 4 (different signedness)
--- drivers/net/cxgb3/ael1002.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/cxgb3/ael1002.c +2 -1
@@ -1005,7 +1005,8 @@ static int ael2005_reset(struct cphy *phy, int wait) { 0, 0, 0, 0 } }; -int err, lasi_ctrl; +int err; +unsigned int lasi_ctrl; err =mdio_read (phy,MDIO_DEV_PMA_PMD ,LASI_CTRL , &lasi_ctrl);if (err)
Re: [PATCH 17/43] drivers/net/cxgb3: fix sparse warnings: fix signedness
Quoted 5 lines · Hannes Eder
Fix this sparse warning:
drivers/net/cxgb3/ael1002.c:1010:60: warning: incorrect type in argument 4 (different signedness)Signed-off-by Hannes Eder <[email protected]>
Re: [PATCH 17/43] drivers/net/cxgb3: fix sparse warnings: fix signedness
From: Divy Le Ray <[email protected]>
Date: Sun, 15 Feb 2009 13:32:07 -0800
Quoted 7 lines
Quoted 5 lines · Hannes Eder
Fix this sparse warning:
drivers/net/cxgb3/ael1002.c:1010:60: warning: incorrect type in argument 4 (different signedness)Signed-off-by Hannes Eder <[email protected]>Acked-by Divy Le Ray <[email protected]>
Applied.
PATCH 18/43 drivers/net/e1000e: fix sparse warning: Should it be static?
In reply to Hannes EderImpact: Make symbol static.
Fix this sparse warning:
drivers/net/e1000e/82571.c:1229:5: warning: symbol 'e1000_check_for_serdes_link_82571' was not declared. Should it be static?
--- drivers/net/e1000e/82571.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/e1000e/82571.c +1 -1
@@ -1226,7 +1226,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)* Checks for link up on the hardware. If link is not up and we have * a signal, then we need to force link up. **/ -s32 e1000_check_for_serdes_link_82571 (struct e1000_hw *hw) +static s32 e1000_check_for_serdes_link_82571 (struct e1000_hw *hw) {struct e1000_mac_info *mac = &hw->mac;u32 rxcw;
Re: [PATCH 18/43] drivers/net/e1000e: fix sparse warning: Should it be static?
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:32:25 +0100
Quoted 6 lines
Impact: Make symbol static.
Fix this sparse warning:
drivers/net/e1000e/82571.c:1229:5: warning: symbol 'e1000_check_for_serdes_link_82571' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 19/43 drivers/net/hamradio: fix warning: format not a string literal and no ...
In reply to Hannes EderImpact: Use 'static const char[]' instead of 'static char[]' and while being at it fix an issue in 'mkiss_init_driver', where in case of an error the status code was not passed to printk.
Fix this warnings:
drivers/net/hamradio/6pack.c: In function 'sixpack_init_driver':
drivers/net/hamradio/6pack.c:802: warning: format not a string literal and no format arguments drivers/net/hamradio/bpqether.c: In function 'bpq_init_driver':
drivers/net/hamradio/bpqether.c:609: warning: format not a string literal and no format arguments drivers/net/hamradio/mkiss.c: In function 'mkiss_init_driver':
drivers/net/hamradio/mkiss.c:988: warning: format not a string literal and no format arguments drivers/net/hamradio/mkiss.c:991: warning: format not a string literal and no format arguments drivers/net/hamradio/scc.c: In function 'scc_init_driver':
drivers/net/hamradio/scc.c:2109: warning: format not a string literal and no format arguments drivers/net/hamradio/yam.c: In function 'yam_init_driver':
drivers/net/hamradio/yam.c:1094: warning: format not a string literal and no format arguments
--- drivers/net/hamradio/6pack.c | 4 ++-- drivers/net/hamradio/bpqether.c | 3 ++- drivers/net/hamradio/mkiss.c | 9 +++++---- drivers/net/hamradio/scc.c | 3 ++- drivers/net/hamradio/yam.c | 3 ++- 5 files changed, 13 insertions(+), 9 deletions(-)
drivers/net/hamradio/6pack.c +2 -2
@@ -790,9 +790,9 @@ static struct tty_ldisc_ops sp_ldisc = {/* Initialize 6pack control device -- register 6pack line discipline */ -static char msg_banner[] __initdata = KERN_INFO \ +static const char msg_banner[] __initdata = KERN_INFO \"AX.25: 6pack driver, " SIXPACK_VERSION "\n" ; -static char msg_regfail[] __initdata = KERN_ERR \ +static const char msg_regfail[] __initdata = KERN_ERR \"6pack: can't register line discipline (err = %d)\n" ;static int __init sixpack_init_driver (void )
drivers/net/hamradio/bpqether.c +2 -1
@@ -87,7 +87,8 @@#include <linux/bpqether.h> -static char banner[]__initdata =KERN_INFO "AX.25: bpqether driver version 004\n" ; +static const char banner[] __initdata = KERN_INFO \ +"AX.25: bpqether driver version 004\n" ;static char bcast_addr[6 ]={0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF };
drivers/net/hamradio/mkiss.c +5 -4
@@ -976,9 +976,9 @@ static struct tty_ldisc_ops ax_ldisc = { .write_wakeup = mkiss_write_wakeup }; -static char banner[] __initdata = KERN_INFO \ +static const char banner[] __initdata = KERN_INFO \"mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n" ; -static char msg_regfail[] __initdata = KERN_ERR \ +static const char msg_regfail[] __initdata = KERN_ERR \"mkiss: can't register line discipline (err = %d)\n" ;static int __init mkiss_init_driver (void )
@@ -987,8 +987,9 @@ static int __init mkiss_init_driver(void)printk (banner); -if ((status =tty_register_ldisc (N_AX25 , &ax_ldisc)) !=0 ) -printk (msg_regfail); + status =tty_register_ldisc (N_AX25 , &ax_ldisc); +if (status !=0 ) +printk (msg_regfail, status);return status; }
drivers/net/hamradio/scc.c +2 -1
@@ -184,7 +184,8 @@#include "z8530.h" -static char banner[]__initdata =KERN_INFO "AX.25: Z8530 SCC driver version " VERSION ".dl1bke\n" ; +static const char banner[] __initdata = KERN_INFO \ +"AX.25: Z8530 SCC driver version " VERSION ".dl1bke\n" ;static void t_dwait (unsigned long );static void t_txdelay (unsigned long );
drivers/net/hamradio/yam.c +2 -1
@@ -77,7 +77,8 @@/* --------------------------------------------------------------------- */ static const char yam_drvname[] ="yam" ; -static char yam_drvinfo[]__initdata =KERN_INFO "YAM driver version 0.8 by F1OAT/F6FBB\n" ; +static const char yam_drvinfo[] __initdata = KERN_INFO \ +"YAM driver version 0.8 by F1OAT/F6FBB\n" ;/* --------------------------------------------------------------------- */
Re: [PATCH 19/43] drivers/net/hamradio: fix warning: format not a string literal and no ...
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:33:21 +0100
Quoted 17 lines
Impact: Use 'static const char[]' instead of 'static char[]' and while being at it fix an issue in '
mkiss_init_driver', where in case of an error the status code was not passed to printk.Fix this warnings:
drivers/net/hamradio/6pack.c: In function 'sixpack_init_driver':
drivers/net/hamradio/6pack.c:802: warning: format not a string literal and no format argumentsdrivers/net/hamradio/bpqether.c: In function 'bpq_init_driver':
drivers/net/hamradio/bpqether.c:609: warning: format not a string literal and no format argumentsdrivers/net/hamradio/mkiss.c: In function 'mkiss_init_driver':
drivers/net/hamradio/mkiss.c:988: warning: format not a string literal and no format argumentsdrivers/net/hamradio/mkiss.c:991: warning: format not a string literal and no format argumentsdrivers/net/hamradio/scc.c: In function 'scc_init_driver':
drivers/net/hamradio/scc.c:2109: warning: format not a string literal and no format argumentsdrivers/net/hamradio/yam.c: In function 'yam_init_driver':
drivers/net/hamradio/yam.c:1094: warning: format not a string literal and no format arguments
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 20/43 drivers/net/hamradio: fix sparse warning: context imbalance
In reply to Hannes EderImpact: Attribute functions with __acquires(...) resp. __releases(...).
Fix this sparse warnings:
drivers/net/hamradio/bpqether.c:387:13: warning: context imbalance in 'bpq_seq_start' - wrong count at exit drivers/net/hamradio/bpqether.c:419:13: warning: context imbalance in 'bpq_seq_stop' - unexpected unlock
--- drivers/net/hamradio/bpqether.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/hamradio/bpqether.c +2 -0
@@ -386,6 +386,7 @@ static int bpq_close(struct net_device *dev)* Proc filesystem */ static void *bpq_seq_start (struct seq_file *seq,loff_t *pos) +__acquires (RCU ) {int i =1 ;struct bpqdev *bpqdev;
@@ -418,6 +419,7 @@ static void *bpq_seq_next(struct seq_file *seq, void *v, loff_t *pos) }static void bpq_seq_stop (struct seq_file *seq,void *v) +__releases (RCU ) {rcu_read_unlock (); }
Re: [PATCH 20/43] drivers/net/hamradio: fix sparse warning: context imbalance
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:34:52 +0100
Quoted 7 lines
Impact: Attribute functions with
__acquires(...)resp.__releases(...).Fix this sparse warnings:
drivers/net/hamradio/bpqether.c:387:13: warning: context imbalance in 'bpq_seq_start' - wrong count at exitdrivers/net/hamradio/bpqether.c:419:13: warning: context imbalance in 'bpq_seq_stop' - unexpected unlockSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 21/43 drivers/net/hamradio: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Rename inner scrope variable.
Fix this sparse warning:
drivers/net/hamradio/yam.c:856:35: warning: symbol 'dev' shadows an earlier one
--- drivers/net/hamradio/yam.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/hamradio/yam.c +3 -3
@@ -854,10 +854,10 @@ static int yam_open(struct net_device *dev)/* Reset overruns for all ports - FPGA programming makes overruns */ for (i =0 ; i <NR_PORTS ; i++) { -struct net_device *dev = yam_devs[i]; +struct net_device *yam_dev = yam_devs[i]; -inb (LSR (dev->base_addr)); - dev->stats.rx_fifo_errors =0 ; +inb (LSR (yam_dev->base_addr)); + yam_dev->stats.rx_fifo_errors =0 ; } printk(KERN_INFO "%s at iobase 0x%lx irq %u uart %s\n", dev->name, dev->base_addr, dev->irq,
Re: [PATCH 21/43] drivers/net/hamradio: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:35:35 +0100
Quoted 6 lines
Impact: Rename inner scrope variable.
Fix this sparse warning:
drivers/net/hamradio/yam.c:856:35: warning: symbol 'dev' shadows an earlier oneSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 22/43 drivers/net/hamradio: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/hamradio/hdlcdrv.c:274:34: warning: incorrect type in argument 2 (different signedness) drivers/net/hamradio/hdlcdrv.c:279:47: warning: incorrect type in argument 2 (different signedness) drivers/net/hamradio/hdlcdrv.c:288:39: warning: incorrect type in argument 2 (different signedness) drivers/net/hamradio/hdlcdrv.c:300:47: warning: incorrect type in argument 2 (different signedness)
--- include/linux/hdlcdrv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/hdlcdrv.h +1 -1
@@ -215,7 +215,7 @@ struct hdlcdrv_state {struct hdlcdrv_hdlctx {struct hdlcdrv_hdlcbuffer hbuf; -long in_hdlc_tx; +unsigned long in_hdlc_tx;/* * 0 = send flags * 1 = send txtail (flags)
Re: [PATCH 22/43] drivers/net/hamradio: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:36:20 +0100
Quoted 7 lines
Fix this sparse warnings:
drivers/net/hamradio/hdlcdrv.c:274:34: warning: incorrect type in argument 2 (different signedness)drivers/net/hamradio/hdlcdrv.c:279:47: warning: incorrect type in argument 2 (different signedness)drivers/net/hamradio/hdlcdrv.c:288:39: warning: incorrect type in argument 2 (different signedness)drivers/net/hamradio/hdlcdrv.c:300:47: warning: incorrect type in argument 2 (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 23/43 drivers/net/igb: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Move variable declaration as far inner as possible.
Fix this sparse warning:
drivers/net/igb/igb_main.c:1895:21: warning: symbol 'j' shadows an earlier one drivers/net/igb/igb_main.c:1855:16: originally declared here
--- drivers/net/igb/igb_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/igb/igb_main.c +2 -2
@@ -1852,7 +1852,7 @@ static void igb_configure_rx(struct igb_adapter *adapter)struct e1000_hw *hw = &adapter->hw;u32 rctl, rxcsum;u32 rxdctl; -int i, j; +int i;/* disable receives while setting up the descriptors */ rctl =rd32 (E1000_RCTL );
@@ -1867,7 +1867,7 @@ static void igb_configure_rx(struct igb_adapter *adapter)* the Base and Length of the Rx Descriptor Ring */ for (i =0 ; i < adapter->num_rx_queues; i++) {struct igb_ring *ring = &(adapter->rx_ring[i]); - j = ring->reg_idx; +int j = ring->reg_idx; rdba = ring->dma;wr32 (E1000_RDBAL (j), rdba &0x00000000ffffffffULL );
David Miller
maintainerRe: [PATCH 23/43] drivers/net/igb: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:38:08 +0100
Quoted 7 lines
Impact: Move variable declaration as far inner as possible.
Fix this sparse warning:
drivers/net/igb/igb_main.c:1895:21: warning: symbol 'j' shadows an earlier onedrivers/net/igb/igb_main.c:1855:16: originally declared hereSigned-off-by Hannes Eder <[email protected]>
There have been some changes recently to the igb driver so this patch no longer applies.
PATCH v2 23/43 drivers/net/igb: fix sparse warning: symbol shadows an earlier one
Impact: Move variable declaration as far inner as possible.
Fix this sparse warning:
drivers/net/igb/igb_main.c:1895:21: warning: symbol 'j' shadows an earlier one drivers/net/igb/igb_main.c:1855:16: originally declared here
---
Quoted 2 lines · David Miller
There have been some changes recently to the igb driver so this patch no longer applies.
Conflict resolved, should apply now.
Best, -Hannes
drivers/net/igb/igb_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/igb/igb_main.c +2 -2
@@ -1973,7 +1973,7 @@ static void igb_configure_rx(struct igb_adapter *adapter)struct e1000_hw *hw = &adapter->hw;u32 rctl, rxcsum;u32 rxdctl; -int i, j; +int i;/* disable receives while setting up the descriptors */ rctl =rd32 (E1000_RCTL );
@@ -1988,7 +1988,7 @@ static void igb_configure_rx(struct igb_adapter *adapter)* the Base and Length of the Rx Descriptor Ring */ for (i =0 ; i < adapter->num_rx_queues; i++) {struct igb_ring *ring = &adapter->rx_ring[i]; - j = ring->reg_idx; +int j = ring->reg_idx; rdba = ring->dma;wr32 (E1000_RDBAL (j), rdba &0x00000000ffffffffULL );
Re: [PATCH 23/43 v2] drivers/net/igb: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Wed, 18 Feb 2009 22:49:20 +0100
Quoted 7 lines
Impact: Move variable declaration as far inner as possible.
Fix this sparse warning:
drivers/net/igb/igb_main.c:1895:21: warning: symbol 'j' shadows an earlier onedrivers/net/igb/igb_main.c:1855:16: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied, thanks.
PATCH 24/43 drivers/net/ixgbe: fix sparse warning: Should it be static?
In reply to Hannes EderImpact: Make symbol static.
Fix this sparse warning:
drivers/net/ixgbe/ixgbe_82598.c:59:5: warning: symbol 'ixgbe_get_pcie_msix_count_82598' was not declared. Should it be static?
--- drivers/net/ixgbe/ixgbe_82598.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ixgbe/ixgbe_82598.c +1 -1
@@ -56,7 +56,7 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,* Read PCIe configuration space, and get the MSI-X vector count from * the capabilities table. **/ -u16 ixgbe_get_pcie_msix_count_82598 (struct ixgbe_hw *hw) +static u16 ixgbe_get_pcie_msix_count_82598 (struct ixgbe_hw *hw) {struct ixgbe_adapter *adapter = hw->back;u16 msix_count;
Re: [PATCH 24/43] drivers/net/ixgbe: fix sparse warning: Should it be static?
Quoted 6 lines
Impact: Make symbol static.
Fix this sparse warning:
drivers/net/ixgbe/ixgbe_82598.c:59:5: warning: symbol 'ixgbe_get_pcie_msix_count_82598' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>
Re: [PATCH 24/43] drivers/net/ixgbe: fix sparse warning: Should it be static?
From: "Waskiewicz Jr, Peter P" <[email protected]>
Date: Sun, 15 Feb 2009 22:48:51 -0800 (Pacific Standard Time)
Quoted 8 lines
Quoted 6 lines
Impact: Make symbol static.
Fix this sparse warning:
drivers/net/ixgbe/ixgbe_82598.c:59:5: warning: symbol 'ixgbe_get_pcie_msix_count_82598' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 25/43 drivers/net/pcmcia: fix warning: format not a string literal and no ...
In reply to Hannes EderImpact: Use 'static const char[]' instead of 'static char[]' and while being at it prefix the message with KERN_INFO.
Fix this warnings:
drivers/net/pcmcia/axnet_cs.c:1716: warning: format not a string literal and no format arguments
--- drivers/net/pcmcia/axnet_cs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/pcmcia/axnet_cs.c +0 -1
@@ -861,7 +861,7 @@ module_exit(exit_axnet_cs);*/ -static const char *version_8390 +static const char version_8390[] = KERN_INFO \"8390.c:v1.10cvs 9/23/94 Donald Becker ([email protected])\n" ;#include <linux/bitops.h>
Re: [PATCH 25/43] drivers/net/pcmcia: fix warning: format not a string literal and no ...
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:39:23 +0100
Quoted 7 lines
Impact: Use 'static const char[]' instead of 'static char[]' and while being at it prefix the message with
KERN_INFO.Fix this warnings:
drivers/net/pcmcia/axnet_cs.c:1716: warning: format not a string literal and no format argumentsSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 26/43 drivers/net/sfc: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Move variable declaration as close to their usage as possible.
Fix this sparse warning:
drivers/net/sfc/tenxpress.c:589:22: warning: symbol 'link_ok' shadows an earlier one drivers/net/sfc/tenxpress.c:575:30: originally declared here
--- drivers/net/sfc/tenxpress.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/sfc/tenxpress.c +3 -4
@@ -572,15 +572,14 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)static void tenxpress_phy_poll (struct efx_nic *efx) {struct tenxpress_phy_data *phy_data = efx->phy_data; -bool change = false, link_ok; -unsigned link_fc; +bool change = false;if (efx->phy_type =PHY_TYPE_SFX7101 ) { - link_ok =sfx7101_link_ok (efx); +bool link_ok =sfx7101_link_ok (efx);if (link_ok != efx->link_up) { change = true; }else { - link_fc =mdio_clause45_get_pause (efx); +unsigned int link_fc =mdio_clause45_get_pause (efx);if (link_fc != efx->link_fc) change = true; }
Re: [PATCH 26/43] drivers/net/sfc: fix sparse warning: symbol shadows an earlier one
Quoted 7 lines · Hannes Eder
Impact: Move variable declaration as close to their usage as possible.
Fix this sparse warning:
drivers/net/sfc/tenxpress.c:589:22: warning: symbol 'link_ok' shadows an earlier onedrivers/net/sfc/tenxpress.c:575:30: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Quoted 32 lines
--- drivers/net/sfc/tenxpress.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)drivers/net/sfc/tenxpress.c +3
-5@@ -572,15 +572,14 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)static void tenxpress_phy_poll (struct efx_nic *efx) {struct tenxpress_phy_data *phy_data = efx->phy_data; -bool change = false, link_ok; -unsigned link_fc; +bool change = false;if (efx->phy_type =PHY_TYPE_SFX7101 ) { - link_ok =sfx7101_link_ok (efx); +bool link_ok =sfx7101_link_ok (efx);if (link_ok != efx->link_up) { change = true; }else { - link_fc =mdio_clause45_get_pause (efx); +unsigned int link_fc =mdio_clause45_get_pause (efx);if (link_fc != efx->link_fc) change = true; } --To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH 26/43] drivers/net/sfc: fix sparse warning: symbol shadows an earlier one
From: Ben Hutchings <[email protected]>
Date: Mon, 16 Feb 2009 00:38:20 +0000
Quoted 9 lines
Quoted 7 lines · Hannes Eder
Impact: Move variable declaration as close to their usage as possible.
Fix this sparse warning:
drivers/net/sfc/tenxpress.c:589:22: warning: symbol 'link_ok' shadows an earlier onedrivers/net/sfc/tenxpress.c:575:30: originally declared hereSigned-off-by Hannes Eder <[email protected]>Acked-by Ben Hutchings <[email protected]>
Applied.
PATCH 27/43 drivers/net/sfc: fix sparse warnings: Should it be static?
In reply to Hannes EderImpact: Include header file and include the function under the same condition as in the header file. If CONFIG_SFS_MTD is not defined than the functions 'efx_mtd_remove' and 'efx_mtd_rename' are defined 'static inline' with an empty function body in the header file.
Fix this sparse warnings:
drivers/net/sfc/mtd.c:204:6: warning: symbol 'efx_mtd_remove' was not declared. Should it be static? drivers/net/sfc/mtd.c:221:6: warning: symbol 'efx_mtd_rename' was not declared. Should it be static? drivers/net/sfc/mtd.c:230:5: warning: symbol 'efx_mtd_probe' was not declared. Should it be static?
--- drivers/net/sfc/mtd.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/sfc/mtd.c +3 -0
@@ -15,6 +15,7 @@#define EFX_DRIVER_NAME "sfc_mtd"#include "net_driver.h" #include "spi.h" +#include "efx.h" #define EFX_SPI_VERIFY_BUF_LEN 16
@@ -201,6 +202,7 @@ static void efx_mtd_sync(struct mtd_info *mtd)return ; } +#ifdef CONFIG_SFC_MTD void efx_mtd_remove (struct efx_nic *efx) {if (efx->spi_flash && efx->spi_flash->mtd) {
@@ -266,3 +268,4 @@ int efx_mtd_probe(struct efx_nic *efx) return 0; } +#endif /* CONFIG_SFC_MTD */
Re: [PATCH 27/43] drivers/net/sfc: fix sparse warnings: Should it be static?
Quoted 20 lines · Hannes Eder
Impact: Include header file and include the function under the same condition as in the header file. If
CONFIG_SFS_MTDis not defined than the functions 'efx_mtd_remove' and 'efx_mtd_rename' are defined 'static inline' with an empty function body in the header file.Fix this sparse warnings:
drivers/net/sfc/mtd.c:204:6: warning: symbol 'efx_mtd_remove' was not declared. Should it be static?drivers/net/sfc/mtd.c:221:6: warning: symbol 'efx_mtd_rename' was not declared. Should it be static?drivers/net/sfc/mtd.c:230:5: warning: symbol 'efx_mtd_probe' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>--- drivers/net/sfc/mtd.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)drivers/net/sfc/mtd.c +0
-0
drivers/net/sfc/mtd.c line 21
Quoted 7 lines
drivers/net/sfc/mtd.c +1
-0@@ -15,6 +15,7 @@#define EFX_DRIVER_NAME "sfc_mtd"#include "net_driver.h" #include "spi.h" +#include "efx.h" #define EFX_SPI_VERIFY_BUF_LEN 16
OK, but...
drivers/net/sfc/mtd.c int efx_mtd_probe(struct efx_nic *efx) · line 271
Quoted 13 lines
drivers/net/sfc/mtd.c +2
-0@@ -201,6 +202,7 @@ static void efx_mtd_sync(struct mtd_info *mtd)return ; } +#ifdef CONFIG_SFC_MTD void efx_mtd_remove (struct efx_nic *efx) {if (efx->spi_flash && efx->spi_flash->mtd) {@@ -266,3 +268,4 @@ int efx_mtd_probe(struct efx_nic *efx) return 0; } +#endif /* CONFIG_SFC_MTD */
This is wrong. The entire file is conditional on CONFIG_SFC_MTD.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH 27/43] drivers/net/sfc: fix sparse warnings: Should it be static?
Quoted 41 lines · Ben Hutchings
Quoted 20 lines · Hannes Eder
Impact: Include header file and include the function under the same condition as in the header file. If
CONFIG_SFS_MTDis not defined than the functions 'efx_mtd_remove' and 'efx_mtd_rename' are defined 'static inline' with an empty function body in the header file.Fix this sparse warnings:
drivers/net/sfc/mtd.c:204:6: warning: symbol 'efx_mtd_remove' was not declared. Should it be static?drivers/net/sfc/mtd.c:221:6: warning: symbol 'efx_mtd_rename' was not declared. Should it be static?drivers/net/sfc/mtd.c:230:5: warning: symbol 'efx_mtd_probe' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>--- drivers/net/sfc/mtd.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)drivers/net/sfc/mtd.c +0
-0drivers/net/sfc/mtd.c line 21
Quoted 7 lines
drivers/net/sfc/mtd.c +1
-0@@ -15,6 +15,7 @@#define EFX_DRIVER_NAME "sfc_mtd"#include "net_driver.h" #include "spi.h" +#include "efx.h" #define EFX_SPI_VERIFY_BUF_LEN 16OK, but...
Quoted 10 lines
drivers/net/sfc/mtd.c +1
-0@@ -201,6 +202,7 @@ static void efx_mtd_sync(struct mtd_info *mtd)return ; } +#ifdef CONFIG_SFC_MTD void efx_mtd_remove (struct efx_nic *efx) {if (efx->spi_flash && efx->spi_flash->mtd) {@@ -266,3 +268,4 @@ int efx_mtd_probe(struct efx_nic *efx)
Quoted 5 lines
drivers/net/sfc/mtd.c int efx_mtd_probe(struct efx_nic *efx) · line 271
Quoted 3 lines
drivers/net/sfc/mtd.c +1
-0return 0; } +#endif /* CONFIG_SFC_MTD */ This is wrong. The entire file is conditional on
CONFIG_SFC_MTD.
Even better than. It's actually not wrong, just done twice, so we can omit it, thank you Ben. I'll send an update.
Hannes
PATCH 1/1 drivers/net/sfc: fix sparse warnings: Should it be static?
Impact: Include the header file. If CONFIG_SFC_MTD is not defined then the functions 'efx_mtd_remove' and 'efx_mtd_rename' are defined 'static inline' with an empty function body in the header file, but the the whole file mtd.c is not built in this case.
Fix this sparse warnings:
drivers/net/sfc/mtd.c:204:6: warning: symbol 'efx_mtd_remove' was not declared. Should it be static? drivers/net/sfc/mtd.c:221:6: warning: symbol 'efx_mtd_rename' was not declared. Should it be static? drivers/net/sfc/mtd.c:230:5: warning: symbol 'efx_mtd_probe' was not declared. Should it be static?
--- drivers/net/sfc/mtd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/sfc/mtd.c +1 -0
@@ -15,6 +15,7 @@#define EFX_DRIVER_NAME "sfc_mtd"#include "net_driver.h" #include "spi.h" +#include "efx.h" #define EFX_SPI_VERIFY_BUF_LEN 16
Re: [PATCH] drivers/net/sfc: fix sparse warnings: Should it be static?
From: Hannes Eder <[email protected]>
Date: Mon, 16 Feb 2009 10:54:38 +0100
Quoted 11 lines
Impact: Include the header file. If
CONFIG_SFC_MTDis not defined then the functions 'efx_mtd_remove' and 'efx_mtd_rename' are defined 'static inline' with an empty function body in the header file, but the the whole filemtd.cis not built in this case.Fix this sparse warnings:
drivers/net/sfc/mtd.c:204:6: warning: symbol 'efx_mtd_remove' was not declared. Should it be static?drivers/net/sfc/mtd.c:221:6: warning: symbol 'efx_mtd_rename' was not declared. Should it be static?drivers/net/sfc/mtd.c:230:5: warning: symbol 'efx_mtd_probe' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>
Applied to net-next-2.6, thanks.
David Miller
maintainerRe: [PATCH 27/43] drivers/net/sfc: fix sparse warnings: Should it be static?
In reply to Hannes EderFrom: Hannes Eder <[email protected]>
Date: Mon, 16 Feb 2009 10:38:26 +0100
Quoted 6 lines
Quoted 1 line · Ben Hutchings
This is wrong. The entire file is conditional on
CONFIG_SFC_MTD.Even better than. It's actually not wrong, just done twice, so we can omit it, thank you Ben. I'll send an update.
Ok, I'll skip over this patch.
PATCH 28/43 drivers/net/skfp: fix sparse warning: Should it be static?
In reply to Hannes EderImpact: Move function declarations to header file.
Fix this sparse warnings:
drivers/net/skfp/cfm.c:146:6: warning: symbol 'all_selection_criteria' was not declared. Should it be static? drivers/net/skfp/drvfbi.c:186:6: warning: symbol 'mac1_irq' was not declared. Should it be static? drivers/net/skfp/drvfbi.c:284:6: warning: symbol 'read_address' was not declared. Should it be static? drivers/net/skfp/drvfbi.c:323:6: warning: symbol 'init_board' was not declared. Should it be static? drivers/net/skfp/fplustm.c:72:24: warning: symbol 'fddi_broadcast' was not declared. Should it be static? drivers/net/skfp/fplustm.c:679:6: warning: symbol 'mac2_irq' was not declared. Should it be static? drivers/net/skfp/fplustm.c:805:6: warning: symbol 'mac3_irq' was not declared. Should it be static? drivers/net/skfp/fplustm.c:856:5: warning: symbol 'init_fplus' was not declared. Should it be static? drivers/net/skfp/pcmplc.c:404:6: warning: symbol 'init_plc' was not declared. Should it be static? drivers/net/skfp/pcmplc.c:1592:5: warning: symbol 'pcm_status_twisted' was not declared. Should it be static? drivers/net/skfp/smtinit.c:68:5: warning: symbol 'init_smt' was not declared. Should it be static?
--- drivers/net/skfp/h/smc.h | 17 +++++++++++++++++ drivers/net/skfp/hwmtm.c | 9 --------- drivers/net/skfp/pcmplc.c | 3 --- drivers/net/skfp/skfddi.c | 3 --- drivers/net/skfp/smt.c | 10 ---------- 5 files changed, 17 insertions(+), 25 deletions(-)
drivers/net/skfp/h/smc.h +17 -0
@@ -467,5 +467,22 @@ struct s_smc {#endif /* DEBUG_BRD && DEBUG */ } ; +extern const struct fddi_addr fddi_broadcast; + +extern void all_selection_criteria (struct s_smc *smc); +extern void card_stop (struct s_smc *smc); +extern void init_board (struct s_smc *smc,u_char *mac_addr); +extern int init_fplus (struct s_smc *smc); +extern void init_plc (struct s_smc *smc); +extern int init_smt (struct s_smc *smc,u_char * mac_addr); +extern void mac1_irq (struct s_smc *smc,u_short stu,u_short stl); +extern void mac2_irq (struct s_smc *smc,u_short code_s2u,u_short code_s2l); +extern void mac3_irq (struct s_smc *smc,u_short code_s3u,u_short code_s3l); +extern int pcm_status_twisted (struct s_smc *smc); +extern void plc1_irq (struct s_smc *smc); +extern void plc2_irq (struct s_smc *smc); +extern void read_address (struct s_smc *smc,u_char * mac_addr); +extern void timer_irq (struct s_smc *smc); +#endif /* _SCMECM_ */
drivers/net/skfp/hwmtm.c +0 -9
@@ -97,23 +97,15 @@ static void mac_drv_clear_txd(struct s_smc *smc);extern void *mac_drv_get_space (struct s_smc *smc,unsigned int size);extern void *mac_drv_get_desc_mem (struct s_smc *smc,unsigned int size); -extern void init_board (struct s_smc *smc,u_char *mac_addr);extern void mac_drv_fill_rxd (struct s_smc *smc); -extern void plc1_irq (struct s_smc *smc);extern void mac_drv_tx_complete (struct s_smc *smc,volatile struct s_smt_fp_txd *txd); -extern void plc2_irq (struct s_smc *smc); -extern void mac1_irq (struct s_smc *smc,u_short stu,u_short stl); -extern void mac2_irq (struct s_smc *smc,u_short code_s2u,u_short code_s2l); -extern void mac3_irq (struct s_smc *smc,u_short code_s3u,u_short code_s3l); -extern void timer_irq (struct s_smc *smc);extern void mac_drv_rx_complete (struct s_smc *smc,volatile struct s_smt_fp_rxd *rxd,int frag_count,int len);extern void mac_drv_requeue_rxd (struct s_smc *smc,volatile struct s_smt_fp_rxd *rxd,int frag_count); -extern void init_plc (struct s_smc *smc);extern void mac_drv_clear_rxd (struct s_smc *smc,volatile struct s_smt_fp_rxd *rxd,int frag_count);
@@ -136,7 +128,6 @@ extern void dma_complete(struct s_smc *smc, volatile union s_fp_descr *descr, int flag);#endif -extern int init_fplus (struct s_smc *smc);extern int mac_drv_rx_init (struct s_smc *smc,int len,int fc,char *look_ahead,int la_len);
drivers/net/skfp/pcmplc.c +0 -3
@@ -198,9 +198,6 @@ static int plc_imsk_na = PL_PCM_CODE | PL_TRACE_PROP | PL_PCM_BREAK |static const int plc_imsk_act =PL_PCM_CODE |PL_TRACE_PROP |PL_PCM_BREAK |PL_PCM_ENABLED |PL_SELF_TEST |PL_EBUF_ERR ; -/* external functions */ -void all_selection_criteria (struct s_smc *smc); -/* internal functions */ static void pcm_fsm (struct s_smc *smc,struct s_phy *phy,int cmd);static void pc_rcode_actions (struct s_smc *smc,int bit,struct s_phy *phy);
drivers/net/skfp/skfddi.c +0 -3
@@ -135,14 +135,11 @@ void dump_data(unsigned char *Data, int length);// External functions from the hardware module extern u_int mac_drv_check_space (void ); -extern void read_address (struct s_smc *smc,u_char * mac_addr); -extern void card_stop (struct s_smc *smc);extern int mac_drv_init (struct s_smc *smc); extern void hwm_tx_frag(struct s_smc *smc, char far * virt, u_long phys,int len,int frame_status);extern int hwm_tx_init (struct s_smc *smc,u_char fc,int frag_count,int frame_len,int frame_status); -extern int init_smt (struct s_smc *smc,u_char * mac_addr);extern void fddi_isr (struct s_smc *smc); extern void hwm_rx_frag(struct s_smc *smc, char far * virt, u_long phys,int len,int frame_status);
drivers/net/skfp/smt.c +0 -10
@@ -55,16 +55,6 @@ static const struct fddi_addr SMT_Unknown = { } ;/* -* external variables -*/ -extern const struct fddi_addr fddi_broadcast ; - -/* -* external functions -*/ -int pcm_status_twisted (struct s_smc *smc); - -/* * function prototypes */ #ifdef LITTLE_ENDIAN
Re: [PATCH 28/43] drivers/net/skfp: fix sparse warning: Should it be static?
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:43:15 +0100
Quoted 15 lines
Impact: Move function declarations to header file.
Fix this sparse warnings:
drivers/net/skfp/cfm.c:146:6: warning: symbol 'all_selection_criteria' was not declared. Should it be static?drivers/net/skfp/drvfbi.c:186:6: warning: symbol 'mac1_irq' was not declared. Should it be static?drivers/net/skfp/drvfbi.c:284:6: warning: symbol 'read_address' was not declared. Should it be static?drivers/net/skfp/drvfbi.c:323:6: warning: symbol 'init_board' was not declared. Should it be static?drivers/net/skfp/fplustm.c:72:24: warning: symbol 'fddi_broadcast' was not declared. Should it be static?drivers/net/skfp/fplustm.c:679:6: warning: symbol 'mac2_irq' was not declared. Should it be static?drivers/net/skfp/fplustm.c:805:6: warning: symbol 'mac3_irq' was not declared. Should it be static?drivers/net/skfp/fplustm.c:856:5: warning: symbol 'init_fplus' was not declared. Should it be static?drivers/net/skfp/pcmplc.c:404:6: warning: symbol 'init_plc' was not declared. Should it be static?drivers/net/skfp/pcmplc.c:1592:5: warning: symbol 'pcm_status_twisted' was not declared. Should it be static?drivers/net/skfp/smtinit.c:68:5: warning: symbol 'init_smt' was not declared. Should it be static?
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 29/43 drivers/net/tokenring: fix warning: format not a string literal and no ...
In reply to Hannes EderImpact: Use 'static const char[]' instead of 'static char[]'.
Fix this warnings:
drivers/net/tokenring/smctr.c:3644: warning: format not a string literal and no format arguments
--- drivers/net/tokenring/smctr.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/tokenring/smctr.c +1 -1
@@ -61,7 +61,8 @@#include "smctr.h" /* Our Stuff */ -static char version[]__initdata =KERN_INFO "smctr.c: v1.4 7/12/00 by [email protected]\n" ; +static const char version[] __initdata + KERN_INFO "smctr.c: v1.4 7/12/00 by [email protected]\n";static const char cardname[] ="smctr" ;
Re: [PATCH 29/43] drivers/net/tokenring: fix warning: format not a string literal and no ...
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:44:19 +0100
Quoted 6 lines
Impact: Use 'static const char[]' instead of 'static char[]'.
Fix this warnings:
drivers/net/tokenring/smctr.c:3644: warning: format not a string literal and no format argumentsSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 30/43 drivers/net/tokenring: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Remove redundant variables.
Fix this sparse warnings:
drivers/net/tokenring/lanstreamer.c:619:21: warning: symbol 'i' shadows an earlier one drivers/net/tokenring/lanstreamer.c:589:13: originally declared here drivers/net/tokenring/madgemc.c:695:34: warning: symbol 'tp' shadows an earlier one drivers/net/tokenring/madgemc.c:689:26: originally declared here drivers/net/tokenring/olympic.c:702:21: warning: symbol 'i' shadows an earlier one drivers/net/tokenring/olympic.c:440:13: originally declared here
--- drivers/net/tokenring/lanstreamer.c | 2 -- drivers/net/tokenring/madgemc.c | 2 -- drivers/net/tokenring/olympic.c | 1 - 3 files changed, 0 insertions(+), 5 deletions(-)
drivers/net/tokenring/lanstreamer.c +0 -2
@@ -616,8 +616,6 @@ static int streamer_open(struct net_device *dev)printk ("SISR Mask = %04x\n" ,readw (streamer_mmio +SISR_MASK ));#endif do { - int i; - for (i = 0; i < SRB_COMMAND_SIZE; i += 2) { writew(0, streamer_mmio + LAPDINC); }
drivers/net/tokenring/madgemc.c +0 -2
@@ -692,8 +692,6 @@ static int madgemc_mcaproc(char *buf, int slot, void *d) len +=sprintf (buf+len,"-------\n" );if (curcard) { -struct net_local *tp =netdev_priv (dev); - len +=sprintf (buf+len,"Card Revision: %d\n" , curcard->cardrev); len +=sprintf (buf+len,"RAM Size: %dkb\n" , curcard->ramsize); len +=sprintf (buf+len,"Cable type: %s\n" , (curcard->cabletype)?"STP/DB9" :"UTP/RJ-45" );
drivers/net/tokenring/olympic.c +0 -1
@@ -699,7 +699,6 @@ static int olympic_open(struct net_device *dev)if (olympic_priv->olympic_network_monitor) {u8 __iomem *oat;u8 __iomem *opt; -int i;u8 addr[6 ]; oat = (olympic_priv->olympic_lap + olympic_priv->olympic_addr_table_addr); opt = (olympic_priv->olympic_lap + olympic_priv->olympic_parms_addr);
Re: [PATCH 30/43] drivers/net/tokenring: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:44:44 +0100
Quoted 11 lines
Impact: Remove redundant variables.
Fix this sparse warnings:
drivers/net/tokenring/lanstreamer.c:619:21: warning: symbol 'i' shadows an earlier onedrivers/net/tokenring/lanstreamer.c:589:13: originally declared heredrivers/net/tokenring/madgemc.c:695:34: warning: symbol 'tp' shadows an earlier onedrivers/net/tokenring/madgemc.c:689:26: originally declared heredrivers/net/tokenring/olympic.c:702:21: warning: symbol 'i' shadows an earlier onedrivers/net/tokenring/olympic.c:440:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 31/43 drivers/net/tokenring: fix sparse warning: cast truncates bits from const value
In reply to Hannes EderImpact: Use '__u16' instead of '__u8', this possibly fixes a bug.
Fix this sparse warnings:
drivers/net/tokenring/smctr.c:4410:52: warning: cast truncates bits from constant value (100 becomes 0) drivers/net/tokenring/smctr.c:4415:52: warning: cast truncates bits from constant value (400 becomes 0) drivers/net/tokenring/smctr.c:4420:52: warning: cast truncates bits from constant value (800 becomes 0) drivers/net/tokenring/smctr.c:4425:52: warning: cast truncates bits from constant value (1000 becomes 0) drivers/net/tokenring/smctr.c:4430:52: warning: cast truncates bits from constant value (2000 becomes 0) drivers/net/tokenring/smctr.c:4435:52: warning: cast truncates bits from constant value (4000 becomes 0) drivers/net/tokenring/smctr.c:4440:52: warning: cast truncates bits from constant value (8000 becomes 0)
---
Should the members be rearranged to avoid un-aligned access?
drivers/net/tokenring/smctr.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/tokenring/smctr.h +1 -1
@@ -977,7 +977,7 @@ typedef struct net_local {__u8 monitor_state_ready;__u16 ring_status;__u8 ring_status_flags; -__u8 current_ring_status; +__u16 current_ring_status;__u8 state;__u8 join_state;
Re: [PATCH 31/43] drivers/net/tokenring: fix sparse warning: cast truncates bits from const value
Quoted 10 lines · Hannes Eder
Impact: Use '
__u16' instead of '__u8', this possibly fixes a bug.Fix this sparse warnings:
drivers/net/tokenring/smctr.c:4410:52: warning: cast truncates bits from constant value (100 becomes 0)drivers/net/tokenring/smctr.c:4415:52: warning: cast truncates bits from constant value (400 becomes 0)drivers/net/tokenring/smctr.c:4420:52: warning: cast truncates bits from constant value (800 becomes 0)drivers/net/tokenring/smctr.c:4425:52: warning: cast truncates bits from constant value (1000 becomes 0)drivers/net/tokenring/smctr.c:4430:52: warning: cast truncates bits from constant value (2000 becomes 0)drivers/net/tokenring/smctr.c:4435:52: warning: cast truncates bits from constant value (4000 becomes 0)drivers/net/tokenring/smctr.c:4440:52: warning: cast truncates bits from constant value (8000 becomes 0)
Um, no. Here's a better question: does *anything* use ->current_ring_status at all? Answer: no. Next question: did anything use it in the past? git log -p drivers/net/tokenging/smctr.c in historical trees shows that it had always been defined that way and that it had never been used at all.
So how about removing the damn field completely? Or asking the driver's author what the hell had it been about?
Re: [PATCH 31/43] drivers/net/tokenring: fix sparse warning: cast truncates bits from const value
Quoted 12 lines · Al Viro
Quoted 10 lines · Hannes Eder
Impact: Use '
__u16' instead of '__u8', this possibly fixes a bug.Fix this sparse warnings:
drivers/net/tokenring/smctr.c:4410:52: warning: cast truncates bits from constant value (100 becomes 0)drivers/net/tokenring/smctr.c:4415:52: warning: cast truncates bits from constant value (400 becomes 0)drivers/net/tokenring/smctr.c:4420:52: warning: cast truncates bits from constant value (800 becomes 0)drivers/net/tokenring/smctr.c:4425:52: warning: cast truncates bits from constant value (1000 becomes 0)drivers/net/tokenring/smctr.c:4430:52: warning: cast truncates bits from constant value (2000 becomes 0)drivers/net/tokenring/smctr.c:4435:52: warning: cast truncates bits from constant value (4000 becomes 0)drivers/net/tokenring/smctr.c:4440:52: warning: cast truncates bits from constant value (8000 becomes 0)
Quoted 9 lines
Um, no. Here's a better question: does *anything* use ->current_ring_status at all? Answer: no. Next question: did anything use it in the past? git log -p
drivers/net/tokenging/smctr.cin historical trees shows that it had always been defined that way and that it had never been used at all.So how about removing the damn field completely? Or asking the driver's author what the hell had it been about?
I vote for removing the field, I prepare a patch for this.
Comments?
-Hannes
PATCH v2 31/43 drivers/net/tokenring: fix sparse warning: cast truncates bits from const value
Impact: Remove the write-only field 'current_ring_status' completely.
Fix this sparse warnings:
drivers/net/tokenring/smctr.c:4410:52: warning: cast truncates bits from constant value (100 becomes 0) drivers/net/tokenring/smctr.c:4415:52: warning: cast truncates bits from constant value (400 becomes 0) drivers/net/tokenring/smctr.c:4420:52: warning: cast truncates bits from constant value (800 becomes 0) drivers/net/tokenring/smctr.c:4425:52: warning: cast truncates bits from constant value (1000 becomes 0) drivers/net/tokenring/smctr.c:4430:52: warning: cast truncates bits from constant value (2000 becomes 0) drivers/net/tokenring/smctr.c:4435:52: warning: cast truncates bits from constant value (4000 becomes 0) drivers/net/tokenring/smctr.c:4440:52: warning: cast truncates bits from constant value (8000 becomes 0)
--- drivers/net/tokenring/smctr.c | 10 ---------- drivers/net/tokenring/smctr.h | 1 - 2 files changed, 0 insertions(+), 11 deletions(-)
drivers/net/tokenring/smctr.c +0 -10
@@ -4393,52 +4393,42 @@ static int smctr_ring_status_chg(struct net_device *dev) {case RING_RECOVERY :printk (KERN_INFO "%s: Ring Recovery\n" , dev->name); - tp->current_ring_status |=RING_RECOVERY ;break ;case SINGLE_STATION :printk (KERN_INFO "%s: Single Statinon\n" , dev->name); - tp->current_ring_status |=SINGLE_STATION ;break ;case COUNTER_OVERFLOW :printk (KERN_INFO "%s: Counter Overflow\n" , dev->name); - tp->current_ring_status |=COUNTER_OVERFLOW ;break ;case REMOVE_RECEIVED :printk (KERN_INFO "%s: Remove Received\n" , dev->name); - tp->current_ring_status |=REMOVE_RECEIVED ;break ;case AUTO_REMOVAL_ERROR :printk (KERN_INFO "%s: Auto Remove Error\n" , dev->name); - tp->current_ring_status |=AUTO_REMOVAL_ERROR ;break ;case LOBE_WIRE_FAULT :printk (KERN_INFO "%s: Lobe Wire Fault\n" , dev->name); - tp->current_ring_status |=LOBE_WIRE_FAULT ;break ;case TRANSMIT_BEACON :printk (KERN_INFO "%s: Transmit Beacon\n" , dev->name); - tp->current_ring_status |=TRANSMIT_BEACON ;break ;case SOFT_ERROR :printk (KERN_INFO "%s: Soft Error\n" , dev->name); - tp->current_ring_status |=SOFT_ERROR ;break ;case HARD_ERROR :printk (KERN_INFO "%s: Hard Error\n" , dev->name); - tp->current_ring_status |=HARD_ERROR ;break ;case SIGNAL_LOSS :printk (KERN_INFO "%s: Signal Loss\n" , dev->name); - tp->current_ring_status |=SIGNAL_LOSS ;break ;default :
drivers/net/tokenring/smctr.h +0 -1
@@ -977,7 +977,6 @@ typedef struct net_local {__u8 monitor_state_ready;__u16 ring_status;__u8 ring_status_flags; -__u8 current_ring_status;__u8 state;__u8 join_state;
Re: [PATCH 31/43 v2] drivers/net/tokenring: fix sparse warning: cast truncates bits from const value
Quoted 81 lines · Hannes Eder
Impact: Remove the write-only field '
current_ring_status' completely.Fix this sparse warnings:
drivers/net/tokenring/smctr.c:4410:52: warning: cast truncates bits from constant value (100 becomes 0)drivers/net/tokenring/smctr.c:4415:52: warning: cast truncates bits from constant value (400 becomes 0)drivers/net/tokenring/smctr.c:4420:52: warning: cast truncates bits from constant value (800 becomes 0)drivers/net/tokenring/smctr.c:4425:52: warning: cast truncates bits from constant value (1000 becomes 0)drivers/net/tokenring/smctr.c:4430:52: warning: cast truncates bits from constant value (2000 becomes 0)drivers/net/tokenring/smctr.c:4435:52: warning: cast truncates bits from constant value (4000 becomes 0)drivers/net/tokenring/smctr.c:4440:52: warning: cast truncates bits from constant value (8000 becomes 0)Signed-off-by Hannes Eder <[email protected]>--- drivers/net/tokenring/smctr.c | 10 ---------- drivers/net/tokenring/smctr.h | 1 - 2 files changed, 0 insertions(+), 11 deletions(-)drivers/net/tokenring/smctr.c +0
-10@@ -4393,52 +4393,42 @@ static int smctr_ring_status_chg(struct net_device *dev) {case RING_RECOVERY :printk (KERN_INFO "%s: Ring Recovery\n" , dev->name); - tp->current_ring_status |=RING_RECOVERY ;break ;case SINGLE_STATION :printk (KERN_INFO "%s: Single Statinon\n" , dev->name); - tp->current_ring_status |=SINGLE_STATION ;break ;case COUNTER_OVERFLOW :printk (KERN_INFO "%s: Counter Overflow\n" , dev->name); - tp->current_ring_status |=COUNTER_OVERFLOW ;break ;case REMOVE_RECEIVED :printk (KERN_INFO "%s: Remove Received\n" , dev->name); - tp->current_ring_status |=REMOVE_RECEIVED ;break ;case AUTO_REMOVAL_ERROR :printk (KERN_INFO "%s: Auto Remove Error\n" , dev->name); - tp->current_ring_status |=AUTO_REMOVAL_ERROR ;break ;case LOBE_WIRE_FAULT :printk (KERN_INFO "%s: Lobe Wire Fault\n" , dev->name); - tp->current_ring_status |=LOBE_WIRE_FAULT ;break ;case TRANSMIT_BEACON :printk (KERN_INFO "%s: Transmit Beacon\n" , dev->name); - tp->current_ring_status |=TRANSMIT_BEACON ;break ;case SOFT_ERROR :printk (KERN_INFO "%s: Soft Error\n" , dev->name); - tp->current_ring_status |=SOFT_ERROR ;break ;case HARD_ERROR :printk (KERN_INFO "%s: Hard Error\n" , dev->name); - tp->current_ring_status |=HARD_ERROR ;break ;case SIGNAL_LOSS :printk (KERN_INFO "%s: Signal Loss\n" , dev->name); - tp->current_ring_status |=SIGNAL_LOSS ;break ;default :drivers/net/tokenring/smctr.h +0
-0
drivers/net/tokenring/smctr.h typedef struct net_local { · line 982
Quoted 7 lines
drivers/net/tokenring/smctr.h +0
-1@@ -977,7 +977,6 @@ typedef struct net_local {__u8 monitor_state_ready;__u16 ring_status;__u8 ring_status_flags; -__u8 current_ring_status;__u8 state;__u8 join_state;
forwarding a mail from Jay Schulist:
Quoted 6 lines · Jay Schulist
Hello,
I'm at this email these days. That field was likely a hold-over from the original port of their windows driver to Linux, it has never been used that I know of. Removing it looks like a fine solution to me.Jay
Re: [PATCH 31/43 v2] drivers/net/tokenring: fix sparse warning: cast truncates bits from const value
In reply to Hannes EderFrom: Hannes Eder <[email protected]>
Date: Sun, 15 Feb 2009 13:13:01 +0100
Quoted 11 lines
Impact: Remove the write-only field '
current_ring_status' completely.Fix this sparse warnings:
drivers/net/tokenring/smctr.c:4410:52: warning: cast truncates bits from constant value (100 becomes 0)drivers/net/tokenring/smctr.c:4415:52: warning: cast truncates bits from constant value (400 becomes 0)drivers/net/tokenring/smctr.c:4420:52: warning: cast truncates bits from constant value (800 becomes 0)drivers/net/tokenring/smctr.c:4425:52: warning: cast truncates bits from constant value (1000 becomes 0)drivers/net/tokenring/smctr.c:4430:52: warning: cast truncates bits from constant value (2000 becomes 0)drivers/net/tokenring/smctr.c:4435:52: warning: cast truncates bits from constant value (4000 becomes 0)drivers/net/tokenring/smctr.c:4440:52: warning: cast truncates bits from constant value (8000 becomes 0)
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 32/43 drivers/net/tulip: fix warning: format not a string literal and no ...
In reply to Hannes EderImpact: Use 'static const char[]' instead of 'static char[]' and while being at it add a KERN_INFO prefix.
Fix this warning:
drivers/net/tulip/de4x5.c: In function 'de4x5_hw_init':
drivers/net/tulip/de4x5.c:1268: warning: format not a string literal and no format arguments drivers/net/tulip/winbond-840.c: In function 'w840_init':
drivers/net/tulip/winbond-840.c:1666: warning: format not a string literal and no format arguments
--- drivers/net/tulip/de4x5.c | 3 ++- drivers/net/tulip/winbond-840.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/tulip/de4x5.c +1 -1
@@ -479,7 +479,8 @@#include "de4x5.h" -static char version[]__devinitdata ="de4x5.c:V0.546 2001/02/22 [email protected]\n" ; +static const char version[] __devinitdata + KERN_INFO "de4x5.c:V0.546 2001/02/22 [email protected]\n";#define c_char const char
drivers/net/tulip/winbond-840.c +0 -1
@@ -139,7 +139,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};#define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer.*/ /* These identify the driver base version and may not be removed. */ -static char version[] +static const char version[] __initdata KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " DRV_RELDATE " Donald Becker <[email protected]>\n"KERN_INFO " http://www.scyld.com/network/drivers.html\n" ;
Re: [PATCH 32/43] drivers/net/tulip: fix warning: format not a string literal and no ...
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:46:59 +0100
Quoted 10 lines
Impact: Use 'static const char[]' instead of 'static char[]' and while being at it add a
KERN_INFOprefix.Fix this warning:
drivers/net/tulip/de4x5.c: In function 'de4x5_hw_init':
drivers/net/tulip/de4x5.c:1268: warning: format not a string literal and no format argumentsdrivers/net/tulip/winbond-840.c: In function 'w840_init':
drivers/net/tulip/winbond-840.c:1666: warning: format not a string literal and no format argumentsSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 33/43 drivers/net/tulip: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Rename a local variable resp. remove a redundant variable and while being at it use more unform loop constructs.
Fix this sparse warning:
drivers/net/tulip/de4x5.c:3944:13: warning: symbol 'i' shadows an earlier one drivers/net/tulip/de4x5.c:3938:9: originally declared here drivers/net/tulip/media.c:72:21: warning: symbol 'i' shadows an earlier one drivers/net/tulip/media.c:54:13: originally declared here drivers/net/tulip/media.c:134:21: warning: symbol 'i' shadows an earlier one drivers/net/tulip/media.c:117:13: originally declared here
--- drivers/net/tulip/de4x5.c | 4 ++-- drivers/net/tulip/media.c | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/tulip/de4x5.c +2 -2
@@ -3942,8 +3942,8 @@ PCI_signature(char *name, struct de4x5_private *lp)strcpy (name,"DE434/5" );return status; }else {/* Search for a DEC name in the SROM */ -int i = *((char *)&lp->srom +19 ) *3 ; -strncpy (name, (char *)&lp->srom +26 + i,8 ); +int tmp = *((char *)&lp->srom +19 ) *3 ; +strncpy (name, (char *)&lp->srom +26 + tmp,8 ); } name[8 ] ='\0' ;for (i=0 ; i<siglen; i++) {
drivers/net/tulip/media.c +3 -5
@@ -69,11 +69,10 @@ int tulip_mdio_read(struct net_device *dev, int phy_id, int location)spin_lock_irqsave (&tp->mii_lock, flags);if (tp->chip_id =LC82C168 ) { -int i =1000 ;iowrite32 (0x60020000 + (phy_id<<23 ) + (location<<18 ), ioaddr +0xA0 );ioread32 (ioaddr +0xA0 );ioread32 (ioaddr +0xA0 ); -while (--i >0 ) { +for (i =1000 ; i >=0 ; --i) {barrier ();if ( ! ((retval =ioread32 (ioaddr +0xA0 )) &0x80000000 ))break ;
@@ -131,13 +130,12 @@ void tulip_mdio_write(struct net_device *dev, int phy_id, int location, int val)spin_lock_irqsave (&tp->mii_lock, flags);if (tp->chip_id =LC82C168 ) { -int i =1000 ;iowrite32 (cmd, ioaddr +0xA0 ); -do { +for (i =1000 ; i >=0 ; --i) {barrier ();if ( ! (ioread32 (ioaddr +0xA0 ) &0x80000000 ))break ; - }while (--i >0 ); + }spin_unlock_irqrestore (&tp->mii_lock, flags);return ; }
Re: [PATCH 33/43] drivers/net/tulip: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:47:30 +0100
Quoted 11 lines
Impact: Rename a local variable resp. remove a redundant variable and while being at it use more unform loop constructs.
Fix this sparse warning:
drivers/net/tulip/de4x5.c:3944:13: warning: symbol 'i' shadows an earlier onedrivers/net/tulip/de4x5.c:3938:9: originally declared heredrivers/net/tulip/media.c:72:21: warning: symbol 'i' shadows an earlier onedrivers/net/tulip/media.c:54:13: originally declared heredrivers/net/tulip/media.c:134:21: warning: symbol 'i' shadows an earlier onedrivers/net/tulip/media.c:117:13: originally declared here
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 34/43 drivers/net/usb: fix sparse warnings: Should it be static?
In reply to Hannes EderImpact: Make symbols static.
Fix this sparse warnings:
drivers/net/usb/hso.c:1249:6: warning: symbol 'hso_unthrottle_tasklet' was not declared. Should it be static? drivers/net/usb/hso.c:1268:6: warning: symbol 'hso_unthrottle_workfunc' was not declared. Should it be static? drivers/net/usb/hso.c:1466:5: warning: symbol 'tiocmget_submit_urb' was not declared. Should it be static? drivers/net/usb/smsc95xx.c:62:5: warning: symbol 'turbo_mode' was not declared. Should it be static?
--- drivers/net/usb/hso.c | 10 +++++----- drivers/net/usb/smsc95xx.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/usb/hso.c +5 -5
@@ -1246,7 +1246,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)* This needs to be a tasklet otherwise we will * end up recursively calling this function. */ -void hso_unthrottle_tasklet (struct hso_serial *serial) +static void hso_unthrottle_tasklet (struct hso_serial *serial) {unsigned long flags;
@@ -1265,7 +1265,7 @@ static void hso_unthrottle(struct tty_struct *tty)tasklet_hi_schedule (&serial->unthrottle_tasklet); } -void hso_unthrottle_workfunc (struct work_struct *work) +static void hso_unthrottle_workfunc (struct work_struct *work) { struct hso_serial *serial container_of(work, struct hso_serial,
@@ -1464,9 +1464,9 @@ static int hso_serial_chars_in_buffer(struct tty_struct *tty)return chars; } -int tiocmget_submit_urb (struct hso_serial *serial, -struct hso_tiocmget *tiocmget, -struct usb_device *usb) +static int tiocmget_submit_urb (struct hso_serial *serial, +struct hso_tiocmget *tiocmget, +struct usb_device *usb) {int result;
drivers/net/usb/smsc95xx.c +1 -1
@@ -58,7 +58,7 @@ struct usb_context {struct usbnet *dev; }; -int turbo_mode = true; +static int turbo_mode = true;module_param (turbo_mode, bool,0644 );MODULE_PARM_DESC (turbo_mode,"Enable multiple frames per Rx transaction" );
Re: [PATCH 34/43] drivers/net/usb: fix sparse warnings: Should it be static?
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:47:47 +0100
Quoted 9 lines
Impact: Make symbols static.
Fix this sparse warnings:
drivers/net/usb/hso.c:1249:6: warning: symbol 'hso_unthrottle_tasklet' was not declared. Should it be static?drivers/net/usb/hso.c:1268:6: warning: symbol 'hso_unthrottle_workfunc' was not declared. Should it be static?drivers/net/usb/hso.c:1466:5: warning: symbol 'tiocmget_submit_urb' was not declared. Should it be static?drivers/net/usb/smsc95xx.c:62:5: warning: symbol 'turbo_mode' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 35/43 drivers/net/wan: fix warning: format not a string literal and no ...
In reply to Hannes EderImpact: Use 'static const char[]' instead of 'static char[]'.
Fix this compilation warnings:
drivers/net/wan/lapbether.c: In function 'lapbeth_init_driver':
drivers/net/wan/lapbether.c:441: warning: format not a string literal and no format arguments drivers/net/wan/z85230.c: In function 'z85230_init_driver':
drivers/net/wan/z85230.c:1782: warning: format not a string literal and no format arguments
--- drivers/net/wan/lapbether.c | 3 ++- drivers/net/wan/z85230.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wan/lapbether.c +1 -1
@@ -430,7 +430,8 @@ static struct notifier_block lapbeth_dev_notifier = { .notifier_call = lapbeth_device_event, }; -static char banner[]__initdata =KERN_INFO "LAPB Ethernet driver version 0.02\n" ; +static const char banner[] __initdata + KERN_INFO "LAPB Ethernet driver version 0.02\n";static int __init lapbeth_init_driver (void ) {
drivers/net/wan/z85230.c +1 -1
@@ -1775,7 +1775,8 @@ EXPORT_SYMBOL(z8530_queue_xmit);/* * Module support */ -static char banner[]__initdata =KERN_INFO "Generic Z85C30/Z85230 interface driver v0.02\n" ; +static const char banner[] __initdata + KERN_INFO "Generic Z85C30/Z85230 interface driver v0.02\n";static int __init z85230_init_driver (void ) {
Re: [PATCH 35/43] drivers/net/wan: fix warning: format not a string literal and no ...
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:48:07 +0100
Quoted 9 lines
Impact: Use 'static const char[]' instead of 'static char[]'.
Fix this compilation warnings:
drivers/net/wan/lapbether.c: In function 'lapbeth_init_driver':
drivers/net/wan/lapbether.c:441: warning: format not a string literal and no format argumentsdrivers/net/wan/z85230.c: In function 'z85230_init_driver':
drivers/net/wan/z85230.c:1782: warning: format not a string literal and no format argumentsSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 36/43 drivers/net/wan: fix sparse warning: symbol shadows an earlier one
In reply to Hannes EderImpact: Rename function scope variable and while being at it fix some coding style issues.
Fix this sparse warning:
drivers/net/wan/sbni.c:1526:14: warning: symbol 'num' shadows an earlier one drivers/net/wan/sbni.c:160:13: originally declared here
--- drivers/net/wan/sbni.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-)
drivers/net/wan/sbni.c +9 -8
@@ -1520,17 +1520,18 @@ int __init init_module( void ) }void -cleanup_module (void ) +cleanup_module (void ) { -struct net_device *dev; -int num; +int i; -for ( num =0 ; num <SBNI_MAX_NUM_CARDS ; ++num ) -if ( (dev = sbni_cards[ num ]) !=NULL ) { -unregister_netdev ( dev ); -release_region ( dev->base_addr,SBNI_IO_EXTENT ); -free_netdev ( dev ); +for (i =0 ; i <SBNI_MAX_NUM_CARDS ; ++i) { +struct net_device *dev = sbni_cards[i]; +if (dev !=NULL ) { +unregister_netdev (dev); +release_region (dev->base_addr,SBNI_IO_EXTENT ); +free_netdev (dev); } + } }#else /* MODULE */
Re: [PATCH 36/43] drivers/net/wan: fix sparse warning: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:48:25 +0100
Quoted 8 lines
Impact: Rename function scope variable and while being at it fix some coding style issues.
Fix this sparse warning:
drivers/net/wan/sbni.c:1526:14: warning: symbol 'num' shadows an earlier onedrivers/net/wan/sbni.c:160:13: originally declared hereSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 37/43 drivers/net/wireless: fix sparse warning: context imbalance
In reply to Hannes EderImpact: Attribute function with __acquires(...) resp. __releases(...).
Fix this sparse warnings:
drivers/net/wireless/strip.c:955:21: warning: context imbalance in 'strip_seq_start' - wrong count at exit drivers/net/wireless/strip.c:975:13: warning: context imbalance in 'strip_seq_stop' - unexpected unlock
--- drivers/net/wireless/strip.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/wireless/strip.c +2 -0
@@ -950,6 +950,7 @@ static struct strip *strip_get_idx(loff_t pos) }static void *strip_seq_start (struct seq_file *seq,loff_t *pos) +__acquires (RCU ) {rcu_read_lock ();return *pos ?strip_get_idx (*pos -1 ) :SEQ_START_TOKEN ;
@@ -973,6 +974,7 @@ static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos) }static void strip_seq_stop (struct seq_file *seq,void *v) +__releases (RCU ) {rcu_read_unlock (); }
Re: [PATCH 37/43] drivers/net/wireless: fix sparse warning: context imbalance
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:48:44 +0100
Quoted 7 lines
Impact: Attribute function with
__acquires(...)resp.__releases(...).Fix this sparse warnings:
drivers/net/wireless/strip.c:955:21: warning: context imbalance in 'strip_seq_start' - wrong count at exitdrivers/net/wireless/strip.c:975:13: warning: context imbalance in 'strip_seq_stop' - unexpected unlockSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 38/43 drivers/net/wireless: fix sparse warnings: symbol shadows an earlier one
In reply to Hannes EderImpact:
Move variable closer to usage resp.
remove redundant variables resp.
rename function scope variable.
Fix this sparse warnings:
drivers/net/wireless/airo.c:3840:29: warning: symbol 'i' shadows an earlier one drivers/net/wireless/airo.c:3751:13: originally declared here drivers/net/wireless/airo.c:3847:29: warning: symbol 'i' shadows an earlier one drivers/net/wireless/airo.c:3751:13: originally declared here drivers/net/wireless/airo.c:3861:21: warning: symbol 'i' shadows an earlier one drivers/net/wireless/airo.c:3751:13: originally declared here drivers/net/wireless/wavelan.c:43:13: warning: symbol 'irq' shadows an earlier one drivers/net/wireless/wavelan.p.h:692:17: originally declared here
--- drivers/net/wireless/airo.c | 4 +--- drivers/net/wireless/wavelan.c | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/wireless/airo.c +1 -3
@@ -3748,7 +3748,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)Cmd cmd;Resp rsp;int status; -int i;SsidRid mySsid;__le16 lastindex;WepKeyRid wkr;
@@ -3790,6 +3789,7 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)if (lock)up (&ai->sem);if (ai->config.len =0 ) { +int i;tdsRssiRid rssi_rid;CapabilityRid cap_rid;
@@ -3837,14 +3837,12 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)/* Check to see if there are any insmod configured rates to add */ if ( rates[0 ] ) { -int i =0 ;memset (ai->config.rates,0 ,sizeof (ai->config.rates));for ( i =0 ; i <8 && rates[i]; i++ ) { ai->config.rates[i] = rates[i]; } }if ( basic_rate >0 ) { -int i;for ( i =0 ; i <8 ; i++ ) {if ( ai->config.rates[i] = basic_rate || !ai->config.rates ) {
drivers/net/wireless/wavelan.c +4 -4
@@ -40,11 +40,11 @@ static u8 wv_irq_to_psa(int irq)*/ static int __init wv_psa_to_irq (u8 irqval) { -int irq; +int i; -for (irq =0 ; irq <ARRAY_SIZE (irqvals); irq++) -if (irqvals[irq] = irqval) -return irq; +for (i =0 ; i <ARRAY_SIZE (irqvals); i++) +if (irqvals[i] = irqval) +return i;return -1 ; }
Re: [PATCH 38/43] drivers/net/wireless: fix sparse warnings: symbol shadows an earlier one
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:49:09 +0100
Quoted 15 lines
Impact:
Move variable closer to usage resp.
remove redundant variables resp.
rename function scope variable.Fix this sparse warnings:
drivers/net/wireless/airo.c:3840:29: warning: symbol 'i' shadows an earlier onedrivers/net/wireless/airo.c:3751:13: originally declared heredrivers/net/wireless/airo.c:3847:29: warning: symbol 'i' shadows an earlier onedrivers/net/wireless/airo.c:3751:13: originally declared heredrivers/net/wireless/airo.c:3861:21: warning: symbol 'i' shadows an earlier onedrivers/net/wireless/airo.c:3751:13: originally declared heredrivers/net/wireless/wavelan.c:43:13: warning: symbol 'irq' shadows an earlier onedrivers/net/wireless/wavelan.p.h:692:17: originally declared here
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 39/43 drivers/net/wireless: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/wireless/airo.c:2102:21: warning: incorrect type in initializer (different signedness) drivers/net/wireless/airo.c:2126:21: warning: incorrect type in initializer (different signedness) drivers/net/wireless/airo.c:2167:21: warning: incorrect type in initializer (different signedness) drivers/net/wireless/airo.c:2191:21: warning: incorrect type in initializer (different signedness)
--- drivers/net/wireless/airo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/airo.c +1 -1
@@ -1161,7 +1161,7 @@ struct airo_info {use the high bit to mark whether it is in use. */ #define MAX_FIDS 6#define MPI_MAX_FIDS 1 -int fids[MAX_FIDS ]; +u32 fids[MAX_FIDS ];ConfigRid config;char keyindex;// Used with auto wep char defindex;// Used with auto wep
Re: [PATCH 39/43] drivers/net/wireless: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:49:26 +0100
Quoted 7 lines
Fix this sparse warnings:
drivers/net/wireless/airo.c:2102:21: warning: incorrect type in initializer (different signedness)drivers/net/wireless/airo.c:2126:21: warning: incorrect type in initializer (different signedness)drivers/net/wireless/airo.c:2167:21: warning: incorrect type in initializer (different signedness)drivers/net/wireless/airo.c:2191:21: warning: incorrect type in initializer (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 40/43 drivers/net/wireless/ath9k: fix sparse warnings: Should it be static?
In reply to Hannes EderImpact: Make symbols static.
Fix this sparse warnings:
drivers/net/wireless/ath9k/eeprom.c:1343:5: warning: symbol 'ath9k_hw_4k_get_spur_channel' was not declared. Should it be static? drivers/net/wireless/ath9k/eeprom.c:1372:19: warning: symbol 'eep_4k_ops' was not declared. Should it be static? drivers/net/wireless/ath9k/eeprom.c:2649:5: warning: symbol 'ath9k_hw_def_get_spur_channel' was not declared. Should it be static? drivers/net/wireless/ath9k/eeprom.c:2678:19: warning: symbol 'eep_def_ops' was not declared. Should it be static?
--- drivers/net/wireless/ath9k/eeprom.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath9k/eeprom.c +4 -4
@@ -1340,7 +1340,7 @@ static u8 ath9k_hw_4k_get_num_ant_config(struct ath_hw *ah,return 1 ; } -u16 ath9k_hw_4k_get_spur_channel (struct ath_hw *ah,u16 i,bool is2GHz) +static u16 ath9k_hw_4k_get_spur_channel (struct ath_hw *ah,u16 i,bool is2GHz) {#define EEP_MAP4K_SPURCHAN \ (ah->eeprom.map4k.modalHeader.spurChans[i].spurChan)
@@ -1369,7 +1369,7 @@ u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)#undef EEP_MAP4K_SPURCHAN } -struct eeprom_ops eep_4k_ops = { +static struct eeprom_ops eep_4k_ops = { .check_eeprom = ath9k_hw_4k_check_eeprom, .get_eeprom = ath9k_hw_4k_get_eeprom, .fill_eeprom = ath9k_hw_4k_fill_eeprom,
@@ -2646,7 +2646,7 @@ static u16 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,return pModal->antCtrlCommon &0xFFFF ; } -u16 ath9k_hw_def_get_spur_channel (struct ath_hw *ah,u16 i,bool is2GHz) +static u16 ath9k_hw_def_get_spur_channel (struct ath_hw *ah,u16 i,bool is2GHz) {#define EEP_DEF_SPURCHAN \ (ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan)
@@ -2675,7 +2675,7 @@ u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)#undef EEP_DEF_SPURCHAN } -struct eeprom_ops eep_def_ops = { +static struct eeprom_ops eep_def_ops = { .check_eeprom = ath9k_hw_def_check_eeprom, .get_eeprom = ath9k_hw_def_get_eeprom, .fill_eeprom = ath9k_hw_def_fill_eeprom,
Re: [PATCH 40/43] drivers/net/wireless/ath9k: fix sparse warnings: Should it be static?
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:49:48 +0100
Quoted 9 lines
Impact: Make symbols static.
Fix this sparse warnings:
drivers/net/wireless/ath9k/eeprom.c:1343:5: warning: symbol 'ath9k_hw_4k_get_spur_channel' was not declared. Should it be static?drivers/net/wireless/ath9k/eeprom.c:1372:19: warning: symbol 'eep_4k_ops' was not declared. Should it be static?drivers/net/wireless/ath9k/eeprom.c:2649:5: warning: symbol 'ath9k_hw_def_get_spur_channel' was not declared. Should it be static?drivers/net/wireless/ath9k/eeprom.c:2678:19: warning: symbol 'eep_def_ops' was not declared. Should it be static?Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 41/43 drivers/net/wireless/b43: fix warning: format not a string literal and no ...
In reply to Hannes EderFix this compilation warning:
drivers/net/wireless/b43/main.c: In function 'b43_print_fw_helptext':
drivers/net/wireless/b43/main.c:1971: warning: format not a string literal and no format arguments drivers/net/wireless/b43/main.c:1973: warning: format not a string literal and no format arguments
--- drivers/net/wireless/b43/main.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/b43/main.c +4 -5
@@ -1961,12 +1961,12 @@ static void b43_release_firmware(struct b43_wldev *dev)static void b43_print_fw_helptext (struct b43_wl *wl,bool error) { -const char *text; + const char text[] + "You must go to " \ +"http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware " \ +"and download the correct firmware for this driver version. " \ +"Please carefully read all instructions on this website.\n" ; - text ="You must go to " -"http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware " -"and download the correct firmware for this driver version. " -"Please carefully read all instructions on this website.\n" ;if (error)b43err (wl, text);else
Re: [PATCH 41/43] drivers/net/wireless/b43: fix warning: format not a string literal and no ...
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:50:06 +0100
Quoted 6 lines
Fix this compilation warning:
drivers/net/wireless/b43/main.c: In function 'b43_print_fw_helptext':
drivers/net/wireless/b43/main.c:1971: warning: format not a string literal and no format argumentsdrivers/net/wireless/b43/main.c:1973: warning: format not a string literal and no format argumentsSigned-off-by Hannes Eder <[email protected]>
Applied.
PATCH 42/43 drivers/net/wireless/ipw2x00: fix sparse warnings: fix signedness
In reply to Hannes EderFix this sparse warnings:
drivers/net/wireless/ipw2x00/ipw2100.c:1930:43: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:1938:76: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:1946:67: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:1953:72: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:4071:73: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:4078:43: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:4084:67: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:7141:73: warning: incorrect type in argument 4 (different signedness) drivers/net/wireless/ipw2x00/ipw2100.c:8317:48: warning: incorrect type in argument 4 (different signedness)
--- drivers/net/wireless/ipw2x00/ipw2100.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ipw2x00/ipw2100.c +5 -4
@@ -1910,7 +1910,8 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status) {#define MAC_ASSOCIATION_READ_DELAY (HZ) -int ret, len, essid_len; +int ret; +unsigned int len, essid_len;char essid[IW_ESSID_MAX_SIZE ];u32 txrate;u32 chan;
@@ -4058,7 +4059,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,u8 bssid[ETH_ALEN ];u32 chan =0 ;char *out = buf; -int length; +unsigned int length;int ret;if (priv->status &STATUS_RF_KILL_MASK )
@@ -7122,7 +7123,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev, {struct ipw2100_priv *priv =ieee80211_priv (dev);int val; -int len =sizeof (val); +unsigned int len =sizeof (val);int err =0 ; if (!(priv->status & STATUS_ENABLED) ||
@@ -8297,7 +8298,7 @@ static void ipw2100_wx_event_work(struct work_struct *work) struct ipw2100_priv *priv container_of(work, struct ipw2100_priv, wx_event_work.work);union iwreq_data wrqu; -int len =ETH_ALEN ; +unsigned int len =ETH_ALEN ;if (priv->status &STATUS_STOPPING )return ;
Re: [PATCH 42/43] drivers/net/wireless/ipw2x00: fix sparse warnings: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:50:26 +0100
Quoted 11 lines
Fix this sparse warnings:
drivers/net/wireless/ipw2x00/ipw2100.c:1930:43: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:1938:76: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:1946:67: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:1953:72: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:4071:73: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:4078:43: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:4084:67: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:7141:73: warning: incorrect type in argument 4 (different signedness)drivers/net/wireless/ipw2x00/ipw2100.c:8317:48: warning: incorrect type in argument 4 (different signedness)
Quoted 1 line
Signed-off-by Hannes Eder <[email protected]>
Applied.
PATCH 43/43 drivers/net/wireless/prism54: fix sparse warning: fix signedness
In reply to Hannes EderFix sparse warning:
drivers/net/wireless/prism54/isl_ioctl.c:2997:32: warning: incorrect type in argument 2 (different signedness) drivers/net/wireless/prism54/oid_mgt.c:712:42: warning: incorrect type in argument 2 (different signedness)
--- drivers/net/wireless/prism54/isl_ioctl.c | 3 ++- drivers/net/wireless/prism54/oid_mgt.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/prism54/isl_ioctl.c +2 -1
@@ -2981,7 +2981,8 @@ prism54_set_spy(struct net_device *ndev, union iwreq_data *uwrq, char *extra) { islpci_private *priv = netdev_priv(ndev); -u32 u, oid =OID_INL_CONFIG ; +u32 u; +enum oid_num_t oid =OID_INL_CONFIG ;down_write (&priv->mib_sem);mgt_get (priv,OID_INL_CONFIG , &u);
drivers/net/wireless/prism54/oid_mgt.c +1 -1
@@ -698,7 +698,7 @@ int mgt_commit(islpci_private *priv) {int rvalue; -u32 u; +enum oid_num_t u;if (islpci_get_state (priv) <PRV_STATE_INIT )return 0 ;
Re: [PATCH 43/43] drivers/net/wireless/prism54: fix sparse warning: fix signedness
From: Hannes Eder <[email protected]>
Date: Sat, 14 Feb 2009 22:50:45 +0100
Quoted 5 lines
Fix sparse warning:
drivers/net/wireless/prism54/isl_ioctl.c:2997:32: warning: incorrect type in argument 2 (different signedness)drivers/net/wireless/prism54/oid_mgt.c:712:42: warning: incorrect type in argument 2 (different signedness)Signed-off-by Hannes Eder <[email protected]>
Applied.