[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1ed4dfc4-3561-47d1-ad1f-507f67ed03f0@canonical.com>
Date: Tue, 20 Apr 2021 13:39:53 +0100
From: Colin Ian King <colin.king@...onical.com>
To: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@....nxp.com>
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: re: phy: nxp-c45: add driver for tja1103
Hi,
Static analysis with Coverity on linux-next has found a potential issue
in drivers/net/phy/nxp-c45-tja11xx.c, function nxp_c45_get_phase_shift.
The analysis by Coverity is as follows:
350 static u64 nxp_c45_get_phase_shift(u64 phase_offset_raw)
351 {
352 /* The delay in degree phase is 73.8 + phase_offset_raw * 0.9.
353 * To avoid floating point operations we'll multiply by 10
354 * and get 1 decimal point precision.
355 */
356 phase_offset_raw *= 10;
Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: phase_offset_raw is always assigned 0.
Did you intend to negate the value of phase_offset_raw instead of
assigning it 0? This occurs as the value assigned by "-".
357 phase_offset_raw -= phase_offset_raw;
358 return div_u64(phase_offset_raw, 9);
359 }
phase_offset_raw -= phase_offset_raw results in phase_offset_raw being
zero, I don't think that was the intent.
Colin
Powered by blists - more mailing lists