[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b263e5900912070532i6ab63c36o48030a191c091dd5@mail.gmail.com>
Date: Mon, 7 Dec 2009 15:32:26 +0200
From: Dan Carpenter <error27.lkml@...il.com>
To: Amerigo Wang <amwang@...hat.com>
Cc: linux-kernel@...r.kernel.org, Eric Paris <eparis@...isplace.org>,
linux-security-module@...r.kernel.org, akpm@...ux-foundation.org,
James Morris <jmorris@...ei.org>
Subject: Re: [Patch] selinux: remove a useless return
On 12/3/09, Amerigo Wang <amwang@...hat.com> wrote:
> The last return is unreachable, remove the 'return'
> in default, let it fall through.
>
> Signed-off-by: WANG Cong <amwang@...hat.com>
> Cc: James Morris <jmorris@...ei.org>
> Cc: Eric Paris <eparis@...isplace.org>
>
> ---
>
> diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
> index b5407f1..718823d 100644
> --- a/security/selinux/ss/mls.c
> +++ b/security/selinux/ss/mls.c
> @@ -542,7 +542,7 @@ int mls_compute_sid(struct context *scontext,
> /* Use the process effective MLS attributes. */
> return mls_context_cpy_low(newcontext, scontext);
> default:
> - return -EINVAL;
> + /* Fallthrough */
> }
> return -EINVAL;
> }
I don't think this compiles. GCC doesn't let you end a switch block
with a label.
I also have sent the selinux people a patch that didn't compile by
mistake. Afterward I wrote this script so hopefully I won't mess up
again.
#!/bin/bash -e
files=$(grep +++ /home/dcarpenter/var/mail/postponed-msgs | cut -f 1 |
cut -b 5-)
for file in $files ; do
file=${file/devel\//}
file=${file/new\//}
kchecker $file
if which sparse | grep -q sparse ; then
kchecker --sparse $file
fi
done
You will have to change the path names. Hm.... Also you will have to
get the kchecker script from the smatch_data/ directory of smatch
(http://repo.or.cz/w/smatch.git).
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists