Page MenuHomeFreeBSD

Remove archaic register keyword from sys and ANSIfy prototypes while here
ClosedPublic

Authored by emaste on Mar 30 2017, 12:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 7:08 PM
Unknown Object (File)
Feb 23 2024, 7:08 PM
Unknown Object (File)
Feb 23 2024, 7:08 PM
Unknown Object (File)
Feb 23 2024, 3:43 PM
Unknown Object (File)
Jan 13 2024, 3:36 AM
Unknown Object (File)
Dec 20 2023, 2:18 AM
Unknown Object (File)
Sep 10 2023, 12:58 PM
Unknown Object (File)
Aug 1 2023, 7:42 PM
Subscribers

Details

Summary

A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Did you use a coccinelle script for the ANSIfying, and if so, what was it?

In D10193#210689, @cem wrote:

Did you use a coccinelle script for the ANSIfying, and if so, what was it?

I did not - this is a collection of changes that have been sitting in various WIP trees of mine for ages, through a combination of manual changes and set etc.

cem added inline comments.
sys/kern/kern_clock.c
392–394

didn't feel like ANSIfying these too? :)

This revision is now accepted and ready to land.Mar 30 2017, 1:09 AM
sys/amd64/include/xen/hypercall.h
112 ↗(On Diff #26799)

hypercall.h changes will be omitted, the register keyword is required for the __asm__("r10").

sys/kern/kern_clock.c
392–394

hrm, missed these. Updated in my tree.

sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
391

It would seem worth trying to upstream the sys/cddl/contrib changes or otherwise dropping them.

sys/ddb/db_access.c
59–60

Missed this 'register'.

sys/ddb/db_sym.c
292

Missed this 'register'.

369–370

Missed this 'register'.

sys/kern/sysv_msg.c
768–769

ANSIfy?

sys/kern/vfs_mount.c
368

Maybe follow the more typical '#ifndef _SYSPROTO_H_' format rather than doing this type of custom comment?

sys/kern/vfs_syscalls.c
1549

Use SYS_SYSPROTO_H here as well.

2357

SYS_SYSPROTO_H

sbruno added a subscriber: sbruno.

Just a LGTM based on the Intel Networking group.

sys/dev/ex/if_ex.c
815 ↗(On Diff #26799)

Approved.

sys/dev/ixgb/if_ixgb.c
1780

Approved.

emaste edited edge metadata.
emaste marked 4 inline comments as done.

Update based on feedback in Phabricator

This revision now requires review to proceed.Apr 6 2017, 5:49 PM
emaste added inline comments.
sys/kern/vfs_syscalls.c
1555

leftover will be deleted

emaste added inline comments.
sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
391

Will handle these outside of this review.

sys/dev/ixgb/if_ixgb.c
1780

previously committed

emaste marked an inline comment as done.
This revision is now accepted and ready to land.May 17 2017, 1:53 PM

A note for posterity: I compared object files built with/without this patch. There were 8 files with differences, and those differences were due to __LINE__ being passed to mtx_lock or similar.

  • kern_clock.o
  • kern.exec.o
  • sys_machdep.o
  • sysv_msg.o
  • vfs_mount.o
  • vfs_syscalls.o
  • vfs_vnops.o
  • vm_machdep.o