lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Aug 2019 04:07:58 -0700
From:   Joe Perches <joe@...ches.com>
To:     David Howells <dhowells@...hat.com>
Cc:     Nathan Chancellor <natechancellor@...il.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nathan Huckleberry <nhuck@...gle.com>,
        linux-afs@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] afs: Move comments after /* fallthrough */

On Fri, 2019-08-16 at 11:36 +0100, David Howells wrote:
> Joe Perches <joe@...ches.com> wrote:
> 
> > Here the script would not convert the /* Fall through */
> > because the next non-blank line does not start with
> > case or default
> 
> Convert the "/* Fall through */" to what?
> 
> You said "for a script to appropriately convert case statement blocks with /*
> fallthrough */ comments to a macro".  Can you give an example of what the code
> would look like with this macro emplaced?

Sure.

The basic idea is to use a macro for __attribute__((__fallthrough__))
like:

#define fallthrough __attribute__((__fallthrough__))

though some would prefer __fallthrough to be more similar to
other attribute macros.  I prefer fallthrough; to be more
similar to break;

So it would end up like (just an example, won't apply)

diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index b86195e4dc6c..d962332008aa 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -284,7 +284,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                call->unmarshall++;
 
                /* extract the FID array and its count in two steps */
-               /* fall through */
+               fallthrough;
        case 1:
                _debug("extract FID count");
                ret = afs_extract_data(call, true);
@@ -303,8 +303,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                        return -ENOMEM;
                afs_extract_to_buf(call, call->count * 3 * 4);
                call->unmarshall++;
-
-               /* Fall through */
+               fallthrough;
        case 2:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ