From patchwork Mon Apr 8 14:48:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Zhivich X-Patchwork-Id: 1081107 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=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=akamai.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=akamai.com header.i=@akamai.com header.b="TmQMTDXi"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44dCy26Rgrz9sQy for ; Tue, 9 Apr 2019 00:50:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727361AbfDHOuB (ORCPT ); Mon, 8 Apr 2019 10:50:01 -0400 Received: from mx0a-00190b01.pphosted.com ([67.231.149.131]:60818 "EHLO mx0a-00190b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfDHOuB (ORCPT ); Mon, 8 Apr 2019 10:50:01 -0400 Received: from pps.filterd (m0050095.ppops.net [127.0.0.1]) by m0050095.ppops.net-00190b01. (8.16.0.27/8.16.0.27) with SMTP id x38EgFBA014482; Mon, 8 Apr 2019 15:49:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=jan2016.eng; bh=diRVjAb/rXeUDuYhaE2LdonFUcAMDo0RCKgn2EuR3rg=; b=TmQMTDXiWwoYswqSBoKHlpD0qidsCqfQhsD+9BOuiNPJmA/+7AAJpDBUEy6qHSMZsnqK AaWzL28tAVr3QbEItowcDtRDnrihu1YCEBbGDaRrzBQt3Lza5U5ieft7brjsPOgj1Nxh UtSHx9tudeTQfCh7dPPKGSoTljg+wqdq3bSUUYO+mstOmRXqOiqIDLlTKY7/khlh/ZVE UPuFXipiYucDWdFHQ/zM1mmxbbC/V+g5sjHdC23/nkW3sl5pIOKmWd+dIWpz21X8X9ZA sStke7HdnltTkg/xqSOe6N9KTeeavq1Gx6JX2P6ZJLCwzRhy2f0eiJva8+DCDpH3r6Kt Bw== Received: from prod-mail-ppoint3 (a96-6-114-86.deploy.static.akamaitechnologies.com [96.6.114.86] (may be forged)) by m0050095.ppops.net-00190b01. with ESMTP id 2rpkn3spyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Apr 2019 15:49:56 +0100 Received: from pps.filterd (prod-mail-ppoint3.akamai.com [127.0.0.1]) by prod-mail-ppoint3.akamai.com (8.16.0.27/8.16.0.27) with SMTP id x38El8vb020452; Mon, 8 Apr 2019 10:49:55 -0400 Received: from email.msg.corp.akamai.com ([172.27.123.30]) by prod-mail-ppoint3.akamai.com with ESMTP id 2rpqeyg47w-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 08 Apr 2019 10:49:53 -0400 Received: from usma1ex-cas5.msg.corp.akamai.com (172.27.123.53) by usma1ex-dag3mb1.msg.corp.akamai.com (172.27.123.60) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 8 Apr 2019 10:49:07 -0400 Received: from bos-lpii8.kendall.corp.akamai.com (172.29.171.145) by usma1ex-cas5.msg.corp.akamai.com (172.27.123.53) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Mon, 8 Apr 2019 07:49:02 -0700 Received: by bos-lpii8.kendall.corp.akamai.com (Postfix, from userid 42339) id 49E5E17FC0D; Mon, 8 Apr 2019 10:49:02 -0400 (EDT) From: Michael Zhivich To: CC: , , , , , , Michael Zhivich Subject: [PATCH v2 3/3] qlogic: qlcnic: fix use of SPEED_UNKNOWN ethtool constant Date: Mon, 8 Apr 2019 10:48:47 -0400 Message-ID: <1554734927-15522-4-git-send-email-mzhivich@akamai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554734927-15522-1-git-send-email-mzhivich@akamai.com> References: <1554734927-15522-1-git-send-email-mzhivich@akamai.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-08_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=807 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904080122 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-08_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=809 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904080122 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org qlcnic driver uses u16 to store SPEED_UKNOWN ethtool constant, which is defined as -1, resulting in value truncation and thus incorrect test results against SPEED_UNKNOWN. For example, the following test will print "False": u16 speed = SPEED_UNKNOWN; if (speed == SPEED_UNKNOWN) printf("True"); else printf("False"); Change storage of speed to use u32 to avoid this issue. Signed-off-by: Michael Zhivich Reviewed-by: Andrew Lunn --- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index 0c443ea..374a4d4 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h @@ -497,7 +497,7 @@ struct qlcnic_hardware_context { u16 board_type; u16 supported_type; - u16 link_speed; + u32 link_speed; u16 link_duplex; u16 link_autoneg; u16 module_type;