Commit Graph
3 Commits
Author SHA1 Message Date
Andy Shevchenko e6b4d264c8 args: fix documentation to reflect the correct numbers
The macro uses up to 15 arguments.  Reflect this in the top level comment.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: d51e783c17 ("lsm: count the LSMs enabled at compile time")
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2025-12-10 16:07:42 -08:00
KP Singh d51e783c17 lsm: count the LSMs enabled at compile time
These macros are a clever trick to determine a count of the number of
LSMs that are enabled in the config to ascertain the maximum number of
static calls that need to be configured per LSM hook.

Without this one would need to generate static calls for the total
number of LSMs in the kernel (even if they are not compiled) times the
number of LSM hooks which ends up being quite wasteful.

Tested-by: Guenter Roeck <[email protected]>
Suggested-by: Kui-Feng Lee <[email protected]>
Suggested-by: Andrii Nakryiko <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Casey Schaufler <[email protected]>
Reviewed-by: John Johansen <[email protected]>
Acked-by: Casey Schaufler <[email protected]>
Acked-by: Song Liu <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Nacked-by: Tetsuo Handa <[email protected]>
Signed-off-by: KP Singh <[email protected]>
[PM: added IPE to the count during merge]
Signed-off-by: Paul Moore <[email protected]>
2024-08-22 12:23:47 -04:00
Andy Shevchenko b229baa374 kernel.h: split out COUNT_ARGS() and CONCATENATE() to args.h
Patch series "kernel.h: Split out a couple of macros to args.h", v4.

There are macros in kernel.h that can be used outside of that header. 
Split them to args.h and replace open coded variants.


This patch (of 4):

kernel.h is being used as a dump for all kinds of stuff for a long time. 
The COUNT_ARGS() and CONCATENATE() macros may be used in some places
without need of the full kernel.h dependency train with it.

Here is the attempt on cleaning it up by splitting out these macros().

While at it, include new header where it's being used.

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Steven Rostedt (Google) <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>	[PCI]
Cc: Brendan Higgins <[email protected]>
Cc: Daniel Latypov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Gow <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Lorenzo Pieralisi <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Masami Hiramatsu (Google) <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Sudeep Holla <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2023-08-18 10:18:56 -07:00