[GIT PULL] Compiler Attributes for v4.20-rc1

2018-10-22 Thread Miguel Ojeda
Hi Linus, Here it is the Compiler Attributes series/tree, which tries to disentangle the include/linux/compiler*.h headers and bring them up to date. The patches have been in linux-next for a while, *except* the last two from Nick which came a bit later. Since AFAIU there will be no linux-next th

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Nick Desaulniers
On Mon, Oct 22, 2018 at 11:15 AM Bernd Petrovitsch wrote: > > Hi all! > > On 22/10/18 19:54, Nick Desaulniers wrote: > > On Mon, Oct 22, 2018 at 10:50 AM Bernd Petrovitsch > > wrote: > [...] > >> PS: clang++ errors with "fallthrough annotation in unreachable code" if > >> [[fallthrough]] is a

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Willy Tarreau
On Mon, Oct 22, 2018 at 02:58:00AM -0400, Theodore Y. Ts'o wrote: > On Sun, Oct 21, 2018 at 05:42:18PM -0700, Matthew Wilcox wrote: > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > > +#if __has_attribute(__fallthrough__) > > > +# define __fallthrough __attribut

Re: [RESEND PATCH v5 0/9] extend PWM framework to support PWM modes

2018-10-22 Thread Uwe Kleine-König
Hello Claudiu, On Tue, Aug 28, 2018 at 04:01:17PM +0300, Claudiu Beznea wrote: > Please give feedback on these patches which extends the PWM framework in > order to support multiple PWM modes of operations. This series is a rework > of [1] and [2]. > > The current patch series add the following P

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 12:27 AM Theodore Y. Ts'o wrote: > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > From the GCC manual: > > > > fallthrough > > > > The fallthrough attribute with a null statement serves as a > > fallthrough statement. It hints to the compiler

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 2:42 AM Matthew Wilcox wrote: > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > +#if __has_attribute(__fallthrough__) > > +# define __fallthrough __attribute__((__fallthrough__)) > > +#else > > +# define __fallthrough > > +#endif > > Why

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Kees Cook
On Mon, Oct 22, 2018 at 2:26 AM, Miguel Ojeda wrote: > On Mon, Oct 22, 2018 at 12:27 AM Theodore Y. Ts'o wrote: >> >> On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: >> > From the GCC manual: >> > >> > fallthrough >> > >> > The fallthrough attribute with a null statement serve

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 11:36 AM Kees Cook wrote: > > We need to make sure the static analyzers are happy with either > method. Additionally, when was -Wimplicit-fallthrough added to GCC? If > it was added _before_ the attribute, we need to continue using the > comment style otherwise we lose cove

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 11:41 AM Miguel Ojeda wrote: > > * clang does *not* support the attribute in C. ...nor the warning at all, by the way (which is why this is OK). Cheers, Miguel

Re: [PATCH 0/2] Compiler Attributes: __fallthrough

2018-10-22 Thread Miguel Ojeda
On Sun, Oct 21, 2018 at 8:29 PM Greg Kroah-Hartman wrote: > > On Sun, Oct 21, 2018 at 07:14:12PM +0200, Miguel Ojeda wrote: > > These are two patches are meant to go on top of the rest of the compiler > > attributes series on: > > > > https://github.com/ojeda/linux/tree/compiler-attributes > > >

Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough

2018-10-22 Thread Miguel Ojeda
On Sun, Oct 21, 2018 at 8:11 PM Joe Perches wrote: > > On Sun, 2018-10-21 at 19:14 +0200, Miguel Ojeda wrote: > > Let gcc know these cases are meant to fall through to the next label > > by annotating them with the new __fallthrough statement attribute; > > and remove the comment since it conveys

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Bernd Petrovitsch
On 22/10/2018 00:27, Theodore Y. Ts'o wrote: > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: >> From the GCC manual: >> >> fallthrough >> >> The fallthrough attribute with a null statement serves as a >> fallthrough statement. It hints to the compiler that a statement >>

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Dan Carpenter
On Mon, Oct 22, 2018 at 11:41:56AM +0200, Bernd Petrovitsch wrote: > On 22/10/2018 00:27, Theodore Y. Ts'o wrote: > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > >> From the GCC manual: > >> > >> fallthrough > >> > >> The fallthrough attribute with a null statement serves

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Bernd Petrovitsch
On 22/10/18 12:27, Dan Carpenter wrote: [...] > What does that even mean? Use both the attribute and the comment until > Eclipse is updated? > > case 3: > frob(); > __fall_through; /* fall through */ > case 4: > > That seems like a wrong idea... It's more

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Dan Carpenter
On Mon, Oct 22, 2018 at 12:45:03PM +0200, Bernd Petrovitsch wrote: > It's more like > snip > case 3: > frob(); > __fall_through; > /* no break - fall through */ > case 4: > snip > as "eclipse" doesn't accept anything else

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Kees Cook
On Mon, Oct 22, 2018 at 2:41 AM, Miguel Ojeda wrote: > On Mon, Oct 22, 2018 at 11:36 AM Kees Cook wrote: >> >> We need to make sure the static analyzers are happy with either >> method. Additionally, when was -Wimplicit-fallthrough added to GCC? If >> it was added _before_ the attribute, we need

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 12:54 PM Dan Carpenter wrote: > > Doing both is super ugly. Let's just do comments until Eclipse gets > updated. > > I had wanted to move to the attribute because that would simplify things > in Smatch but it's not a huge deal to delay for another year. I can re-send them

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 12:53 PM Kees Cook wrote: > > On Mon, Oct 22, 2018 at 2:41 AM, Miguel Ojeda > wrote: > > Please take a look at the rationale (also more details at the linked > > thread): > > > > * gcc 7.1 added -Wimplicit-fallthrough at the same time as the > > attribute and the commen

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Luc Van Oostenryck
On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > While comment parsing is a good idea to deal with old codebases > that used such a comment as documentation for humans, the best > solution is to use the attribute: > > * It is a "real" part of the AST (=> better for tooling). T

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 2:07 PM Luc Van Oostenryck wrote: > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > > > While comment parsing is a good idea to deal with old codebases > > that used such a comment as documentation for humans, the best > > solution is to use the attribut

[PATCH v9 2/9] docs: driver-api: Add I3C documentation

2018-10-22 Thread Boris Brezillon
Add the I3C documentation describing the protocol, the master driver API and the device driver API. Signed-off-by: Boris Brezillon Reviewed-by: Randy Dunlap Reviewed-by: Arnd Bergmann --- Changes in v9: - Add Arnd's R-b Changes in v8: - None Changes in v7: - None Changes in v6: - Fix typos r

[PATCH v9 0/9] Add the I3C subsystem

2018-10-22 Thread Boris Brezillon
Hi Greg, I think we've reached a point where we can eventually consider the I3C framework for inclusion in 4.20 (5.0?). Indeed, v8 has received a R-b from Arnd, and I addressed the concerned raised by Joe on the I3C/I2C_DEV() macros. I hope to get an Ack from Rob on the adjusted DT bindings anytim

[PATCH v9 6/9] i3c: master: Add driver for Cadence IP

2018-10-22 Thread Boris Brezillon
Add a driver for Cadence I3C master IP. Signed-off-by: Boris Brezillon Reviewed-by: Arnd Bergmann --- Changes in v9: - Change the 'depends on' rule (suggested by Arnd) - Use {read,write}sl() instead of __raw_{readl,writem}() (suggested by Arnd) - Add Arnd's R-b Changes in v8: - Adjust code to

[PATCH v9 8/9] gpio: Add a driver for Cadence I3C GPIO expander

2018-10-22 Thread Boris Brezillon
Add a driver for Cadence I3C GPIO expander. Signed-off-by: Boris Brezillon Acked-by: Linus Walleij --- Changes in v9: - None Changes in v8: - None Changes in v7: - None Changes in v6: - Use kmalloc_array() instead of kmalloc(N * sizeof(X)) - Add Linus' ack Changes in v5: - Use the !! operato

[PATCH v9 4/9] dt-bindings: i3c: Document core bindings

2018-10-22 Thread Boris Brezillon
A new I3C subsystem has been added and a generic description has been created to represent the I3C bus and the devices connected on it. Document this generic representation. Cc: Rob Herring Signed-off-by: Boris Brezillon --- Rob, Can you have a look at this v9. I know you previously acked this

[PATCH v9 3/9] i3c: Add sysfs ABI spec

2018-10-22 Thread Boris Brezillon
Document sysfs files/directories/symlinks exposed by the I3C subsystem. Signed-off-by: Boris Brezillon Reviewed-by: Arnd Bergmann --- Changes in v9: - Add Arnd's R-b Changes in v8: - None Changes in v7: - Bump KernelVersion to 4.20 - Add new entries under i3c- now that the master controller is

[PATCH v9 7/9] dt-bindings: i3c: Document Cadence I3C master bindings

2018-10-22 Thread Boris Brezillon
Document Cadence I3C master DT bindings. Signed-off-by: Boris Brezillon Reviewed-by: Rob Herring Reviewed-by: Arnd Bergmann --- Changes in v9: - Add Arnd's R-b Changes in v8: - None Changes in v7: - None Changes in v6: - None Changes in v5: - Add Rob's R-b Changes in v4: - Fix example to m

[PATCH v9 5/9] MAINTAINERS: Add myself as the I3C subsystem maintainer

2018-10-22 Thread Boris Brezillon
Create an entry for the I3C subsystem and mark it as maintained by me. There's no official git repository, patchwork instance, mailing list or website yet, but this will be added after the subsystem has been accepted. Signed-off-by: Boris Brezillon --- Changes in v9: - None Changes in v8: - None

[PATCH v9 9/9] dt-bindings: gpio: Add bindings for Cadence I3C gpio expander

2018-10-22 Thread Boris Brezillon
Document the Cadence I3C gpio expander bindings. Signed-off-by: Boris Brezillon Reviewed-by: Rob Herring Reviewed-by: Linus Walleij --- Changes in v9: - Add Linus R-b Changes in v8: - None Changes in v7: - None Changes in v6: - None Changes in v5: - Add Rob's R-b Changes in v4: - Use GPIO_

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 1:24 PM Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 12:53 PM Kees Cook wrote: > > > > On Mon, Oct 22, 2018 at 2:41 AM, Miguel Ojeda > > wrote: > > > > > * clang does *not* support the attribute in C. > > > > Well that's not good. :) > > I will see with clang if they

Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough

2018-10-22 Thread Kees Cook
On Sun, Oct 21, 2018 at 10:14 AM, Miguel Ojeda wrote: > Let gcc know these cases are meant to fall through to the next label > by annotating them with the new __fallthrough statement attribute; > and remove the comment since it conveys the same information > (which was also parsed by gcc to suppre

Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough

2018-10-22 Thread Joe Perches
On Mon, 2018-10-22 at 11:51 +0200, Miguel Ojeda wrote: > On Sun, Oct 21, 2018 at 8:11 PM Joe Perches wrote: > > On Sun, 2018-10-21 at 19:14 +0200, Miguel Ojeda wrote: > > > Let gcc know these cases are meant to fall through to the next label > > > by annotating them with the new __fallthrough stat

Re: [PATCH 0/2] Compiler Attributes: __fallthrough

2018-10-22 Thread Nick Desaulniers
On Mon, Oct 22, 2018 at 2:48 AM Miguel Ojeda wrote: > > On Sun, Oct 21, 2018 at 8:29 PM Greg Kroah-Hartman > wrote: > > > > Will this work with all of the static tools that are currently looking > > for the comment instead? I know coverity handles that, what about > > others? > > I will also con

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Nick Desaulniers
On Mon, Oct 22, 2018 at 2:43 AM Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 11:41 AM Miguel Ojeda > wrote: > > > > * clang does *not* support the attribute in C. > > ...nor the warning at all, by the way (which is why this is OK). > > Cheers, > Miguel Oh? We're going through and annotating

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Nick Desaulniers
On Mon, Oct 22, 2018 at 2:26 AM Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 12:27 AM Theodore Y. Ts'o wrote: > > > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > > From the GCC manual: > > > > > > fallthrough > > > > > > The fallthrough attribute with a null stateme

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Nick Desaulniers
On Mon, Oct 22, 2018 at 3:54 AM Dan Carpenter wrote: > > On Mon, Oct 22, 2018 at 12:45:03PM +0200, Bernd Petrovitsch wrote: > > It's more like > > snip > > case 3: > > frob(); > > __fall_through; > > /* no break - fall through */ > >

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Nick Desaulniers
On Sun, Oct 21, 2018 at 10:14 AM Miguel Ojeda wrote: > > From the GCC manual: > > fallthrough > > The fallthrough attribute with a null statement serves as a > fallthrough statement. It hints to the compiler that a statement > that falls through to another case label, or user-defined

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Bernd Petrovitsch
Hi all! On 22/10/18 13:07, Miguel Ojeda wrote: > On Mon, Oct 22, 2018 at 12:54 PM Dan Carpenter > wrote: >> >> Doing both is super ugly. Let's just do comments until Eclipse gets >> updated. Yes, "Eclipse" as the IDE. And yes but IMHO better super ugly than loosing the warning - YMMV. For th

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Nick Desaulniers
On Mon, Oct 22, 2018 at 10:50 AM Bernd Petrovitsch wrote: > > Hi all! > > On 22/10/18 13:07, Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 12:54 PM Dan Carpenter > > wrote: > >> > >> Doing both is super ugly. Let's just do comments until Eclipse gets > >> updated. > > Yes, "Eclipse" as the ID

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Bernd Petrovitsch
Hi all! On 22/10/18 19:54, Nick Desaulniers wrote: > On Mon, Oct 22, 2018 at 10:50 AM Bernd Petrovitsch > wrote: [...] >> PS: clang++ errors with "fallthrough annotation in unreachable code" if >> [[fallthrough]] is after an assert(). clang-devs there, please, the >> fallthrough doesn't r

Re: [PATCH v9 4/9] dt-bindings: i3c: Document core bindings

2018-10-22 Thread Rob Herring
On Mon, Oct 22, 2018 at 03:33:59PM +0200, Boris Brezillon wrote: > A new I3C subsystem has been added and a generic description has been > created to represent the I3C bus and the devices connected on it. > > Document this generic representation. > > Cc: Rob Herring > Signed-off-by: Boris Brezil

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 7:17 PM Nick Desaulniers wrote: > > On Mon, Oct 22, 2018 at 2:43 AM Miguel Ojeda > wrote: > > > > On Mon, Oct 22, 2018 at 11:41 AM Miguel Ojeda > > wrote: > > > > > > * clang does *not* support the attribute in C. > > > > ...nor the warning at all, by the way (which is

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 7:36 PM Nick Desaulniers wrote: > > On Sun, Oct 21, 2018 at 10:14 AM Miguel Ojeda > wrote: > > > > of its kind) to deal with this: [[fallthrough]] is meant to be > > a new control keyword in the form of an extension. > > I think we can leave the details about the [[]] nota

Re: [PATCH 0/2] Compiler Attributes: __fallthrough

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 6:54 PM Nick Desaulniers wrote: > > On Mon, Oct 22, 2018 at 2:48 AM Miguel Ojeda > wrote: > > > > On Sun, Oct 21, 2018 at 8:29 PM Greg Kroah-Hartman > > wrote: > > > > > > Will this work with all of the static tools that are currently looking > > > for the comment instead

[PATCH] Documentation/proc.txt: Add 2 missing fields for /proc//status

2018-10-22 Thread Waiman Long
It was found that two of the fields in the /proc//status file were missing - CapAmb & Speculation_Store_Bypass. They are now added to the proc.txt documentation file. Signed-off-by: Waiman Long --- Documentation/filesystems/proc.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)

2018-10-22 Thread Miguel Ojeda
On Mon, Oct 22, 2018 at 7:50 PM Bernd Petrovitsch wrote: > > Hi all! > > On 22/10/18 13:07, Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 12:54 PM Dan Carpenter > > wrote: > >> > >> Doing both is super ugly. Let's just do comments until Eclipse gets > >> updated. > > Yes, "Eclipse" as the IDE

Re: [PATCH 0/2] Compiler Attributes: __fallthrough

2018-10-22 Thread Dan Carpenter
On Mon, Oct 22, 2018 at 09:54:27AM -0700, Nick Desaulniers wrote: > On Mon, Oct 22, 2018 at 2:48 AM Miguel Ojeda > wrote: > > > > On Sun, Oct 21, 2018 at 8:29 PM Greg Kroah-Hartman > > wrote: > > > > > > Will this work with all of the static tools that are currently looking > > > for the comment