[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180215202757.GB3080@lunn.ch>
Date: Thu, 15 Feb 2018 21:27:57 +0100
From: Andrew Lunn <andrew@...n.ch>
To: richardcochran@...il.com
Cc: Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
Florian Fainelli <f.fainelli@...il.com>,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] net: dsa: mv88e6xxx: avoid unintended sign
extension on a 16 bit shift
> diff --git a/drivers/net/dsa/mv88e6xxx/hwtstamp.c b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
> index b251d534b70d..758e35fa69ab 100644
> --- a/drivers/net/dsa/mv88e6xxx/hwtstamp.c
> +++ b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
> @@ -321,7 +321,7 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip,
> */
> for ( ; skb; skb = skb_dequeue(rxq)) {
> if (mv88e6xxx_ts_valid(status) && seq_match(skb, seq_id)) {
> - u64 ns = timehi << 16 | timelo;
> + u64 ns = (u64)timehi << 16 | timelo;
Hi Richard
Do you prefer this, or making timehi and timelo a u64?
Andrew
Powered by blists - more mailing lists