Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3563489pxb; Mon, 24 Jan 2022 12:18:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLl8H8cwN3/dT6w6B6TeM1ssKXPnbSKdo9CtAf5J/p4gA+hUm24vYSQwlySZcTTaIeH4J1 X-Received: by 2002:a17:902:a404:b0:148:bdd6:d752 with SMTP id p4-20020a170902a40400b00148bdd6d752mr16093616plq.20.1643055485532; Mon, 24 Jan 2022 12:18:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055485; cv=none; d=google.com; s=arc-20160816; b=bvklzWhc/kEry5c2LO3FrC1yXlb9oC5sqOOSnXR0Eji6UN4oC1rfrRFdbY4V+atVpn I+cLE2iIxobUkh7f+21EB9XwQtRCOgq4cyRLHSNDnpZauS0fC9WzuPO2zyFDHuD9dhfT 8nrg9o5NxRMwxfZMUktDihLAJoPx2hudEnYo77qd1kgX1HXsOKNb4fES4Bn8K6ag/Exd MpXu7/skX3qAZuiJqlcbQBM1lJkRhS4SSmc6eDQhXv3m41LANUWCW/owCgJXngUuCIvL fchmcXAKScYZUJKsrlOx08WA/i7Hpg20ZxzUgkmsLt6unN5JidGQaSVIAjTwEibcABjX eVWg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cMblXzwwYiPaH+6HTgIoqqSQjKX7k0WQBgm9M8mEPu0=; b=BDv4ER6kiXsK7W7seTe9qk3O8xDMHM50ZtgsnlMnJ+2tUPlUF5JTNYaNHyfMSH89/6 RKAVPuX8U80NvQjBnPaeWhN7GeamVAazcYLrfouBJlllZ031xPst8UoXGm+4bGfuK7Fg z9BwnZfx/3i97cznlds3W8ryN/Kz7Rc/SJ0JYrFlk4q8cb0m0A9xl1Xb0O2Cm9/gZthh 2wuoiAR0hC0bexYh2xV171SRKyYvtVFsFXBgNHIaOLkPrI40Hw9I4mA47D12qUHyOGN6 WHz9JLV8aF0LLKP1+AqE/pO3brizl6UwrOmVBG/K8OGbUPSMfGTkuhY9LQ82HIyfuDNv ebXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="lkjr/E1x"; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si247187pjf.126.2022.01.24.12.17.52; Mon, 24 Jan 2022 12:18:05 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b="lkjr/E1x"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343700AbiAXTV2 (ORCPT + 99 others); Mon, 24 Jan 2022 14:21:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344078AbiAXTNU (ORCPT ); Mon, 24 Jan 2022 14:13:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6E1C061753; Mon, 24 Jan 2022 11:05:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C9177B81233; Mon, 24 Jan 2022 19:05:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6A98C340E5; Mon, 24 Jan 2022 19:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051131; bh=eZnupatPIV3ci7NnZFNHGOgaYKGfQO9VVbfWgx6Ag74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkjr/E1xFcmc59pL3ZyOn2LLWyW+srCFC9filhR1eSyP4674JbU81pUGZaUsBBjgB RF78jmEAGm37JuWn3JjhHEZMb0AnR/FYb1T3x88gptR7P46w3imqJkPgDc0HJABGGu uim+b80aUGP/UmwJM+ip8l8GVQ7tC8LQWezMS4UU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kurt Van Dijck , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.14 064/186] can: softing: softing_startstop(): fix set but not used variable warning Date: Mon, 24 Jan 2022 19:42:19 +0100 Message-Id: <20220124183939.180928836@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Kleine-Budde [ Upstream commit 370d988cc529598ebaec6487d4f84c2115dc696b ] In the function softing_startstop() the variable error_reporting is assigned but not used. The code that uses this variable is commented out. Its stated that the functionality is not finally verified. To fix the warning: | drivers/net/can/softing/softing_fw.c:424:9: error: variable 'error_reporting' set but not used [-Werror,-Wunused-but-set-variable] remove the comment, activate the code, but add a "0 &&" to the if expression and rely on the optimizer rather than the preprocessor to remove the code. Link: https://lore.kernel.org/all/20220109103126.1872833-1-mkl@pengutronix.de Fixes: 03fd3cf5a179 ("can: add driver for Softing card") Cc: Kurt Van Dijck Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/softing/softing_fw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c index aac58ce6e371a..209eddeb822e5 100644 --- a/drivers/net/can/softing/softing_fw.c +++ b/drivers/net/can/softing/softing_fw.c @@ -576,18 +576,19 @@ int softing_startstop(struct net_device *dev, int up) if (ret < 0) goto failed; } - /* enable_error_frame */ - /* + + /* enable_error_frame + * * Error reporting is switched off at the moment since * the receiving of them is not yet 100% verified * This should be enabled sooner or later - * - if (error_reporting) { + */ + if (0 && error_reporting) { ret = softing_fct_cmd(card, 51, "enable_error_frame"); if (ret < 0) goto failed; } - */ + /* initialize interface */ iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 2]); iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 4]); -- 2.34.1