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=1796254008; b=PjSaNcPIsCGQcW/11qO0IUP0+bpQa/DqzLKxvqMcLiuRKy4iAu0qzvGbo/JSw5ynsMpB UIa/lC7H98gqIMNijxZAu0kGZDO/MJwXyxFeN1eUqD7W5/QP/ehMjfejdjOB3UxgvbDF6 LsC0aWlCHUBxxw+XkA49kTscPFfdryjisQZYZBUw9dwjH16CmTRbc8jrZRbQkI/GauDFv K97FqMayKrb7Ijing1MhUwKTF6c/ynn7G8Qb5hZLYKDjfX1J+m5gxEplK+xGp91leqc9z zXT+m7a8lfmnTkBcBQoJSqM+XjPog/+SWHngBI/aGk4ZZwECBK8j/RBvj1m+3HerW/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796254008; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ZxzOd+WUYsH1WHm+qsdYT4vg/N0+nJCU6MfmR/4nc+g=; b=J2ikRYIr5u1r5PteK034AjylLsp+bMd3MMs/zUw4Ky7tDV+GUGMdwTaiKHMpWnXsHZKg DgCd9Uw0fG7m39GTFs4lyFP0pbDKFs8zMGC/22D2VF/KlQY7CnM/rKSanbfBa/lgvznnP NHudQ3Vh6X9maZonlH1wkbr44b7XNKrBBudwlctM2r2Uye3Nru139eOJ/nPvLsYb4saqp XS3aSaWJzsuSrBGOST17Cy2/ldZDPdIHtL3Wx/58St50BsosxwL2UG0WOVtOwTcKvHE4F LXXYDGX4oggQvOm4EvwZLGwG+PExjf24k06suoPCqEDJ7a2oLJI6WQswu146mAnpKIA== 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=XVRoH3JX; 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 6CC9C606A322 for ; Wed, 2 Dec 2026 23:26: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=XVRoH3JX Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD0721F00893; Wed, 2 Dec 2026 23:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796254008; bh=ZxzOd+WUYsH1WHm+qsdYT4vg/N0+nJCU6MfmR/4nc+g=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XVRoH3JX0LtRWcmL/JPGUyAlmoUSGzFIXW+KrThdX37FsQWTo2QGsU+51Kd3BA0Ki jn5xfwiUM2H8xA0Xdx53tD6y0Wqhm5ZK60MMsa4Sty2zHhREV2FgJ1oojq1iHQf/9w 7mJJp2lc/6nAfiRuLwkvkpFveSfsoApW+E/hiw5aYNmw+PWAXA9MNVHt+fYjdGFbGx Xt2CdZ+CUvh883bsZ9NQXgvOOQ9zpyJ5ub3TUj/4EQaQhvPqg4uitn8S+bMpGEOY0D FZdVhr7OC/+WJp9cRt9sgvc40tPgn0yh/WOpZ08uqkVjeZtVuHUAeXLYVGxdDO8EJn spGsnrViQu6aA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next 02/23] selftests: can: add J1939 test helper header and library Reply-To: sashiko-reviews@lists.linux.dev To: "Marc Kleine-Budde" Cc: linux-can@vger.kernel.org, "Oliver Hartkopp" , "Vincent Mailhol" , "Oleksij Rempel" In-Reply-To: <20261202230853.2665144-3-mkl@pengutronix.de> References: <20261202230853.2665144-1-mkl@pengutronix.de> <20261202230853.2665144-3-mkl@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 23:26:46 +0000 X-Mailing-List: linux-can@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: - [Medium] selftests: can: undeclared static_assert() in j1939_gw.c due to UAPI header -- commit 8a0b49ac9325ad4226e875680d89eb3fe0cedc60 Author: Oleksij Rempel selftests: can: add J1939 test helper header and library This commit adds shared C and shell helpers, a kselftest harness header, and a CAN gateway setup helper for J1939 selftests. Link: https://patch.msgid.link/20261130-j1939-selftests-v7-2-2491693ccb8d@p= engutronix.de > diff --git a/tools/testing/selftests/net/can/Makefile b/tools/testing/sel= ftests/net/can/Makefile > index 3adaa13dcbfa3..cf0b06974d546 100644 > --- a/tools/testing/selftests/net/can/Makefile > +++ b/tools/testing/selftests/net/can/Makefile > @@ -2,12 +2,16 @@ > =20 > top_srcdir =3D ../../../../.. > =20 > -CFLAGS +=3D -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include = $(KHDR_INCLUDES) > +CFLAGS +=3D -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include = -I$(top_srcdir)/tools/include $(KHDR_INCLUDES) [ ... ] > diff --git a/tools/testing/selftests/net/can/j1939_gw.c b/tools/testing/s= elftests/net/can/j1939_gw.c > new file mode 100644 > index 0000000000000..4018432add9a2 > --- /dev/null > +++ b/tools/testing/selftests/net/can/j1939_gw.c > @@ -0,0 +1,129 @@ [ ... ] > +#include > +#include > +#include > +#include > +#include > + > +/* an RTM_NEWROUTE request for a CAN->CAN rule, see net/can/gw.c */ > +struct cgw_req { > + struct nlmsghdr nh; > + struct rtcanmsg rtcan; > + struct rtattr src_attr; > + __u32 src_ifindex; > + struct rtattr dst_attr; > + __u32 dst_ifindex; > +}; > + > +struct cgw_ack { > + struct nlmsghdr nh; > + struct nlmsgerr err; > +}; > + > +static_assert(offsetof(struct cgw_req, src_attr) =3D=3D > + NLMSG_SPACE(sizeof(struct rtcanmsg)), > + "the attributes must follow the aligned rtcanmsg"); > +static_assert(offsetof(struct cgw_req, dst_attr) =3D=3D > + offsetof(struct cgw_req, src_attr) + RTA_SPACE(sizeof(__u32)), > + "the attributes must be packed as netlink aligns them"); [Severity: Medium] Can j1939_gw.c fail to build with an undeclared static_assert() on C11/C17 compilers? CFLAGS puts -I$(top_srcdir)/usr/include ahead of -I$(top_srcdir)/tools/include. When UAPI headers have been exported to usr/include (such as during make kselftest), resolves to usr/include/linux/kernel.h instead of tools/include/linux/kernel.h, which d= oes not include or . Including (as j1939_helpers.h does) or directly in j1939_gw.c would avoid = the shadowing issue. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202230853.2665= 144-1-mkl@pengutronix.de?part=3D2