From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 288AEC4360F for ; Thu, 14 Mar 2019 18:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 097DF217F5 for ; Thu, 14 Mar 2019 18:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727123AbfCNSpP (ORCPT ); Thu, 14 Mar 2019 14:45:15 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:55780 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfCNSpP (ORCPT ); Thu, 14 Mar 2019 14:45:15 -0400 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1h4VLs-0004G1-6p; Thu, 14 Mar 2019 14:45:12 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id x2EIhYnW024219; Thu, 14 Mar 2019 14:43:34 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id x2EIhY2h024218; Thu, 14 Mar 2019 14:43:34 -0400 Date: Thu, 14 Mar 2019 14:43:34 -0400 From: "John W. Linville" To: Michal Kubecek Cc: netdev@vger.kernel.org, Vidya Sagar Ravipati Subject: Re: [PATCH ethtool] ethtool: qsfp: fix special value comparison Message-ID: <20190314184333.GF31709@tuxdriver.com> References: <20190314183316.97259E0090@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190314183316.97259E0090@unicorn.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Mar 14, 2019 at 07:33:16PM +0100, Michal Kubecek wrote: > One of the warnings gcc issues when building ethtool with -Wall seems to > point to an actual problem: > > qsfp.c: In function 'sff8636_show_dom': > qsfp.c:709:57: warning: comparison is always false due to limited range of data type [-Wtype-limits] > if ((sd.sfp_temp[MCURR] == 0x0) || (sd.sfp_temp[MCURR] == 0xFFFF)) > ^~ > > Rather than writing the special value as -1 which would be a bit confusing, > cast 0xFFFF to __s16. > > Fixes: a5e73bb05ee4 ("ethtool:QSFP Plus/QSFP28 Diagnostics Information Support") > Signed-off-by: Michal Kubecek LGTM -- queued for next release. Thanks, John -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready.