Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp426450pxj; Thu, 3 Jun 2021 10:00:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAV6dCMIJZnXd2Emi8bjozhq4sWtUAN6SoBttm/Pv0CZho8x8xnsEsksvld9A70JZnwl+m X-Received: by 2002:a17:906:1fc4:: with SMTP id e4mr331509ejt.336.1622739656191; Thu, 03 Jun 2021 10:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622739656; cv=none; d=google.com; s=arc-20160816; b=uh24/ytyv5dPBe6WupZj/noIPTF7e/6DRp1dXD0m/boiXSXjgz1BzJ5/L0g8DzTEYP 6Stvf7/39c7304F1r4kBFztdE5Setn+yEF+3Hx18v3r9MoHYFITlAiUsouF0qyo58OIb MMC8B5DFQ7/920TJd1rclimBXErEe2a46Sa8ihr9+r839rymrAlyLeVWE3q615n8se2L +5sz83oeUabavRvvJAZghHVXgYt/sRrMma99G36edKcOEYJ3NOlh9QTj94CR3JnYexb7 oTkE4EEQUxwqOquMKCGNn+8/NWWKj4nunZbVUYEVi8a8byj4lP+Q7JQzsUc/Nva/wZwI jKbg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=68OGOqCVta7u2JgklG0rkKIqSrW+EMioWHiggHWxag8=; b=MCGAIkLaT1ru09S9cpx3l2wktFsV97PzGRGkad8r3CbUuWaZXEO3ngy0tvdS8iAD1p vDM8LrluG+khUSHRkFlfV725RU4ZAVG+CZT0O/vroKvk4JrpPO8CiTp4TWj4fUgNq12u 0EPoTmGhoFIRiukwhIQudKaleFexI5wp+tOUr5zxm5qYJ4wfhXhrUjEuDdv/8W3lPs/s ApxDwnLUkRwnNYEOq1PRcvqQ7RTk1ttfbQiFe1YfLqAVlsU27Gsqv3Gt4wZmFQLcMBSU rPEbxKGbZNefWMy/JBmHZ1+fh4QcB2WfkUnTszddYJhM4BXRpwQRhwAONtxiu+pFx1eV RAOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fV5pSS4u; 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 v7si3106872edj.541.2021.06.03.10.00.31; Thu, 03 Jun 2021 10:00:56 -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=fV5pSS4u; 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 S230097AbhFCRBS (ORCPT + 99 others); Thu, 3 Jun 2021 13:01:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbhFCRBR (ORCPT ); Thu, 3 Jun 2021 13:01:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 44AA461159; Thu, 3 Jun 2021 16:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622739572; bh=2bpSvYxrY6Qyoz1hWqDvV4VCCHIO33THExEDG03/W3k=; h=From:To:Cc:Subject:Date:From; b=fV5pSS4urHEafoFoZwLNHvHg9OTCMFs+Cm+gxmYqs6XZWm/xmfgGGs1ag3mSztZ3P TvktoNobawWbgUuzATf6FieJXcv2EuX4oKDwWu7v2pgYcZlOGIqbRYZUiK+lsH7vWz PR3WxR2cC3ouzxOw+Lcq6vBX/YAugHrPYYRGWI1ujxozzINwBfTOkmrxbS2mQ4RqUa awPbtlmFY4KgeHm8eIG5vxFVe8tyj2519mLC8W8kmPh929q3f/+EN2cXUgwDjoSHA3 /m0tBjx6/bomrbi3XoaUvdWAd4fX4iierZo4Tz3GLPGmlgedx1sbFC4W2tonVD+9IJ JpSaA9LtWe12w== From: Nathan Chancellor To: "David S. Miller" , Jakub Kicinski Cc: Andrew Lunn , Nick Desaulniers , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH net-next] net: ks8851: Make ks8851_read_selftest() return void Date: Thu, 3 Jun 2021 09:56:13 -0700 Message-Id: <20210603165612.2088040-1-nathan@kernel.org> X-Mailer: git-send-email 2.32.0.rc0 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 points out that ret in ks8851_read_selftest() is set but unused: drivers/net/ethernet/micrel/ks8851_common.c:1028:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret = 0; ^ 1 warning generated. The return code of this function has never been checked so just remove ret and make the function return void. Fixes: 3ba81f3ece3c ("net: Micrel KS8851 SPI network driver") Suggested-by: Andrew Lunn Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/micrel/ks8851_common.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c index 13eef6e9bd2d..831518466de2 100644 --- a/drivers/net/ethernet/micrel/ks8851_common.c +++ b/drivers/net/ethernet/micrel/ks8851_common.c @@ -1022,30 +1022,23 @@ static int ks8851_mdio_write(struct mii_bus *bus, int phy_id, int reg, u16 val) * * Read and check the TX/RX memory selftest information. */ -static int ks8851_read_selftest(struct ks8851_net *ks) +static void ks8851_read_selftest(struct ks8851_net *ks) { unsigned both_done = MBIR_TXMBF | MBIR_RXMBF; - int ret = 0; unsigned rd; rd = ks8851_rdreg16(ks, KS_MBIR); if ((rd & both_done) != both_done) { netdev_warn(ks->netdev, "Memory selftest not finished\n"); - return 0; + return; } - if (rd & MBIR_TXMBFA) { + if (rd & MBIR_TXMBFA) netdev_err(ks->netdev, "TX memory selftest fail\n"); - ret |= 1; - } - if (rd & MBIR_RXMBFA) { + if (rd & MBIR_RXMBFA) netdev_err(ks->netdev, "RX memory selftest fail\n"); - ret |= 2; - } - - return 0; } /* driver bus management functions */ base-commit: 270d47dc1fc4756a0158778084a236bc83c156d2 -- 2.32.0.rc0