treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
This commit is contained in:
@@ -577,7 +577,7 @@ static struct aa_label *x_to_label(struct aa_profile *profile,
|
||||
stack = NULL;
|
||||
break;
|
||||
}
|
||||
/* fall through - to X_NAME */
|
||||
fallthrough; /* to X_NAME */
|
||||
case AA_X_NAME:
|
||||
if (xindex & AA_X_CHILD)
|
||||
/* released by caller */
|
||||
|
||||
@@ -292,13 +292,13 @@ void aa_apply_modes_to_perms(struct aa_profile *profile, struct aa_perms *perms)
|
||||
switch (AUDIT_MODE(profile)) {
|
||||
case AUDIT_ALL:
|
||||
perms->audit = ALL_PERMS_MASK;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case AUDIT_NOQUIET:
|
||||
perms->quiet = 0;
|
||||
break;
|
||||
case AUDIT_QUIET:
|
||||
perms->audit = 0;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case AUDIT_QUIET_DENIED:
|
||||
perms->quiet = ALL_PERMS_MASK;
|
||||
break;
|
||||
|
||||
@@ -223,7 +223,7 @@ static int xattr_verify(enum ima_hooks func, struct integrity_iint_cache *iint,
|
||||
case IMA_XATTR_DIGEST_NG:
|
||||
/* first byte contains algorithm id */
|
||||
hash_start = 1;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case IMA_XATTR_DIGEST:
|
||||
if (iint->flags & IMA_DIGSIG_REQUIRED) {
|
||||
*cause = "IMA-signature-required";
|
||||
@@ -395,7 +395,7 @@ int ima_appraise_measurement(enum ima_hooks func,
|
||||
/* It's fine not to have xattrs when using a modsig. */
|
||||
if (try_modsig)
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case INTEGRITY_NOLABEL: /* No security.evm xattr. */
|
||||
cause = "missing-HMAC";
|
||||
goto out;
|
||||
|
||||
@@ -1279,12 +1279,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
|
||||
case Opt_uid_gt:
|
||||
case Opt_euid_gt:
|
||||
entry->uid_op = &uid_gt;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case Opt_uid_lt:
|
||||
case Opt_euid_lt:
|
||||
if ((token == Opt_uid_lt) || (token == Opt_euid_lt))
|
||||
entry->uid_op = &uid_lt;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case Opt_uid_eq:
|
||||
case Opt_euid_eq:
|
||||
uid_token = (token == Opt_uid_eq) ||
|
||||
@@ -1313,11 +1313,11 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
|
||||
break;
|
||||
case Opt_fowner_gt:
|
||||
entry->fowner_op = &uid_gt;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case Opt_fowner_lt:
|
||||
if (token == Opt_fowner_lt)
|
||||
entry->fowner_op = &uid_lt;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case Opt_fowner_eq:
|
||||
ima_log_string_op(ab, "fowner", args[0].from,
|
||||
entry->fowner_op);
|
||||
|
||||
@@ -77,7 +77,7 @@ static void ima_show_template_data_ascii(struct seq_file *m,
|
||||
/* skip ':' and '\0' */
|
||||
buf_ptr += 2;
|
||||
buflen -= buf_ptr - field_data->data;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case DATA_FMT_DIGEST:
|
||||
case DATA_FMT_HEX:
|
||||
if (!buflen)
|
||||
|
||||
@@ -465,7 +465,7 @@ key_ref_t search_cred_keyrings_rcu(struct keyring_search_context *ctx)
|
||||
case -EAGAIN: /* no key */
|
||||
if (ret)
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case -ENOKEY: /* negative key */
|
||||
ret = key_ref;
|
||||
break;
|
||||
@@ -487,7 +487,7 @@ key_ref_t search_cred_keyrings_rcu(struct keyring_search_context *ctx)
|
||||
case -EAGAIN: /* no key */
|
||||
if (ret)
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case -ENOKEY: /* negative key */
|
||||
ret = key_ref;
|
||||
break;
|
||||
@@ -509,7 +509,7 @@ key_ref_t search_cred_keyrings_rcu(struct keyring_search_context *ctx)
|
||||
case -EAGAIN: /* no key */
|
||||
if (ret)
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case -ENOKEY: /* negative key */
|
||||
ret = key_ref;
|
||||
break;
|
||||
|
||||
@@ -295,26 +295,26 @@ static int construct_get_dest_keyring(struct key **_dest_keyring)
|
||||
}
|
||||
}
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case KEY_REQKEY_DEFL_THREAD_KEYRING:
|
||||
dest_keyring = key_get(cred->thread_keyring);
|
||||
if (dest_keyring)
|
||||
break;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case KEY_REQKEY_DEFL_PROCESS_KEYRING:
|
||||
dest_keyring = key_get(cred->process_keyring);
|
||||
if (dest_keyring)
|
||||
break;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case KEY_REQKEY_DEFL_SESSION_KEYRING:
|
||||
dest_keyring = key_get(cred->session_keyring);
|
||||
|
||||
if (dest_keyring)
|
||||
break;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case KEY_REQKEY_DEFL_USER_SESSION_KEYRING:
|
||||
ret = look_up_user_keyrings(NULL, &dest_keyring);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -3606,26 +3606,20 @@ static int selinux_file_ioctl(struct file *file, unsigned int cmd,
|
||||
|
||||
switch (cmd) {
|
||||
case FIONREAD:
|
||||
/* fall through */
|
||||
case FIBMAP:
|
||||
/* fall through */
|
||||
case FIGETBSZ:
|
||||
/* fall through */
|
||||
case FS_IOC_GETFLAGS:
|
||||
/* fall through */
|
||||
case FS_IOC_GETVERSION:
|
||||
error = file_has_perm(cred, file, FILE__GETATTR);
|
||||
break;
|
||||
|
||||
case FS_IOC_SETFLAGS:
|
||||
/* fall through */
|
||||
case FS_IOC_SETVERSION:
|
||||
error = file_has_perm(cred, file, FILE__SETATTR);
|
||||
break;
|
||||
|
||||
/* sys_ioctl() checks */
|
||||
case FIONBIO:
|
||||
/* fall through */
|
||||
case FIOASYNC:
|
||||
error = file_has_perm(cred, file, 0);
|
||||
break;
|
||||
@@ -3783,7 +3777,7 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
|
||||
err = file_has_perm(cred, file, FILE__WRITE);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case F_SETOWN:
|
||||
case F_SETSIG:
|
||||
case F_GETFL:
|
||||
|
||||
@@ -535,7 +535,7 @@ int mls_compute_sid(struct policydb *p,
|
||||
scontext, tcontext);
|
||||
}
|
||||
|
||||
/* Fallthrough */
|
||||
fallthrough;
|
||||
case AVTAB_CHANGE:
|
||||
if ((tclass == p->process_class) || sock)
|
||||
/* Use the process MLS attributes. */
|
||||
@@ -546,8 +546,6 @@ int mls_compute_sid(struct policydb *p,
|
||||
case AVTAB_MEMBER:
|
||||
/* Use the process effective MLS attributes. */
|
||||
return mls_context_cpy_low(newcontext, scontext);
|
||||
|
||||
/* fall through */
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3365,7 +3365,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
|
||||
* to set mount options simulate setting the
|
||||
* superblock default.
|
||||
*/
|
||||
/* Fall through */
|
||||
fallthrough;
|
||||
default:
|
||||
/*
|
||||
* This isn't an understood special case.
|
||||
|
||||
@@ -1240,7 +1240,7 @@ static bool tomoyo_print_condition(struct tomoyo_io_buffer *head,
|
||||
tomoyo_set_space(head);
|
||||
tomoyo_set_string(head, cond->transit->name);
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 1:
|
||||
{
|
||||
const u16 condc = cond->condc;
|
||||
@@ -1345,12 +1345,12 @@ static bool tomoyo_print_condition(struct tomoyo_io_buffer *head,
|
||||
}
|
||||
}
|
||||
head->r.cond_step++;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 2:
|
||||
if (!tomoyo_flush(head))
|
||||
break;
|
||||
head->r.cond_step++;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 3:
|
||||
if (cond->grant_log != TOMOYO_GRANTLOG_AUTO)
|
||||
tomoyo_io_printf(head, " grant_log=%s",
|
||||
@@ -1639,7 +1639,7 @@ static void tomoyo_read_domain(struct tomoyo_io_buffer *head)
|
||||
tomoyo_set_string(head, tomoyo_dif[i]);
|
||||
head->r.index = 0;
|
||||
head->r.step++;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 1:
|
||||
while (head->r.index < TOMOYO_MAX_ACL_GROUPS) {
|
||||
i = head->r.index++;
|
||||
@@ -1652,14 +1652,14 @@ static void tomoyo_read_domain(struct tomoyo_io_buffer *head)
|
||||
head->r.index = 0;
|
||||
head->r.step++;
|
||||
tomoyo_set_lf(head);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 2:
|
||||
if (!tomoyo_read_domain2(head, &domain->acl_info_list))
|
||||
return;
|
||||
head->r.step++;
|
||||
if (!tomoyo_set_lf(head))
|
||||
return;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 3:
|
||||
head->r.step = 0;
|
||||
if (head->r.print_this_domain_only)
|
||||
@@ -2088,7 +2088,7 @@ int tomoyo_supervisor(struct tomoyo_request_info *r, const char *fmt, ...)
|
||||
/* Check max_learning_entry parameter. */
|
||||
if (tomoyo_domain_quota_is_ok(r))
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -2710,13 +2710,13 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head,
|
||||
case TOMOYO_DOMAINPOLICY:
|
||||
if (tomoyo_select_domain(head, cp0))
|
||||
continue;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case TOMOYO_EXCEPTIONPOLICY:
|
||||
if (!strcmp(cp0, "select transition_only")) {
|
||||
head->r.print_transition_related_only = true;
|
||||
continue;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
default:
|
||||
if (!tomoyo_manager()) {
|
||||
error = -EPERM;
|
||||
|
||||
@@ -927,7 +927,7 @@ int tomoyo_path2_perm(const u8 operation, const struct path *path1,
|
||||
case TOMOYO_TYPE_LINK:
|
||||
if (!d_is_dir(path1->dentry))
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case TOMOYO_TYPE_PIVOT_ROOT:
|
||||
tomoyo_add_slash(&buf1);
|
||||
tomoyo_add_slash(&buf2);
|
||||
|
||||
Reference in New Issue
Block a user