Page MenuHomeFreeBSD

kernel: Make some compiling time constant const
ClosedPublic

Authored by zlei on May 17 2024, 10:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 12:17 AM
Unknown Object (File)
Oct 9 2024, 7:16 PM
Unknown Object (File)
Sep 27 2024, 5:33 PM
Unknown Object (File)
Sep 23 2024, 9:25 PM
Unknown Object (File)
Sep 22 2024, 11:53 PM
Unknown Object (File)
Sep 10 2024, 10:56 AM
Unknown Object (File)
Sep 8 2024, 4:57 AM
Unknown Object (File)
Sep 7 2024, 10:50 AM

Details

Summary

While reviewing D44760 I realized that the kernel version and some other
variables are generated by sys/conf/newvers.sh at compiling time. Given they
are not subjected to change, make them constant.

No functional change intended.

MFC after: ???

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

zlei requested review of this revision.May 17 2024, 10:00 AM
sys/conf/newvers.sh
321

Strictly these are KBI changes. But if we have never promised that those compile time constants can be altered by 3rd party modules, then this change is safe to MFC.

@khng I think with this change even shadowing those global variables can be easily caught.

Rebased to latest main.

Some has been committed separately.

  1. 7412517f2947 init_main: Sprinkle const qualifiers where appropriate
  2. e2357561b949 FreeBSD: Add const qualifier to members of struct opensolaris_utsname
  3. 68c890b4433d linux(4): Add const qualifier to the value parameter of function handle_string()
  4. 92f2a4c820fe compat_freebsd4: Add const qualifier to the local variable s inside function freebsd4_uname()
This revision was not accepted when it landed; it landed in state Needs Review.Aug 30 2024, 10:28 AM
This revision was automatically updated to reflect the committed changes.