提交 ad7bf428 编写于 作者: H Hannes Eder 提交者: David S. Miller

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)
Signed-off-by: NHannes Eder <hannes@hanneseder.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7f50ca07
...@@ -4393,52 +4393,42 @@ static int smctr_ring_status_chg(struct net_device *dev) ...@@ -4393,52 +4393,42 @@ static int smctr_ring_status_chg(struct net_device *dev)
{ {
case RING_RECOVERY: case RING_RECOVERY:
printk(KERN_INFO "%s: Ring Recovery\n", dev->name); printk(KERN_INFO "%s: Ring Recovery\n", dev->name);
tp->current_ring_status |= RING_RECOVERY;
break; break;
case SINGLE_STATION: case SINGLE_STATION:
printk(KERN_INFO "%s: Single Statinon\n", dev->name); printk(KERN_INFO "%s: Single Statinon\n", dev->name);
tp->current_ring_status |= SINGLE_STATION;
break; break;
case COUNTER_OVERFLOW: case COUNTER_OVERFLOW:
printk(KERN_INFO "%s: Counter Overflow\n", dev->name); printk(KERN_INFO "%s: Counter Overflow\n", dev->name);
tp->current_ring_status |= COUNTER_OVERFLOW;
break; break;
case REMOVE_RECEIVED: case REMOVE_RECEIVED:
printk(KERN_INFO "%s: Remove Received\n", dev->name); printk(KERN_INFO "%s: Remove Received\n", dev->name);
tp->current_ring_status |= REMOVE_RECEIVED;
break; break;
case AUTO_REMOVAL_ERROR: case AUTO_REMOVAL_ERROR:
printk(KERN_INFO "%s: Auto Remove Error\n", dev->name); printk(KERN_INFO "%s: Auto Remove Error\n", dev->name);
tp->current_ring_status |= AUTO_REMOVAL_ERROR;
break; break;
case LOBE_WIRE_FAULT: case LOBE_WIRE_FAULT:
printk(KERN_INFO "%s: Lobe Wire Fault\n", dev->name); printk(KERN_INFO "%s: Lobe Wire Fault\n", dev->name);
tp->current_ring_status |= LOBE_WIRE_FAULT;
break; break;
case TRANSMIT_BEACON: case TRANSMIT_BEACON:
printk(KERN_INFO "%s: Transmit Beacon\n", dev->name); printk(KERN_INFO "%s: Transmit Beacon\n", dev->name);
tp->current_ring_status |= TRANSMIT_BEACON;
break; break;
case SOFT_ERROR: case SOFT_ERROR:
printk(KERN_INFO "%s: Soft Error\n", dev->name); printk(KERN_INFO "%s: Soft Error\n", dev->name);
tp->current_ring_status |= SOFT_ERROR;
break; break;
case HARD_ERROR: case HARD_ERROR:
printk(KERN_INFO "%s: Hard Error\n", dev->name); printk(KERN_INFO "%s: Hard Error\n", dev->name);
tp->current_ring_status |= HARD_ERROR;
break; break;
case SIGNAL_LOSS: case SIGNAL_LOSS:
printk(KERN_INFO "%s: Signal Loss\n", dev->name); printk(KERN_INFO "%s: Signal Loss\n", dev->name);
tp->current_ring_status |= SIGNAL_LOSS;
break; break;
default: default:
......
...@@ -977,7 +977,6 @@ typedef struct net_local { ...@@ -977,7 +977,6 @@ typedef struct net_local {
__u8 monitor_state_ready; __u8 monitor_state_ready;
__u16 ring_status; __u16 ring_status;
__u8 ring_status_flags; __u8 ring_status_flags;
__u8 current_ring_status;
__u8 state; __u8 state;
__u8 join_state; __u8 join_state;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册