Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp581469pxb; Mon, 25 Oct 2021 14:15:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0iJZtngersBSnTpjfM0eQ1H6oNUWKNy0sYFHJMywjAiQH6CMhJy/07NBynpKCEwdUJhdX X-Received: by 2002:a17:902:f687:b0:140:4098:1e04 with SMTP id l7-20020a170902f68700b0014040981e04mr12648040plg.17.1635196507215; Mon, 25 Oct 2021 14:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635196507; cv=none; d=google.com; s=arc-20160816; b=a5BGO8xiGAorfzZ14alugJecx0zvmUhL89KAQsnp/wXViboqyT5AEOj/jNsKjZ09NJ x1Yk4WYAWJZQ7N4lPR10UgNcJc22HqU13w6wi2woj9oLT6GO8cKxUftj3IvxqrKQVyZG E4V2bD2WVUqZ70EjH5u6C2n3LC5SiIjSqU8JJ7UAYKxuBdLahuqiKYAF/LOZ/5P0rVgI csB26YU2lLDbSUb0RPAtlv2amdIvKBR+sz2jW1AXubkRFivkH3w6h5IjZsHZJ/i0o2QW MSYr7IFlV9gxac6sjvifAm/sZg68cn5U3Jo79xmepfBY+zMiOfHKLE36D54NL9GBXABA puBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RnAIJE+D2UXujTd5v+Z5AM/fPSy1MgLcm0H/yAq5tRg=; b=WTCkzHEQqz/aNlIxPUSO/W8224ZQYOn0GOZVaVB2R9ssni4Mhezu0pR84oBgKdlemx aiCssR/D3GZOI3OBMvZbMfgGw2kjUse65hu7mtpGQYozkfvLPb71zqn4c3u8xtEWOutf Z+pZAdqxxglHxyFFYRxXnPmPdO4SjS9m6zt+qaPzCZyBa0QYWAPi6Yj773plUessmxBE 50kCYOUuqF/1QFyGInCREIVR3nidVkHDa1gw8oFOppKrOyZ4/E+DwNGicE7xof8riF9E lH9co9SCZGTHBv8xCftaNk6FgRkdLv1WgjQUl/cIgGvU0nBjm8pbKRdw2DhHxvutFdcT 7m1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V11DS4Eh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si12668285plc.299.2021.10.25.14.14.53; Mon, 25 Oct 2021 14:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V11DS4Eh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233372AbhJYVPf (ORCPT + 99 others); Mon, 25 Oct 2021 17:15:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:43872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232947AbhJYVPc (ORCPT ); Mon, 25 Oct 2021 17:15:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9821D61076; Mon, 25 Oct 2021 21:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635196390; bh=c6x2a88MQiWLoeRudW1085kFp+7uZbDkUgE4fWXHX6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V11DS4EhoXg/IP836OngKffoHlWvCmfDiYB+ZyodhbececGE+474cAzIoM2YE1ZB8 QRymtDMVVMFaGmCFiaRfKII90IBhWZo1Uvk5Rq1ihjhVtHf/qXuiIP/jFMINQCFFmW S/hyRUg8H6Jq9Jis7Xf5TPCFHjjZA4ZYT6OB7Ax3uNfbK0n7yzGbrdGgBw82xmYkj8 7RRVJSVvVl3xARpU0PReLY9pdqSirIsz5vTdaihbG9hM+HBAzdXPg8bYloX715t8Tp +3FSNs9Fwu9VfXqNenD52Ir6pwtaMRdOLYLWbdvyYjO5ByeZA7JpT5ZdEIgb5OSzI+ SWPtMom0xD0iw== From: Nathan Chancellor To: =?UTF-8?q?=C5=81ukasz=20Stelmach?= , "David S. Miller" , Jakub Kicinski Cc: Nick Desaulniers , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH 2/2] net: ax88796c: Remove pointless check in ax88796c_open() Date: Mon, 25 Oct 2021 14:12:39 -0700 Message-Id: <20211025211238.178768-2-nathan@kernel.org> X-Mailer: git-send-email 2.33.1.637.gf443b226ca In-Reply-To: <20211025211238.178768-1-nathan@kernel.org> References: <20211025211238.178768-1-nathan@kernel.org> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: drivers/net/ethernet/asix/ax88796c_main.c:851:24: error: address of array 'ax_local->phydev->advertising' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (ax_local->phydev->advertising && ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ~~ advertising cannot be NULL here if ax_local is not NULL, which cannot happen due to the check in ax88796c_probe(). Remove the check. Link: https://github.com/ClangBuiltLinux/linux/issues/1492 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/asix/ax88796c_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c index cf0f96f93f3b..528a0c43540b 100644 --- a/drivers/net/ethernet/asix/ax88796c_main.c +++ b/drivers/net/ethernet/asix/ax88796c_main.c @@ -850,11 +850,10 @@ ax88796c_open(struct net_device *ndev) /* Setup flow-control configuration */ phy_support_asym_pause(ax_local->phydev); - if (ax_local->phydev->advertising && - (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, - ax_local->phydev->advertising) || - linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, - ax_local->phydev->advertising))) + if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, + ax_local->phydev->advertising) || + linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, + ax_local->phydev->advertising)) fc |= AX_FC_ANEG; fc |= linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, -- 2.33.1.637.gf443b226ca