Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3547186pxb; Mon, 24 Jan 2022 11:56:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz91GpTiC77eLXsPtWdmKoOrQEyqYnxNq3CB7HnFSVwQE6Z4LnVyDO+3go7pPutsTtfTyAW X-Received: by 2002:a17:903:285:b0:14a:93d5:3a7c with SMTP id j5-20020a170903028500b0014a93d53a7cmr15896131plr.42.1643054211648; Mon, 24 Jan 2022 11:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054211; cv=none; d=google.com; s=arc-20160816; b=SguYkQBrQUJOMjHjPW9Onpurszj7N9ZkFTFiMhdfy1m7hmSv9+Nqyir1gUXNGbnq23 PphaFY4DVb699lMv/if6E2tj2/lhvaiZk7okpMtdLwHSHcibq1vT7falh9ZAf3Oug7Kf itUq55xxxTNhPzzAjbpvPHSFOwdDTGnGmNI1Y07dcbX5BkxaHkQ7Lw9EtL8YSpkGs6PC 62IQA8DdLR1Zadp6HXmfojwWFWhb/ZdvB0tSnOnmihTtBMy4E2LWgEe9x+pyn5JnNX4E bX1NGPOZ3p80yRoBXB2FOqbeuOhX03byqn0fWqQx80AkUD9kfvwMOdwdSaAjO2cq7n0l LwNQ== 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=zWFv2oP1ElkVMC/YcnDIntMB5PRrqysKjhemgtp0Fzc=; b=LHnJ+y13kt2FQN7yXDU8vkJTU0KWE/fWKtZ6Pmytp+tGRdfpLlXEyo3E+m312MP/aU YA9txIUFBeWKnA4HtLwnVY9zbXvlxm1hk5QOttQ9i3RgWO4zzoCuKFPam4lwUBAvdH1H kme6/K/AXAKUMGP/wka4lEFdVN6ntmQIlnEvZ+iEu/N7dZa+aAn6sQT3prl7/8CjiFxK I2z7Td127SQkvmBQ2dLfn3TpLzomIlgPqIiVGzdyPL3Sy8/HSbAlP4kAFXAZu2vaSkta V+7AmtEF50D0DjZcgh7syjY5SABbi50vC4xgxu/hKua33MrFzqHZEvJLCDEuFZWwvaHt vzkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=miz8Vm8B; 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 j63si8631529pgd.54.2022.01.24.11.56.39; Mon, 24 Jan 2022 11:56:51 -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=miz8Vm8B; 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 S232329AbiAXSub (ORCPT + 99 others); Mon, 24 Jan 2022 13:50:31 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48460 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241963AbiAXStv (ORCPT ); Mon, 24 Jan 2022 13:49:51 -0500 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 dfw.source.kernel.org (Postfix) with ESMTPS id 75EFC614ED; Mon, 24 Jan 2022 18:49:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4635BC340E5; Mon, 24 Jan 2022 18:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050189; bh=3hDW7gIhEOondEF4Jh+0/sHITCd+cZaNzno8dlPJPuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=miz8Vm8BOybyr3b8UPwu5ebijGp4PIZU37ESmgT+qMDG66t5rR1HUc20su7jkYq8P +OHuytL60VIYXKS2htojHyXhoorI0cM/iqn0+CDnEqcRZxnuBHNoFIp2TDCtrKgGE3 Kywj0g6snL7b7tP+yXRGttGIP+i+aANg/hOki5/w= 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.4 038/114] can: softing: softing_startstop(): fix set but not used variable warning Date: Mon, 24 Jan 2022 19:42:13 +0100 Message-Id: <20220124183928.288083321@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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 52fe50725d749..a74c779feb90e 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