From patchwork Fri Oct 2 16:54:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1375948 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4C2x136dDQz9sSn for ; Sat, 3 Oct 2020 02:54:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387602AbgJBQy3 (ORCPT ); Fri, 2 Oct 2020 12:54:29 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56379 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbgJBQy3 (ORCPT ); Fri, 2 Oct 2020 12:54:29 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kOOK6-0000so-UM; Fri, 02 Oct 2020 16:54:23 +0000 From: Colin King To: Andrew Lunn , Heiner Kallweit , "David S . Miller" , Jakub Kicinski , Dan Murphy , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] net: phy: dp83869: fix unsigned comparisons against less than zero values Date: Fri, 2 Oct 2020 17:54:22 +0100 Message-Id: <20201002165422.94328-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Colin Ian King Currently the comparisons of u16 integers value and sopass_val with less than zero for error checking is always false because the values are unsigned. Fix this by making these variables int. This does not affect the shift and mask operations performed on these variables Addresses-Coverity: ("Unsigned compared against zero") Fixes: 49fc23018ec6 ("net: phy: dp83869: support Wake on LAN") Signed-off-by: Colin Ian King Acked-by: Dan Murphy --- drivers/net/phy/dp83869.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c index 0aee5f645b71..cf6dec7b7d8e 100644 --- a/drivers/net/phy/dp83869.c +++ b/drivers/net/phy/dp83869.c @@ -305,7 +305,7 @@ static int dp83869_set_wol(struct phy_device *phydev, static void dp83869_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) { - u16 value, sopass_val; + int value, sopass_val; wol->supported = (WAKE_UCAST | WAKE_BCAST | WAKE_MAGIC | WAKE_MAGICSECURE);