tree-wide: some more [static] related fixes
let's add [static] where it was missing so far Drop [static] on parameters that can be NULL. Add an assert() around parameters that have [static] and can't be NULL hence. Add some "const" where it was forgotten.
This commit is contained in:
@@ -660,6 +660,8 @@ int efi_set_boot_order(uint16_t *order, size_t n) {
|
||||
static int boot_id_hex(const char s[static 4]) {
|
||||
int id = 0, i;
|
||||
|
||||
assert(s);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
if (s[i] >= '0' && s[i] <= '9')
|
||||
id |= (s[i] - '0') << (3 - i) * 4;
|
||||
|
||||
@@ -652,6 +652,8 @@ int ethtool_set_glinksettings(
|
||||
struct ifreq ifr = {};
|
||||
int r;
|
||||
|
||||
assert(advertise);
|
||||
|
||||
if (autonegotiation != AUTONEG_DISABLE && memeqzero(advertise, sizeof(uint32_t) * N_ADVERTISE)) {
|
||||
log_info("ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.");
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user