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=1796119184; b=pe0QR8FpQW7q97f5ZqB0xOZTxe5UDXTzmL7C/An9BbfUj0xpwoY7PhncdBoljKwJj3pc SlSCFTKEXjaFq/gV8UVdgFEVT6WvJTpGLRjYC7ivYGQo1JqicA6h89YWnHRbBVjys9dsv yrNc2ZFnpXmJnB0Wjew0jfiiZ5xSji/B58nyOZXWiMncAMD/KhDmElKwO6lcRY2QovKTD xfFa9E7SDOW8NJ64PQRECcmOb7etpGYJlPOxrpj/tPPFGWPvyUv6R0tH/vXYhksNxl4Ve 9s03Y5gtefjq7BUYYSjNN/r00ThSjlVOveRst/1VmIitsFgM0CznHdqagLOvwEfqcFA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796119184; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=GrUspqiGQKg4F/M2bKP/+uvegTn5aHdj7ViLjBc8Dug=; b=x6r2JvKfVbv1BKay0mzN5rtIzw1DOVdWebuHMUabvpM31KBgJSgRfqNALzCc087OO3DZ M3cElxAxaQxSJM3gimAi8NGbCEOxF7+OGkpMhfeAG4nR2LFx6Ik+Hvh13nSGHkVE3cSFH KMaCaLnR0L8717septHp9k4hKOcrI57omXwtyc/Ce52lGPgL+bPblr5F3cqAwt8qym2+P 182xPqKW5Ki8I0EyrBr+g4EQ0MUNXSTHqWYbN2BHyuVNxcP6qV+ABgYupkMg754oF3VZm vYOKoR662vKmEMIpJfwX3YRUx9BMcXJ9nK6M5GwG2AndWA9KeiemNUY4Ulv6PgQg+ZA== 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=Rdmq9MIs; 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 B982B606A31A for ; Tue, 1 Dec 2026 09:59:44 +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=Rdmq9MIs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B7861F00897; Tue, 1 Dec 2026 09:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796119184; bh=GrUspqiGQKg4F/M2bKP/+uvegTn5aHdj7ViLjBc8Dug=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Rdmq9MIsJiYzMEF0p82qSdJp5uIDqoisAPwtcL9C78SsyMUV7FVkHhcoehD0ywPed deN75LUyXfSLV30o9OP0QKdkSI/FaMadVOIL34lxnt9UztvxlT9jNouCxUUg/Ala8t +eNJVhNfDIcbqozxU54j23OfwzcWcNdja4M3xh9z0nvWFOTeVDaNee//1s6bwvGnbq UyyKTTu6EzyO/rwY1doLzAUijAoxO2KbI2amMJXawFIXxx/Y95BnOxttqHFf6BBUkw QJVf2YUWO6aL6j/l5xyK7rlY32zjhEoODavgLlHEyvdYdM56LnVbYyaM+RWqZr7czU GcbCXU85J98Og== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 1/2] i2c: add subsys_i2c_driver() macro Reply-To: sashiko-reviews@lists.linux.dev To: "Peng Fan" Cc: mfd@lists.linux.dev, lee@kernel.org In-Reply-To: <20261201-add-i2c-subsys-mfd-v1-1-e7b1db408abf@nxp.com> References: <20261201-add-i2c-subsys-mfd-v1-0-e7b1db408abf@nxp.com> <20261201-add-i2c-subsys-mfd-v1-1-e7b1db408abf@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 09:59:43 +0000 X-Mailing-List: mfd@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] i2c: misnamed and redundant subsys_i2c_driver_probe() macro - [Low] i2c: inconsistent placement and comment style for subsys_i2c_driver() -- commit 740e2ad66bef9c533701a5564e85f3b5ba81bdf3 Author: Peng Fan i2c: add subsys_i2c_driver() macro This commit adds the subsys_i2c_driver() and subsys_i2c_driver_probe() helper macros to register I2C drivers at the subsys_initcall() level. > diff --git a/include/linux/i2c.h b/include/linux/i2c.h > index 6a847fc88d259..f26bb2e0ba0db 100644 > --- a/include/linux/i2c.h > +++ b/include/linux/i2c.h > @@ -915,6 +915,29 @@ void i2c_del_driver(struct i2c_driver *driver); > #define i2c_add_driver(driver) \ > i2c_register_driver(THIS_MODULE, driver) > =20 > +/* > + * subsys_i2c_driver() - Helper macro for i2c drivers that don't do anyt= hing > + * special in module init/exit but need to register earlier, at > + * subsys_initcall level, when built in. This eliminates a lot of > + * boilerplate. Each driver may only use this macro once, and calling it > + * replaces subsys_initcall() and module_exit(). > + */ > +#define subsys_i2c_driver(__i2c_driver) \ > + subsys_driver(__i2c_driver, i2c_add_driver, i2c_del_driver) [Severity: Low] This isn't a bug, but module_i2c_driver() and builtin_i2c_driver() are grouped together further down in include/linux/i2c.h with kernel-doc comments (including @__i2c_driver). Could subsys_i2c_driver() be placed alongside them using the same kernel-doc format? > + > +/* > + * subsys_i2c_driver_probe() - Helper macro for drivers that don't do > + * anything special in driver register and have no exit, but need to reg= ister > + * earlier, at subsys_initcall level. This eliminates some boilerplate. = Each > + * driver may only use this macro once, and using it replaces subsys_ini= tcall. > + */ > +#define subsys_i2c_driver_probe(__i2c_driver) \ > +static int __init __i2c_driver##_init(void) \ > +{ \ > + return i2c_add_driver(&__i2c_driver); \ > +} \ > +subsys_initcall(__i2c_driver##_init) [Severity: Low] Is subsys_i2c_driver_probe() needed in addition to subsys_i2c_driver()? In platform_device.h, the _probe suffix in module_platform_driver_probe(), builtin_platform_driver_probe(), and subsys_platform_driver_probe() means the macro takes a separate probe function and calls platform_driver_probe(). I2C has no i2c_driver_probe() equivalent, and this macro takes a single struct i2c_driver argument and calls i2c_add_driver() just like subsys_i2c_driver(). For built-in drivers without an exit callback, subsys_i2c_driver() already works because the __exit function generated by subsys_driver() is discarded at link time and i2c_del_driver() does not require a .remove callback. For loadable modules, subsys_initcall() becomes module_init(), so using subsys_i2c_driver_probe() omits module_exit() and leaves the module permanently non-unloadable. Could subsys_i2c_driver_probe() be dropped in favor of subsys_i2c_driver()? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-add-i2c-su= bsys-mfd-v1-0-e7b1db408abf@nxp.com?part=3D1