* [PATCH] audit: mark expected switch fall-through
@ 2019-02-12 20:46 Gustavo A. R. Silva
2019-02-13 1:19 ` Paul Moore
0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-12 20:46 UTC (permalink / raw)
To: Paul Moore, Eric Paris
Cc: linux-audit, linux-kernel, Gustavo A. R. Silva, Kees Cook
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.
This patch fixes the following warning:
kernel/auditfilter.c: In function ‘audit_krule_to_data’:
kernel/auditfilter.c:668:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (krule->pflags & AUDIT_LOGINUID_LEGACY && !f->val) {
^
kernel/auditfilter.c:674:3: note: here
default:
^~~~~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.
This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
kernel/auditfilter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index add360b46b38..63f8b3f26fab 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -670,7 +670,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
data->values[i] = AUDIT_UID_UNSET;
break;
}
- /* fallthrough if set */
+ /* fall through - if set */
default:
data->values[i] = f->val;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] audit: mark expected switch fall-through
2019-02-12 20:46 [PATCH] audit: mark expected switch fall-through Gustavo A. R. Silva
@ 2019-02-13 1:19 ` Paul Moore
2019-02-13 1:54 ` Gustavo A. R. Silva
2020-05-08 21:15 ` Gustavo A. R. Silva
0 siblings, 2 replies; 5+ messages in thread
From: Paul Moore @ 2019-02-13 1:19 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Eric Paris, linux-audit, linux-kernel, Kees Cook
On Tue, Feb 12, 2019 at 3:46 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> kernel/auditfilter.c: In function ‘audit_krule_to_data’:
> kernel/auditfilter.c:668:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (krule->pflags & AUDIT_LOGINUID_LEGACY && !f->val) {
> ^
> kernel/auditfilter.c:674:3: note: here
> default:
> ^~~~~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> Notice that, in this particular case, the code comment is modified
> in accordance with what GCC is expecting to find.
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> kernel/auditfilter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Merged into audit/next, thanks.
--
paul moore
www.paul-moore.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] audit: mark expected switch fall-through
2019-02-13 1:19 ` Paul Moore
@ 2019-02-13 1:54 ` Gustavo A. R. Silva
2020-05-08 21:15 ` Gustavo A. R. Silva
1 sibling, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-13 1:54 UTC (permalink / raw)
To: Paul Moore; +Cc: Eric Paris, linux-audit, linux-kernel, Kees Cook
On 2/12/19 7:19 PM, Paul Moore wrote:
> On Tue, Feb 12, 2019 at 3:46 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warning:
>>
>> kernel/auditfilter.c: In function ‘audit_krule_to_data’:
>> kernel/auditfilter.c:668:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>> if (krule->pflags & AUDIT_LOGINUID_LEGACY && !f->val) {
>> ^
>> kernel/auditfilter.c:674:3: note: here
>> default:
>> ^~~~~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> Notice that, in this particular case, the code comment is modified
>> in accordance with what GCC is expecting to find.
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> kernel/auditfilter.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Merged into audit/next, thanks.
>
Thanks, Paul.
--
Gustavo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] audit: mark expected switch fall-through
2019-02-13 1:19 ` Paul Moore
@ 2020-05-08 21:15 ` Gustavo A. R. Silva
2020-05-08 21:15 ` Gustavo A. R. Silva
1 sibling, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2020-05-08 21:15 UTC (permalink / raw)
To: Paul Moore
Cc: Gustavo A. R. Silva, Eric Paris, linux-audit, linux-kernel, Kees Cook
On Tue, Feb 12, 2019 at 08:19:44PM -0500, Paul Moore wrote:
> On Tue, Feb 12, 2019 at 3:46 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
> > In preparation to enabling -Wimplicit-fallthrough, mark switch
> > cases where we are expecting to fall through.
> >
> > This patch fixes the following warning:
> >
> > kernel/auditfilter.c: In function ‘audit_krule_to_data’:
> > kernel/auditfilter.c:668:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > if (krule->pflags & AUDIT_LOGINUID_LEGACY && !f->val) {
> > ^
> > kernel/auditfilter.c:674:3: note: here
> > default:
> > ^~~~~~~
> >
> > Warning level 3 was used: -Wimplicit-fallthrough=3
> >
> > Notice that, in this particular case, the code comment is modified
> > in accordance with what GCC is expecting to find.
> >
> > This patch is part of the ongoing efforts to enable
> > -Wimplicit-fallthrough.
> >
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > ---
> > kernel/auditfilter.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Merged into audit/next, thanks.
>
Thanks, Paul.
--
Gustavo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] audit: mark expected switch fall-through
@ 2020-05-08 21:15 ` Gustavo A. R. Silva
0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2020-05-08 21:15 UTC (permalink / raw)
To: Paul Moore; +Cc: linux-audit, linux-kernel, Gustavo A. R. Silva
On Tue, Feb 12, 2019 at 08:19:44PM -0500, Paul Moore wrote:
> On Tue, Feb 12, 2019 at 3:46 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
> > In preparation to enabling -Wimplicit-fallthrough, mark switch
> > cases where we are expecting to fall through.
> >
> > This patch fixes the following warning:
> >
> > kernel/auditfilter.c: In function ‘audit_krule_to_data’:
> > kernel/auditfilter.c:668:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> > if (krule->pflags & AUDIT_LOGINUID_LEGACY && !f->val) {
> > ^
> > kernel/auditfilter.c:674:3: note: here
> > default:
> > ^~~~~~~
> >
> > Warning level 3 was used: -Wimplicit-fallthrough=3
> >
> > Notice that, in this particular case, the code comment is modified
> > in accordance with what GCC is expecting to find.
> >
> > This patch is part of the ongoing efforts to enable
> > -Wimplicit-fallthrough.
> >
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > ---
> > kernel/auditfilter.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Merged into audit/next, thanks.
>
Thanks, Paul.
--
Gustavo
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-08 21:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 20:46 [PATCH] audit: mark expected switch fall-through Gustavo A. R. Silva
2019-02-13 1:19 ` Paul Moore
2019-02-13 1:54 ` Gustavo A. R. Silva
2020-05-08 21:15 ` Gustavo A. R. Silva
2020-05-08 21:15 ` Gustavo A. R. Silva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.