security: remove unneeded break
Subsystems (6)
Security (LSM) Keys-trusted Keys/keyrings Integrity measurement architecture (IMA) +2 more subsystems
PATCH 1/1 security: remove unneeded break
From: Tom Rix <[email protected]>
A break is not needed if it is preceded by a return
Signed-off-by Tom Rix <[email protected]>
--- security/integrity/ima/ima_appraise.c | 1 - security/keys/trusted-keys/trusted_tpm1.c | 1 - security/safesetid/lsm.c | 3 --- 3 files changed, 5 deletions(-)
security/integrity/ima/ima_appraise.c +0 -1
@@ -181,7 +181,6 @@ enum hash_algo ima_get_hash_algo(struct evm_ima_xattr_data *xattr_value,if (sig->version !=2 || xattr_len <=sizeof (*sig))return ima_hash_algo;return sig->hash_algo; -break ;case IMA_XATTR_DIGEST_NG :/* first byte contains algorithm id */ ret = xattr_value->data[0 ];
security/keys/trusted-keys/trusted_tpm1.c +0 -1
@@ -901,7 +901,6 @@ static int datablob_parse(char *datablob, struct trusted_key_payload *p,break ;case Opt_err:return -EINVAL ; -break ; }return ret; }
security/safesetid/lsm.c +0 -3
@@ -125,7 +125,6 @@ static int safesetid_security_capable(const struct cred *cred,pr_warn ("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions\n" ,__kuid_val (cred->uid));return -EPERM ; -break ;case CAP_SETGID :/* * If no policy applies to this task, allow the use of CAP_SETGID for
@@ -140,11 +139,9 @@ static int safesetid_security_capable(const struct cred *cred,pr_warn ("Operation requires CAP_SETGID, which is not available to GID %u for operations besides approved set*gid transitions\n" ,__kuid_val (cred->uid));return -EPERM ; -break ;default :/* Error, the only capabilities were checking for is CAP_SETUID/GID */ return 0 ; -break ; }return 0 ; }
Signature · 1 line
2.18.1
Quoted 5 lines · On Mon, 19 Oct 2020, [email protected] wrote:
From: Tom Rix <[email protected]>
A break is not needed if it is preceded by a return
Signed-off-by Tom Rix <[email protected]>
Acked-by James Morris <[email protected]>
Signature · 2 lines
James Morris <[email protected]>
Quoted 5 lines · On Mon, 2020-10-19 at 10:36 -0700, [email protected] wrote:
From: Tom Rix <[email protected]>
A break is not needed if it is preceded by a return
Signed-off-by Tom Rix <[email protected]>
Recently "fall through" comments were added before any case statement without a preceeding break. Have you made sure these changes won't be
flagged. Assuming you have,
Acked-by Mimi Zohar <[email protected]>
Mimi
Quoted 5 lines · On Mon, Oct 19, 2020 at 10:36:53AM -0700, [email protected] wrote:
From: Tom Rix <[email protected]>
A break is not needed if it is preceded by a return
Signed-off-by Tom Rix <[email protected]>
Acked-by Jarkko Sakkinen <[email protected]>
/Jarkko