Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3552988pxb; Mon, 24 Jan 2022 12:04:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1DC5Zm1u/5hfL4fn0Bw/zPqFLX9/Fay1A7xpxYuej9V6Rncn4RgyFsWgmhJHl7yE0PpfC X-Received: by 2002:a05:6a00:13a8:b0:4ca:25ee:d633 with SMTP id t40-20020a056a0013a800b004ca25eed633mr2726179pfg.23.1643054666539; Mon, 24 Jan 2022 12:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054666; cv=none; d=google.com; s=arc-20160816; b=HR/eUUultuhzTfw6XpbMljUFPO/wKOkDTyPDTwvnKxxXhpXhazHkalCwT4ImZdVVdq C25MWAqy1ZsDDxZbfkgRbQ4kDK4aX6Z+8ZKJT3edLMGhh8sZV4uM4LD31t5K0Fejz0ug neQPJ4AF9ouc7W1rke4+GaywCl1TF3QIVhDtvUn4dFLNj2uoBFFvMJkKaZgPdXIcYHVr nqJjBALq46FPOoPjtKLXR0+mdpQtSi0phwpQEwurUbWiKGh4mu6yxGInqI/eYJNPjLaj Ly9aPVYpinrBPsMN6/Pis9wRqzula4egCxqxie16lF8JkhuD9HrUnJVfyXyIL9jC24MT CtzA== 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=cxaYr6LWwdFhwZUOirlDTlz5QbEtS8Z2M3dNJS/TP+C/HEFaVFT4S/kjUw7R/UNEeL Ps0v7QOcIVPZOoD61pb8EG33AdqT0fmaljuvTeaK/lYO6hKjOHDgTgQiById+L/3HEhp EnSA4H0bPVsZoHph8FFxr0cu4nChKZTZPT+p4wqrhtd1GWwfevMZtT5l0YrEWcasyuuc l3YB9OYh3cDGFuUjywFMQ10E5/gbjBWxo0FGAei9H97zDcV24zS/QoeH3cbeuaYUK/Ba CVLk2GH4S16TtK7RgRFgr9A8gRYYxzfbe8ms8iE4nBZly4nYL4tIh8C6sG1hobF07WHA 4pYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a4EoOBrv; 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 n193si11822157pfd.121.2022.01.24.12.04.14; Mon, 24 Jan 2022 12:04:26 -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=a4EoOBrv; 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 S243099AbiAXTEQ (ORCPT + 99 others); Mon, 24 Jan 2022 14:04:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345215AbiAXS74 (ORCPT ); Mon, 24 Jan 2022 13:59:56 -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 9892EC0619C9; Mon, 24 Jan 2022 10:56:35 -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 6097EB81235; Mon, 24 Jan 2022 18:56:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77125C340E5; Mon, 24 Jan 2022 18:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050593; bh=3hDW7gIhEOondEF4Jh+0/sHITCd+cZaNzno8dlPJPuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a4EoOBrvqpSR4wmb492altdE034+NALGsrJOwGz6dtDhog0lFOtal7baH9ZDG3l5D kdtZ+7E0qrNuBiO+H0JJ9ivlGE9pGdb0vBkcn/k0SFmXbaYTGbVN5GHiGI9REiwrSL gmZZ9GvX4Hfo317adxJPfsDXbJP3IsbxpbkXuR+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.9 052/157] can: softing: softing_startstop(): fix set but not used variable warning Date: Mon, 24 Jan 2022 19:42:22 +0100 Message-Id: <20220124183934.438803830@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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