From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D8F3C79F80 for ; Fri, 4 Sep 2026 16:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fTWd52yFP65YxYGX1jhsbarPqnM67tVSqN38zDBl1Vg=; b=JP+iEfN4anGMi3MeSBFxIEmpW5 VMqLlzb8lXEJiayOUAC+Hi0IZ7PwJIrtbFIeJSg4Aw1h060zZBfiMphAtK2f5VeNW+lvrG3bP4VkQ tskzatXrcMqhQf7l23mNTtdrL6R8J0aQZ5goJH03Sabc2eYypwt4U1X7bFgQGWcJsH7J4vJhEvQvg KiTRswIGVo0I1n9vENyp1t25wfjAQ5mQ0jbharXXB2mP0dhDgaVJe49ZYH8j66uek5xeSrsVygXU7 Qwd0j5eHYl8U/muW+NYJh7pck/BMHw0GIOEjBAe/sGZBMiLzm+YV1cucBnlvq70AFr7GQ26eNkEpE d7aKSDRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x2X4a-00000002lrk-49kf; Fri, 04 Sep 2026 16:47:28 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x2X4Z-00000002lpw-17Tj; Fri, 04 Sep 2026 16:47:27 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 270504049E; Fri, 4 Sep 2026 16:47:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0FCB1F00A3D; Fri, 4 Sep 2026 16:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788540446; bh=fTWd52yFP65YxYGX1jhsbarPqnM67tVSqN38zDBl1Vg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ElI1ve5Nd6BtihDq8JaFfsbnYd4kSDgma7wyhIvYWOE8sajceMkHCCY/FR8jt1IcN z4QP+OlpDxeCsq+Tajo5otPR1LuICxOv2ztASH57u8nNUyHjf5mmoFCPrh7DfDDN/f VxGANRriNDW+vUGOX+EA1x5CuCswzULJxRW730rg= Date: Fri, 4 Sep 2026 18:44:34 +0200 From: Greg Kroah-Hartman To: Chen-Yu Tsai Cc: Bartosz Golaszewski , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , "Rafael J. Wysocki" , Danilo Krummrich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Wei Deng , Konrad Dybcio , linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Alan Stern , Bartosz Golaszewski Subject: Re: [PATCH v8 07/16] usb: core: Move struct usb_port and related APIs to port.h Message-ID: <2026090430-botanist-ungodly-0299@gregkh> References: <20260904084158.1341550-1-wenst@chromium.org> <20260904084158.1341550-8-wenst@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260904084158.1341550-8-wenst@chromium.org> X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Fri, Sep 04, 2026 at 04:41:46PM +0800, Chen-Yu Tsai wrote: > |struct usb_port| and its matching container_of() macro should live in > its own port.h, matching the split we have for .c files. Why? > Move them as described. Also move usb_port_is_power_on(), since in the > next change its |struct usb_hub *| parameter will be changed to > |struct usb_port *|, and becomes a non-static function that only > references |struct usb_port|. No, please don't do that unless you have a really good reason. > > port.h is only included from hub.h, as a subsequent patch will directly > use fields from |struct usb_port| in a static inline helper in hub.h. > The USB internal headers don't have header guards to help with this. > > Also drop 'extern' from the header declaration of usb_port_is_power_on(). > This is not needed in modern C. > > Suggested-by: Andy Shevchenko > Reviewed-by: Bartosz Golaszewski > Reviewed-by: Andy Shevchenko > Signed-off-by: Chen-Yu Tsai > --- > Changes since v4: > - Dropped 'extern' (Andy) > > Changes since v3: > - New patch (Andy) > --- > drivers/usb/core/hub.c | 16 ---------- > drivers/usb/core/hub.h | 48 ++--------------------------- > drivers/usb/core/port.c | 16 ++++++++++ > drivers/usb/core/port.h | 68 +++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 86 insertions(+), 62 deletions(-) > create mode 100644 drivers/usb/core/port.h hub.h is small enough, making a single .h file that is 68 lines long for no real good reason isn't a good idea. Odds are this will make the build take longer as you now need to open/read/close another file. And if we really want to do this, it shouldn't be burried in the middle of a long "enable this platform" series where people will miss it. Thanks to Alan's review for making me notice it. thanks, greg k-h