Re: Re: Re: [PATCH v2] treewide: const qualify ctl_tables where applicable

2025-01-27 Thread Jani Nikula
able. >> >> Global data structures marked 'const' will be moved into an ELF >> section that is typically mapped read-only in its entirely, and so the >> data cannot be modified by writing to it directly. No such protection >> is possible for the stack, and so the constness there is only enforced >> at compile time. > I completely agree with you. No reason to use const within those > functions. But why define those ctl_tables in function to begin with. > Can't you just use the ones that are defined outside the functions? You could have static const within functions too. You get the rodata protection and function local scope, best of both worlds? BR, Jani. -- Jani Nikula, Intel

Re: [PATCH] treewide: const qualify ctl_tables where applicable

2025-01-09 Thread Jani Nikula
&i915_perf_stream_paranoid, For i915, Acked-by: Jani Nikula -- Jani Nikula, Intel