Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Xu Yang" <xu.yang_2@oss.nxp.com>
Cc: imx@lists.linux.dev, conor+dt@kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v6 1/2] of: kobj: export of_node_ktype for use by modules
Date: Tue, 21 Jul 2026 11:03:57 +0000	[thread overview]
Message-ID: <20260721110358.168A71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721105448.2109894-2-xu.yang_2@oss.nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch misdiagnoses the root cause of the linkage error and introduces a new modpost namespace error, while leaving non-KUnit modules vulnerable.
--

--- Patch [1]: [PATCH v6 1/2] of: kobj: export of_node_ktype for use by modules ---
commit b369d1afd3eb881423af86a559a0aec84ce01a01
Author: Xu Yang <xu.yang_2@nxp.com>

of: kobj: export of_node_ktype for use by modules

This commit attempts to fix a modpost build error where of_node_ktype is
undefined in the KUnit property-entry test by exporting the symbol via
EXPORT_SYMBOL_IF_KUNIT.

Link: https://lore.kernel.org/oe-kbuild-all/202607181651.RnUuV8n6-lkp@intel.com/

> diff --git a/drivers/of/kobj.c b/drivers/of/kobj.c
> index 1bb61a2c33994..081b8fa38603f 100644
> --- a/drivers/of/kobj.c
> +++ b/drivers/of/kobj.c

[ ... ]

> @@ -27,6 +28,7 @@ static void of_node_release(struct kobject *kobj)
>  const struct kobj_type of_node_ktype = {
>  	.release = of_node_release,
>  };
> +EXPORT_SYMBOL_IF_KUNIT(of_node_ktype);

[Severity: Medium]
Does this export actually resolve the build failure, or does it replace the
undefined symbol error with a modpost namespace error?

Since the property-entry test module likely lacks a corresponding
MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING"), the build might still fail
with an error indicating that the module uses a symbol from the
EXPORTED_FOR_KUNIT_TESTING namespace but does not import it.

Additionally, is the root cause actually the static inline of_node_init()
function in include/linux/of.h?

include/linux/of.h:of_node_init() {
#if defined(CONFIG_OF_KOBJ)
    kobject_init(&node->kobj, &of_node_ktype);
#endif
    fwnode_init(&node->fwnode, &of_fwnode_ops);
}

If non-KUnit modules include include/linux/of.h and are built with compiler
flags that emit out-of-line copies of unused static inline functions (such
as under KASAN or with keep-inline-functions), won't they still encounter
the undefined symbol error since of_node_ktype is only exported for KUnit?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260721105448.2109894-1-xu.yang_2@oss.nxp.com?part=1

  reply	other threads:[~2026-07-21 11:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 10:54 [PATCH v6 0/2] device property: add test cases for fwnode_for_each_child_node() Xu Yang
2026-07-21 10:54 ` [PATCH v6 1/2] of: kobj: export of_node_ktype for use by modules Xu Yang
2026-07-21 11:03   ` sashiko-bot [this message]
2026-07-21 11:16   ` Andy Shevchenko
2026-07-21 11:18     ` Andy Shevchenko
2026-07-21 14:29     ` Xu Yang
2026-07-21 13:37   ` Rob Herring
2026-07-21 10:54 ` [PATCH v6 2/2] device property: add test cases for fwnode_for_each_child_node() Xu Yang
2026-07-21 11:08   ` sashiko-bot
2026-07-21 11:17   ` Andy Shevchenko
2026-07-21 11:15 ` [PATCH v6 0/2] " Andy Shevchenko
2026-07-21 14:28   ` Xu Yang
2026-07-21 21:43 ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260721110358.168A71F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xu.yang_2@oss.nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox