[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE4R7bC6qrjDHNvKVCSPqxTo6LwCU2qm76yS8mYtsfC3nYQRag@mail.gmail.com>
Date: Wed, 25 Feb 2015 05:50:15 -0800
From: Scott Feldman <sfeldma@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Jiri Pirko <jiri@...nulli.us>, Netdev <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [patch 2/2] rocker: silence shift wrapping warning
On Wed, Feb 25, 2015 at 5:36 AM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> "val" is declared as a u64 so static checkers complain that this shift
> can wrap. I don't have the hardware but probably it's doesn't have over
> 31 ports. Still we may as well silence the warning even if it's not a
> real bug.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
> index 713a13c..9fb6948 100644
> --- a/drivers/net/ethernet/rocker/rocker.c
> +++ b/drivers/net/ethernet/rocker/rocker.c
> @@ -1257,9 +1257,9 @@ static void rocker_port_set_enable(struct rocker_port *rocker_port, bool enable)
> u64 val = rocker_read64(rocker_port->rocker, PORT_PHYS_ENABLE);
>
> if (enable)
> - val |= 1 << rocker_port->lport;
> + val |= 1ULL << rocker_port->lport;
> else
> - val &= ~(1 << rocker_port->lport);
> + val &= ~(1ULL << rocker_port->lport);
> rocker_write64(rocker_port->rocker, PORT_PHYS_ENABLE, val);
> }
>
Acked-by: Scott Feldman <sfeldma@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists