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:
@@ -400,6 +400,9 @@ static int append_vendor_model(
|
||||
const struct scsi_id_device *dev_scsi,
|
||||
char buf[static VENDOR_LENGTH + MODEL_LENGTH]) {
|
||||
|
||||
assert(dev_scsi);
|
||||
assert(buf);
|
||||
|
||||
if (strnlen(dev_scsi->vendor, VENDOR_LENGTH) != VENDOR_LENGTH)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: bad vendor string \"%s\"",
|
||||
|
||||
@@ -156,6 +156,7 @@ static int get_subst_type(const char **str, bool strict, FormatSubstitutionType
|
||||
assert(str);
|
||||
assert(*str);
|
||||
assert(ret_type);
|
||||
assert(ret_attr);
|
||||
|
||||
if (*p == '$') {
|
||||
p++;
|
||||
|
||||
@@ -1464,6 +1464,8 @@ static int attr_subst_subdir(char attr[static UTIL_PATH_SIZE]) {
|
||||
const char *tail;
|
||||
size_t len, size;
|
||||
|
||||
assert(attr);
|
||||
|
||||
tail = strstr(attr, "/*/");
|
||||
if (!tail)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user