On 11/29/25 12:24 PM, Andy Shevchenko wrote:
> On Sat, Nov 29, 2025 at 02:53:01PM -0500, Yury Norov (NVIDIA) wrote:
>> The macro is related to sysfs, but is defined in kernel.h. Move it to
>> the proper header, and unload the generic kernel.h.
>
> Tough guy :-)
> I hope it builds well in your case.
>
> FWIW,
> https://lore.kernel.org/lkml/[email protected]/
> https://lore.kernel.org/lkml/[email protected]/
> https://lore.kernel.org/lkml/[email protected]/
>
> Assuming it builds in allmodconfig, allyesconfig on x86_32/64 and arm/64
> Reviewed-by: Andy Shevchenko <[email protected]>
I don't build allyesconfigs any more (final? linking takes too long).
It builds successfully for arm64 allmodconfig, arm allmodconfig,
i386 allmodconfig, and x86_64 allmodconfig.
And the source files that use VERIFY_OCTAL_PERMISSIONS() all build successfully
(which means that they possibly include <linux/sysfs.h> indirectly, i.e.,
by luck). There aren't many of them, so I checked:
arch/arc/kernel/perf_event.c: arc_pmu->attr[j].attr.attr.mode =
VERIFY_OCTAL_PERMISSIONS(0444);
INDIRECT
drivers/edac/thunderx_edac.c: .mode = VERIFY_OCTAL_PERMISSIONS(_mode),
\
INDIRECT
drivers/media/platform/amphion/vpu_dbg.c:
VERIFY_OCTAL_PERMISSIONS(0644),
INDIRECT
drivers/soc/aspeed/aspeed-uart-routing.c: .mode =
VERIFY_OCTAL_PERMISSIONS(0644) }, \
INDIRECT
fs/xfs/xfs_error.c: .mode = VERIFY_OCTAL_PERMISSIONS(S_IWUSR |
S_IRUGO) }, \
INDIRECT
include/linux/moduleparam.h: VERIFY_OCTAL_PERMISSIONS(perm), level,
flags, { arg } }
INDIRECT
so all of them got lucky. :)
Acked-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]>
--
~Randy