Message ID | 20230516202103.558301-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp681798vqo; Tue, 16 May 2023 13:25:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72zu8rDjy93/wvrYWkJhy/hxSOirKfq5XzZVBg8l72644mQPiTqDTzmL0ontwJVxvSuLs/ X-Received: by 2002:a17:903:2092:b0:1ac:8e0b:282c with SMTP id d18-20020a170903209200b001ac8e0b282cmr26352568plc.1.1684268749767; Tue, 16 May 2023 13:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684268749; cv=none; d=google.com; s=arc-20160816; b=AsPkCtJbCay3JUDmlulKLyy5aSTqUII1eI6qyLWMlFjPNjlRPJcTBRsWMVHOoi9s7f N4h3bGV4EPDwfgNwyWGBEqpV4s5MX0RneDxo4c6QZP4gNJ+2+GQ4ATG3EikIZOe2qo4Z Lf+TqxDKDo+JK35My8cpTI/WPxBbSXhEfpRz7/IAnsrlzLlREOUuo96gzf69GMWslzNg aQtARqngo7qxk4gvxoxdoF1kmU8o1BwRigeXwfMLfTGFb/7a2868NJYE9UuT+CSKXYKR 7Jljn7GG6vs6K0l1e0MNDsMNVvTIUyOjK3zPWyACFWP4fgcMlMWFObpd62xzO/8N7/D/ 686A== 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=R3+oFWoT1KiPodEeHLcgBDcIBYkH6rFBStqhbDk/G00=; b=dAZVktc7rHqpL7n2J6ANf4cJFF+ZW+Wr8NmcNF4sCO6E9K9lylNAS9glIqBw6xKH7A NyAwun9DlTJz/IRQ1R4xJZGhenWVkv3mpJNiTFo2oURrNxPsfN8ij8Qc/+DYsBfS5P+9 jv78gnYZxBNbjIZ5nSHH5lTh3uieF97mNuILDRU3Al4gq+wuwhmvx/tONWnEacAoVJei 6JodQObugC4uBx24jSTdUJdCtBxvKR1J3HDwUqKHGeA8nLxqx0H9TH/15PQFrbPfxTWC vVB9904rb84w+4YEtFD1J4Lw4Ilx3iwtmWyNZ5u2VsNZRz29gMZg4trpASFcP2qjc8zK a8Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Egdq1JDt; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5-20020a17090a898500b0024e13530c0dsi10326pjn.38.2023.05.16.13.25.33; Tue, 16 May 2023 13:25:49 -0700 (PDT) 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=Egdq1JDt; 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 S230223AbjEPUV3 (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Tue, 16 May 2023 16:21:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbjEPUV1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 16 May 2023 16:21:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97473171E; Tue, 16 May 2023 13:21:11 -0700 (PDT) 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 3433063630; Tue, 16 May 2023 20:21:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDB0DC433D2; Tue, 16 May 2023 20:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684268470; bh=n2VkfFrYD6ZvghT2rLwCZ8Tw+H30dUYKFB4kK3wrpLE=; h=From:To:Cc:Subject:Date:From; b=Egdq1JDtlfkHI3imIUtFlLPSk6qx9GFXiAbKi8sryfRJmytehbY4a0xOV+BSiGezZ W7FDaUt61DKvSnIxjkpekm3I7kXTtkRUSUyWyvRFUPxCUjhJRRL+ndvJHaNzauFR20 I1PtN8K8k3bCQpJXuuRO7zyvmJIlFOUKBQlTSQuV8QLdh93ytSkE6wiK3YPGRcdAYN vYKYNI/ZQtR4I8Qc+lMgpGH7OTJ4P3Ijxp7k5VtGbvhNZ3dHLTEt6BPnCnWGkToffn dALxDGPc1Z7AIbxlHmmj9bRV7Ds025ncajsLb0fRcUudjoTy0gKm1sH/PqKZV/idWs RbN1e/+fxQvvQ== From: Arnd Bergmann <arnd@kernel.org> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Alan Stern <stern@rowland.harvard.edu> Cc: Arnd Bergmann <arnd@arndb.de>, Sebastian Reichel <sebastian.reichel@collabora.com>, Andrew Morton <akpm@linux-foundation.org>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: hide unused usbfs_notify_suspend/resume functions Date: Tue, 16 May 2023 22:17:42 +0200 Message-Id: <20230516202103.558301-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 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,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766083788361893791?= X-GMAIL-MSGID: =?utf-8?q?1766083788361893791?= |
Series |
usb: hide unused usbfs_notify_suspend/resume functions
|
|
Commit Message
Arnd Bergmann
May 16, 2023, 8:17 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The declaration is in an #ifdef, which causes warnings when building with 'make W=1' and without CONFIG_PM: drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume' Use the same #ifdef check around the function definitions to avoid the warnings and slightly shrink the USB core. Fixes: 7794f486ed0b ("usbfs: Add ioctls for runtime power management") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/usb/core/devio.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
Hi, On Tue, May 16, 2023 at 10:17:42PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The declaration is in an #ifdef, which causes warnings when building > with 'make W=1' and without CONFIG_PM: > > drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' > drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume' > > Use the same #ifdef check around the function definitions to avoid > the warnings and slightly shrink the USB core. > > Fixes: 7794f486ed0b ("usbfs: Add ioctls for runtime power management") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- I have no clue why I'm CC'd, but patch LGTM: Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> -- Sebastian > drivers/usb/core/devio.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c > index e501a03d6c70..1622ad35428d 100644 > --- a/drivers/usb/core/devio.c > +++ b/drivers/usb/core/devio.c > @@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf) > return 0; > } > > +#ifdef CONFIG_PM > /* The following routines apply to the entire device, not interfaces */ > void usbfs_notify_suspend(struct usb_device *udev) > { > @@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev) > } > mutex_unlock(&usbfs_mutex); > } > +#endif > > struct usb_driver usbfs_driver = { > .name = "usbfs", > -- > 2.39.2 >
On Tue, May 16, 2023 at 10:17:42PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The declaration is in an #ifdef, which causes warnings when building > with 'make W=1' and without CONFIG_PM: > > drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' > drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume' > > Use the same #ifdef check around the function definitions to avoid > the warnings and slightly shrink the USB core. > > Fixes: 7794f486ed0b ("usbfs: Add ioctls for runtime power management") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- Acked-by: Alan Stern <stern@rowland.harvard.edu> > drivers/usb/core/devio.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c > index e501a03d6c70..1622ad35428d 100644 > --- a/drivers/usb/core/devio.c > +++ b/drivers/usb/core/devio.c > @@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf) > return 0; > } > > +#ifdef CONFIG_PM > /* The following routines apply to the entire device, not interfaces */ > void usbfs_notify_suspend(struct usb_device *udev) > { > @@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev) > } > mutex_unlock(&usbfs_mutex); > } > +#endif > > struct usb_driver usbfs_driver = { > .name = "usbfs", > -- > 2.39.2 >
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index e501a03d6c70..1622ad35428d 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf) return 0; } +#ifdef CONFIG_PM /* The following routines apply to the entire device, not interfaces */ void usbfs_notify_suspend(struct usb_device *udev) { @@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev) } mutex_unlock(&usbfs_mutex); } +#endif struct usb_driver usbfs_driver = { .name = "usbfs",