diff mbox

selinux: remove redundant assignment to len

Message ID 20171014150049.1053-1-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Colin King Oct. 14, 2017, 3 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable len is being set to zero and this value is never
being read since len is being set to a different value just
a few lines later.  Remove this redundant assignment. Cleans
up clang warning: Value stored to 'len' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 security/selinux/ss/conditional.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paul Moore Oct. 16, 2017, 10:37 p.m. UTC | #1
On Sat, Oct 14, 2017 at 11:00 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable len is being set to zero and this value is never
> being read since len is being set to a different value just
> a few lines later.  Remove this redundant assignment. Cleans
> up clang warning: Value stored to 'len' is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  security/selinux/ss/conditional.c | 1 -
>  1 file changed, 1 deletion(-)

Merged.

> diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
> index 771c96afe1d5..c91543a617ac 100644
> --- a/security/selinux/ss/conditional.c
> +++ b/security/selinux/ss/conditional.c
> @@ -361,7 +361,6 @@ static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list *
>
>         *ret_list = NULL;
>
> -       len = 0;
>         rc = next_entry(buf, fp, sizeof(u32));
>         if (rc)
>                 return rc;
> --
> 2.14.1
>
diff mbox

Patch

diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 771c96afe1d5..c91543a617ac 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -361,7 +361,6 @@  static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list *
 
 	*ret_list = NULL;
 
-	len = 0;
 	rc = next_entry(buf, fp, sizeof(u32));
 	if (rc)
 		return rc;