From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796460109; b=wckx9sq4i6fcZYpuGoFQpr8I7uGa9erjw4HMU7oHe7XfqWOIokPRSYepT/PBFGNnCAKd taoTcIK0kcTt7O0bmohzJkYqZp7Wm4a8mc8PjBJnIri/uvonqXZPWvcAOvKzczoJC/cJf VX5nTrYcDAkr193mGfS2rZl8xLAKLYkFASP7XBabHwlKf7MaxhIE5PP1f6Lhiby5KV2EH IVDc3wnpHIdVTwVotjEXUjDLzbHpty/wxA8kv8CAWsmvg3+bW2cTSEGj9vH6vHTC4nXHO j9h9K6qOgU46Va4Aj+wxnyx19l6k0QA6inKcRx4RCMdl/0mATr+iwgz9x6R/Ovgod+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796460109; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Gf4/azMyMZivTN1x22/P+t3jRGFCtAifNbNc9oll7tY=; b=FNarW6FGWHQBGGCnTQvS4qztgJV2f3SjVB+8b5ZsIvoUQPWmh6+39MXIPoRP4DcwBIrq RC1MzNJovTK1CGdosQOBdXVqgmEEyH9Ue4DYAqz4XRojE6NbYeei3xIVII/aaadvVExOi 3KtzTM5IuT4MV09dW9BSV9gGOZZei7zyXPgy6Q4S8BMQbrhSSxr8cZ2XM5hJBqwEIdWG3 krAY22YigM1QcBn3bMedsiPk4Y5m4LgWQLW8Xof9koPWF7pgOtP4JdIRUWIrR8bFH6muD rGFCs0rG89uJbamqccXmrBASrqZi2WO+zHMHPBL8+ss97rrvVM7DCTFl0skLsBUVj2g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=U5aEfEMY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46AFE606A322 for ; Sat, 5 Dec 2026 08:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=U5aEfEMY Received: by smtp.kernel.org (Postfix) with ESMTPSA id C029C1F0092B; Sat, 5 Dec 2026 08:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796460108; bh=Gf4/azMyMZivTN1x22/P+t3jRGFCtAifNbNc9oll7tY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=U5aEfEMYQd+v9XU7OWXse8HlnM3YFZfc/i4VKDe74v9RADwVubGhyrdcAFUIHul5q yso0H0mzmcbaG1gmDehwTGoXf6RDPXDIwSaQByKZnq0MN10FwqF6BMH0LcrKFjpNS0 V96eADU4x72pdYE79a4vztBA195H1mXQfD/JOnFajD99MOFVzK97W2erVReakE8ySY tOJAq754skV0yGX6FVVJYg05GNZ5PGW7qEj5pCnUK8RD6ob+HmekT9xD6Zc/AWfw2/ Gc1as+ezHi32zpinGKKt3FRMTqLeya82ZQHDYu76moNJqCmHkB95gmzoNU3WmNblYQ 7Nk4Muxxy4lpA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 04/14] thunderbolt: Encapsulate router device type checks in switch.c Reply-To: sashiko-reviews@lists.linux.dev To: "Chunfeng Yun" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261205083342.4009278-5-chunfeng.yun@mediatek.com> References: <20261205083342.4009278-1-chunfeng.yun@mediatek.com> <20261205083342.4009278-5-chunfeng.yun@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 08:41:48 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] thunderbolt: tb_is_switch() and tb_switch_type remain exposed in tb.h -- commit 8daee24827ddbf3d888482160f876b8924b99c84 Author: Chunfeng Yun thunderbolt: Encapsulate router device type checks in switch.c This commit moves tb_to_switch() out-of-line into switch.c and replaces icl_nhi_is_device_connected() in pci.c with a new tb_switch_has_children() helper in switch.c. > diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h > index 8ed373e94b652..5a5ba688ef32f 100644 > --- a/drivers/thunderbolt/tb.h > +++ b/drivers/thunderbolt/tb.h [ ... ] > @@ -897,13 +899,6 @@ static inline bool tb_is_switch(const struct device = *dev) > return dev->type =3D=3D &tb_switch_type; > } > =20 > -static inline struct tb_switch *tb_to_switch(const struct device *dev) > -{ > - if (tb_is_switch(dev)) > - return container_of(dev, struct tb_switch, dev); > - return NULL; > -} [Severity: Low] Should tb_is_switch() and tb_switch_type also be encapsulated in switch.c? The commit message states that router type inspection is encapsulated entirely within switch.c, yet tb_is_switch() remains inline here and tb_switch_type stays extern in tb.h and non-static in switch.c. Any future tb_is_switch() caller in a separate module including tb.h would hit a modpost undefined symbol error for tb_switch_type. Comparing dev->type =3D=3D &tb_switch_type directly in tb_to_switch() and moving tb_is_switch() to switch.c (or calling tb_to_switch() from it) would allow making tb_switch_type static and removing it from tb.h. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205083342.4009= 278-1-chunfeng.yun@mediatek.com?part=3D4