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)
Fri, Aug 30, 10:30 AM
Unknown Object (File)
Sun, Aug 25, 8:12 PM
Unknown Object (File)
Sun, Aug 25, 7:55 PM
Unknown Object (File)
Jul 26 2024, 6:01 AM
Unknown Object (File)
Jul 24 2024, 5:28 AM
Unknown Object (File)
Jul 16 2024, 3:24 PM
Unknown Object (File)
Jun 28 2024, 11:35 PM
Unknown Object (File)
Jun 27 2024, 8:54 PM

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.Fri, Aug 30, 10:28 AM
This revision was automatically updated to reflect the committed changes.