Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6228950rwb; Wed, 18 Jan 2023 02:47:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXtEQf4fhORTvADJfXeTRS/4x+os6jgAjB8otvoW1N/ifZCLT+FQ33nhgrr8UtSJFqQtkwxO X-Received: by 2002:a17:906:3fc3:b0:84d:4e9d:864a with SMTP id k3-20020a1709063fc300b0084d4e9d864amr6236827ejj.74.1674038878680; Wed, 18 Jan 2023 02:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674038878; cv=none; d=google.com; s=arc-20160816; b=C3VfkfTK3WLKnTs1kLHYpyvoC2zzE0v71LIByErB8crKPZefdlypF4ngWu8vw7r3aE /XIm2YWUH3tZN+xvCY2TlcHtzdfyO0UqBXVKgYqkreNlyDhoqWyeBRAgjJCUCPswbtaJ oKjycOFIOsiRkVG8okCEtI3Lu+Qi7RMY5bB67UxGV5Roj9R0A3XPnShItrIz3ce3Nn1V JlQrw4UQqYCu5NHJsGeVoB9YsQQzODZtGVduKVgfq4zV7YJ95p6QmaR8pyXqjq8HblhJ 3iwGd+25SsAIZvodDWQM09LEp20liuPzY1xNmSGbhCP5c8LjW2mfzat2iv4mw6RcD+C4 gdAQ== 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=P2xiHON1wZ0y7qwX8UXOb7SvN8DX2syFjyUolQsCP3I=; b=BkrGxyDBmxu0KEQf+xPXxWg4w/G7u5ZtqoZdfc4pSPQnyMQlHqJLis1PXmgPWIidls l/dvSzXyAc0Iu5hhk0gb14IRVbGAInCXY/rIHBtFl9vEb5LCcbleZ8iDiompoH9ZHEFO OAuj9uYRmg/e7OqBuih4WE2EgP+2QiF6Hoov53xZiyApdRuzZwycjpg8Kqqfih7Oll2I V4NemPjcC7jKsoeVZvm8nOOna12W969Bs85WYzi+sDSo2YJk6QK0fKJ4JBiEmQykw8aV gWBlnLZwXttRvUcYHQAhyUYFu5DKPvn20vQsKq/OQVVmEYZGWyRyUZcVhqYto32NuZj0 +Qiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7aUlMB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe1-20020a170907318100b0084d3360e59csi34043192ejb.601.2023.01.18.02.47.47; Wed, 18 Jan 2023 02:47:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7aUlMB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230079AbjARJIS (ORCPT + 46 others); Wed, 18 Jan 2023 04:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbjARJHO (ORCPT ); Wed, 18 Jan 2023 04:07:14 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5171E46165; Wed, 18 Jan 2023 00:27:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1F12C6170A; Wed, 18 Jan 2023 08:27:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 051CAC433F2; Wed, 18 Jan 2023 08:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674030471; bh=WbTFsa9uUp/GVGY/40OGOerWX8P64wmwxJdpH4/nltI=; h=From:To:Cc:Subject:Date:From; b=V7aUlMB1fk/MekJXOCCs0PVc7h7kscdLWolw8c0WI1wa+OsKN/p6yxqVXnzGJ8JHS Uoycpu4Jp3BQQEZKAaEgSK/Q6UY+ktGlvOuFG/Szp1NpTdSQsyX7UCo4e7qfon2KGu 78vDDd0SXYGxCealFCqVG/uKwJf0pL+FpTSO1tqZQ4m6X3UdHE68ub0TuHWg1/BhIe JLdfMCz5kuK9g70CWen7N6kMbwi0mH4D8+U2nH8hvx/MLye9I3kqaBjCd/zAjR1X2i 7lePDAf9uc90kD3v246r28DG1lKoxbDLWXL4366Xlgwya8yB2y3jL9aiJC1xKsT+GU YvfU7u9dsED8A== From: Arnd Bergmann To: Alan Stern , Greg Kroah-Hartman , Kevin Hilman , Arnd Bergmann , Tony Lindgren Cc: Felipe Balbi , Ard Biesheuvel , Janusz Krzysztofik , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: ohci-omap: avoid unused-variable warning Date: Wed, 18 Jan 2023 09:27:34 +0100 Message-Id: <20230118082746.391542-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The dead code removal has led to 'need_transceiver' not being used at all when OTG support is disabled: drivers/usb/host/ohci-omap.c: In function 'ohci_omap_reset': drivers/usb/host/ohci-omap.c:99:33: error: unused variable 'need_transceiver' [-Werror=unused-variable] 99 | int need_transceiver = (config->otg != 0); Change the #ifdef check into an IS_ENABLED() check to make the code more readable and let the compiler see where it is used. Fixes: 8825acd7cc8a ("ARM: omap1: remove dead code") Signed-off-by: Arnd Bergmann --- The patch that caused the issue is in the boardfile-removal branch of the soc tree. I would just add the patch there. --- drivers/usb/host/ohci-omap.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 3d57b9454a27..78088cd46908 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -67,8 +67,6 @@ static void omap_ohci_clock_power(struct ohci_omap_priv *priv, int on) } } -#ifdef CONFIG_USB_OTG - static void start_hnp(struct ohci_hcd *ohci) { struct usb_hcd *hcd = ohci_to_hcd(ohci); @@ -87,8 +85,6 @@ static void start_hnp(struct ohci_hcd *ohci) local_irq_restore(flags); } -#endif - /*-------------------------------------------------------------------------*/ static int ohci_omap_reset(struct usb_hcd *hcd) @@ -111,8 +107,7 @@ static int ohci_omap_reset(struct usb_hcd *hcd) if (config->ocpi_enable) config->ocpi_enable(); -#ifdef CONFIG_USB_OTG - if (need_transceiver) { + if (IS_ENABLED(CONFIG_USB_OTG) && need_transceiver) { hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2); if (!IS_ERR_OR_NULL(hcd->usb_phy)) { int status = otg_set_host(hcd->usb_phy->otg, @@ -129,7 +124,6 @@ static int ohci_omap_reset(struct usb_hcd *hcd) hcd->skip_phy_initialization = 1; ohci->start_hnp = start_hnp; } -#endif omap_ohci_clock_power(priv, 1); -- 2.39.0