diff mbox series

[5/5] smack: Remove redundant assignments

Message ID 20220331173358.40939-5-michalorzel.eng@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/5] apparmor: Remove redundant assignments | expand

Commit Message

Michal Orzel March 31, 2022, 5:33 p.m. UTC
Get rid of redundant assignments which end up in values not being
read either because they are overwritten or the function ends.

Reported by clang-tidy [deadcode.DeadStores]

Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
---
 security/smack/smackfs.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Casey Schaufler March 31, 2022, 6:44 p.m. UTC | #1
On 3/31/2022 10:33 AM, Michal Orzel wrote:
> Get rid of redundant assignments which end up in values not being
> read either because they are overwritten or the function ends.
>
> Reported by clang-tidy [deadcode.DeadStores]
>
> Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>

Thank you. I will take this via the Smack tree.

> ---
>   security/smack/smackfs.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
> index 658eab05599e..9e61014073cc 100644
> --- a/security/smack/smackfs.c
> +++ b/security/smack/smackfs.c
> @@ -1192,7 +1192,6 @@ static ssize_t smk_write_net4addr(struct file *file, const char __user *buf,
>   			rc = -EINVAL;
>   			goto free_out;
>   		}
> -		m = BEBITS;
>   		masks = 32;
>   	}
>   	if (masks > BEBITS) {
diff mbox series

Patch

diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index 658eab05599e..9e61014073cc 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -1192,7 +1192,6 @@  static ssize_t smk_write_net4addr(struct file *file, const char __user *buf,
 			rc = -EINVAL;
 			goto free_out;
 		}
-		m = BEBITS;
 		masks = 32;
 	}
 	if (masks > BEBITS) {