mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hannes Eder <hannes@hanneseder.net>
To: netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jay Schulist <jjschlst@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 31/43 v2] drivers/net/tokenring: fix sparse warning: cast  truncates bits from const value
Date: Mon, 16 Feb 2009 18:29:15 +0100	[thread overview]
Message-ID: <154e089b0902160929v617ed7d6o963da936b35ef7fb@mail.gmail.com> (raw)
In-Reply-To: <20090215121201.26072.42971.stgit@vmbox.hanneseder.net>

On Sun, Feb 15, 2009 at 1:13 PM, Hannes Eder <hannes@hanneseder.net> wrote:
> 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 <hannes@hanneseder.net>
> ---
>  drivers/net/tokenring/smctr.c |   10 ----------
>  drivers/net/tokenring/smctr.h |    1 -
>  2 files changed, 0 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
> index 5a3ff20..e66eb8a 100644
> --- a/drivers/net/tokenring/smctr.c
> +++ b/drivers/net/tokenring/smctr.c
> @@ -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:
> diff --git a/drivers/net/tokenring/smctr.h b/drivers/net/tokenring/smctr.h
> index 52df7dd..6e5700a 100644
> --- a/drivers/net/tokenring/smctr.h
> +++ b/drivers/net/tokenring/smctr.h
> @@ -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:

On Mon, Feb 16, 2009 at 4:17 PM, Jay Schulist <jjschlst@gmail.com> wrote:
> 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

  reply	other threads:[~2009-02-16 17:29 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-14 21:11 [PATCH 00/43] drivers/net: fix (sparse) warnings Hannes Eder
2009-02-14 21:11 ` [PATCH 01/43] drivers/net/at1700.c: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:21   ` David Miller
2009-02-14 21:12 ` [PATCH 02/43] drivers/net/e2100.c: " Hannes Eder
2009-02-15 14:04   ` walter harms
2009-02-15 19:57     ` Hannes Eder
2009-02-16  9:58       ` walter harms
2009-02-18  1:21   ` David Miller
2009-02-14 21:12 ` [PATCH 03/43] drivers/net/ni65.c: fix sparse warnings: " Hannes Eder
2009-02-18  1:21   ` David Miller
2009-02-14 21:12 ` [PATCH 04/43] drivers/net/ns83820.c: fix sparse warnings: fix signedness Hannes Eder
2009-02-18  1:21   ` David Miller
2009-02-14 21:12 ` [PATCH 05/43] drivers/net/niu.c: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:21   ` David Miller
2009-02-14 21:13 ` [PATCH 06/43] drivers/net/lance.c: fix sparse warnings: fix signedness Hannes Eder
2009-02-18  1:21   ` David Miller
2009-02-14 21:13 ` [PATCH 07/43] drivers/net/ni65.c: " Hannes Eder
2009-02-18  1:21   ` David Miller
2009-02-14 21:13 ` [PATCH 08/43] drivers/net/ppp*.c: " Hannes Eder
2009-02-14 21:29   ` Cyrill Gorcunov
2009-02-14 21:38     ` Cyrill Gorcunov
2009-02-14 21:57       ` Hannes Eder
2009-02-15  8:08         ` Cyrill Gorcunov
2009-02-18  1:22     ` David Miller
2009-02-14 21:14 ` [PATCH 09/43] drivers/net/r6040.c: fix sparse warning: Using plain integer as NULL pointer Hannes Eder
2009-02-15 14:00   ` Florian Fainelli
2009-02-18  1:22     ` David Miller
2009-02-14 21:14 ` [PATCH 10/43] drivers/net/s2io.c: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:22   ` David Miller
2009-02-18  1:26   ` David Miller
2009-02-14 21:14 ` [PATCH 11/43] drivers/net/arcnet: " Hannes Eder
2009-02-18  1:26   ` David Miller
2009-02-14 21:14 ` [PATCH 12/43] drivers/net/atl1e: fix sparse warnings: fix signedness Hannes Eder
2009-02-18  1:26   ` David Miller
2009-02-14 21:15 ` [PATCH 13/43] drivers/net/atlx: " Hannes Eder
2009-02-16  2:20   ` Jay Cliburn
2009-02-18  1:26   ` David Miller
2009-02-14 21:15 ` [PATCH 14/43] drivers/net/bonding: fix sparse warnings: context imbalance Hannes Eder
2009-02-18  1:27   ` David Miller
2009-02-14 21:15 ` [PATCH 15/43] drivers/net/bonding: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:27   ` David Miller
2009-02-14 21:16 ` [PATCH 16/43] drivers/net/cxgb3: " Hannes Eder
2009-02-15 14:14   ` walter harms
2009-02-15 20:10     ` Hannes Eder
2009-02-15 21:30   ` Divy Le Ray
2009-02-18  1:27     ` David Miller
2009-02-14 21:16 ` [PATCH 17/43] drivers/net/cxgb3: fix sparse warnings: fix signedness Hannes Eder
2009-02-15 21:32   ` Divy Le Ray
2009-02-18  1:27     ` David Miller
2009-02-14 21:32 ` [PATCH 18/43] drivers/net/e1000e: fix sparse warning: Should it be static? Hannes Eder
2009-02-18  1:27   ` David Miller
2009-02-14 21:33 ` [PATCH 19/43] drivers/net/hamradio: fix warning: format not a string literal and no Hannes Eder
2009-02-18  1:27   ` David Miller
2009-02-14 21:34 ` [PATCH 20/43] drivers/net/hamradio: fix sparse warning: context imbalance Hannes Eder
2009-02-18  1:38   ` David Miller
2009-02-14 21:35 ` [PATCH 21/43] drivers/net/hamradio: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:38   ` David Miller
2009-02-14 21:36 ` [PATCH 22/43] drivers/net/hamradio: fix sparse warnings: fix signedness Hannes Eder
2009-02-18  1:38   ` David Miller
2009-02-14 21:38 ` [PATCH 23/43] drivers/net/igb: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:39   ` David Miller
2009-02-18 21:49     ` [PATCH 23/43 v2] " Hannes Eder
2009-02-19  3:36       ` David Miller
2009-02-14 21:38 ` [PATCH 24/43] drivers/net/ixgbe: fix sparse warning: Should it be static? Hannes Eder
2009-02-16  6:48   ` Waskiewicz Jr, Peter P
2009-02-18  1:39     ` David Miller
2009-02-14 21:39 ` [PATCH 25/43] drivers/net/pcmcia: fix warning: format not a string literal and no Hannes Eder
2009-02-18  1:39   ` David Miller
2009-02-14 21:41 ` [PATCH 26/43] drivers/net/sfc: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-16  0:38   ` Ben Hutchings
2009-02-18  1:39     ` David Miller
2009-02-14 21:42 ` [PATCH 27/43] drivers/net/sfc: fix sparse warnings: Should it be static? Hannes Eder
2009-02-16  0:37   ` Ben Hutchings
2009-02-16  9:38     ` Hannes Eder
2009-02-16  9:54       ` [PATCH] " Hannes Eder
2009-02-19  1:49         ` David Miller
2009-02-18  1:39       ` [PATCH 27/43] " David Miller
2009-02-14 21:43 ` [PATCH 28/43] drivers/net/skfp: fix sparse warning: " Hannes Eder
2009-02-18  1:40   ` David Miller
2009-02-14 21:44 ` [PATCH 29/43] drivers/net/tokenring: fix warning: format not a string literal and no Hannes Eder
2009-02-18  1:40   ` David Miller
2009-02-14 21:44 ` [PATCH 30/43] drivers/net/tokenring: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  1:41   ` David Miller
2009-02-14 21:46 ` [PATCH 31/43] drivers/net/tokenring: fix sparse warning: cast truncates bits from const value Hannes Eder
2009-02-14 23:24   ` Al Viro
2009-02-15 11:47     ` Hannes Eder
2009-02-15 12:13       ` [PATCH 31/43 v2] " Hannes Eder
2009-02-16 17:29         ` Hannes Eder [this message]
2009-02-18  3:49         ` David Miller
2009-02-14 21:46 ` [PATCH 32/43] drivers/net/tulip: fix warning: format not a string literal and no Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:47 ` [PATCH 33/43] drivers/net/tulip: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:47 ` [PATCH 34/43] drivers/net/usb: fix sparse warnings: Should it be static? Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:48 ` [PATCH 35/43] drivers/net/wan: fix warning: format not a string literal and no Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:48 ` [PATCH 36/43] drivers/net/wan: fix sparse warning: symbol shadows an earlier one Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:48 ` [PATCH 37/43] drivers/net/wireless: fix sparse warning: context imbalance Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:49 ` [PATCH 38/43] drivers/net/wireless: fix sparse warnings: symbol shadows an earlier one Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:49 ` [PATCH 39/43] drivers/net/wireless: fix sparse warnings: fix signedness Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:49 ` [PATCH 40/43] drivers/net/wireless/ath9k: fix sparse warnings: Should it be static? Hannes Eder
2009-02-18  3:35   ` David Miller
2009-02-14 21:50 ` [PATCH 41/43] drivers/net/wireless/b43: fix warning: format not a string literal and no Hannes Eder
2009-02-18  3:49   ` David Miller
2009-02-14 21:50 ` [PATCH 42/43] drivers/net/wireless/ipw2x00: fix sparse warnings: fix signedness Hannes Eder
2009-02-18  3:49   ` David Miller
2009-02-14 21:50 ` [PATCH 43/43] drivers/net/wireless/prism54: fix sparse warning: " Hannes Eder
2009-02-18  3:49   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154e089b0902160929v617ed7d6o963da936b35ef7fb@mail.gmail.com \
    --to=hannes@hanneseder.net \
    --cc=jjschlst@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®