Page MenuHomeFreeBSD

Clean up compiler warnings in sysctl(8)
AbandonedPublic

Authored by trasz on Mar 24 2020, 12:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 1 2024, 10:44 PM
Unknown Object (File)
Dec 22 2023, 10:57 PM
Unknown Object (File)
Dec 20 2023, 6:16 AM
Unknown Object (File)
Dec 14 2023, 8:59 PM
Unknown Object (File)
Aug 26 2023, 4:17 AM
Unknown Object (File)
Jul 6 2023, 1:04 AM
Unknown Object (File)
May 19 2023, 10:36 PM
Unknown Object (File)
May 13 2023, 6:00 AM
Subscribers

Details

Reviewers
cem
Summary

Clean up compiler warnings in sysctl(8).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30087
Build 27895: arc lint + arc unit

Event Timeline

Pacify gcc, just in case.

Mostly LGTM, thanks.

sbin/sysctl/sysctl.c
738

The second (struct efi_md *) cast can be dropped. It is redundant.

907

Alternatively, just memcpy(kind, buf, sizeof(*kind)); here and drop the other changes to this function.

sys/sys/efi.h
96

The second struct efi_md * cast is redundant here as well, unless something is directly acting on this macro like: efi_next_descriptor(...)->md_phys. Which, I hope not.

sbin/sysctl/sysctl.c
940

Is this still needed?

Fix issues pointed out by cem@.

trasz added inline comments.
sbin/sysctl/sysctl.c
940

Unfortunately yes, even with new GCC.

sys/sys/efi.h
96

I think I'd rather leave it for now, quick grep shows nobody uses it like that, but it is a valid way to call it.