[Nouveau] [PATCH][next] drm/nouveau: Use fallthrough pseudo-keyword

2020-07-23 Thread Gustavo A. R. Silva
-fall-through Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/dispnv50/disp.c|2 - drivers/gpu/drm/nouveau/nouveau_bo.c |2 - drivers/gpu/drm/nouveau/nouveau_connector.c|4 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c| 34

Re: [Nouveau] [PATCH][next] drm/nouveau: Use fallthrough pseudo-keyword

2020-07-23 Thread Gustavo A. R. Silva
On Wed, Jul 08, 2020 at 01:22:35PM +1000, Ben Skeggs wrote: > On Wed, 8 Jul 2020 at 03:31, Gustavo A. R. Silva > wrote: > > > > Replace the existing /* fall through */ comments and its variants with > > the new pseudo-keyword macro fallthrough[1]. Also, remove unne

Re: [Nouveau] [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Gustavo A. R. Silva
is break; > > Found using: > > $ grep-2.5.4 -rP --include=*.[ch] -n > "fallthrough;(\s*(case\s+\w+|default)\s*:\s*){1,7}break;" * > > Miscellanea: > > o Move or coalesce a couple label blocks above a default: block. > > Signed-off-by:

[Nouveau] [PATCH 082/141] drm/nouveau: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of break statements instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[Nouveau] [PATCH 083/141] drm/nouveau/therm: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev

[Nouveau] [PATCH 081/141] drm/nouveau/clk: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev

Re: [Nouveau] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
Hi, On 11/20/20 12:53, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: >> This series aims to fix almost all remaining fall-through warnings in >> order to enable -Wimplicit-fallthrough for Clang. >> >> In preparation to enable

[Nouveau] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
s://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432 [4] https://godbolt.org/z/xgkvIh [5] commit a035d552a93b ("Makefile: Globally enable fall-through warning") [6] commit 4169e889e588 ("include: jhash/signal: Fix fall-through warnings for Clang") Thanks! Gustavo A. R. Silva (141

Re: [Nouveau] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
On 11/20/20 12:28, Joe Perches wrote: > On Fri, 2020-11-20 at 12:21 -0600, Gustavo A. R. Silva wrote: >> Hi all, >> >> This series aims to fix almost all remaining fall-through warnings in >> order to enable -Wimplicit-fallthrough for Clang. >> >> In prepa

Re: [Nouveau] [Intel-wired-lan] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-23 Thread Gustavo A. R. Silva
On Sun, Nov 22, 2020 at 11:53:55AM -0800, James Bottomley wrote: > On Sun, 2020-11-22 at 11:22 -0800, Joe Perches wrote: > > On Sun, 2020-11-22 at 11:12 -0800, James Bottomley wrote: > > > On Sun, 2020-11-22 at 10:25 -0800, Joe Perches wrote: > > > > On Sun, 2020-11-22 at 10:21 -0800, James Bottoml

Re: [Nouveau] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-24 Thread Gustavo A. R. Silva
On Mon, Nov 23, 2020 at 08:38:46PM +, Mark Brown wrote: > On Fri, 20 Nov 2020 12:21:39 -0600, Gustavo A. R. Silva wrote: > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > > > In prepa

Re: [Nouveau] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-24 Thread Gustavo A. R. Silva
On Mon, Nov 23, 2020 at 04:03:45PM -0400, Jason Gunthorpe wrote: > On Fri, Nov 20, 2020 at 12:21:39PM -0600, Gustavo A. R. Silva wrote: > > > IB/hfi1: Fix fall-through warnings for Clang > > IB/mlx4: Fix fall-through warnings for Clang > > IB/qedr: Fix fall-th

Re: [Nouveau] [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Gustavo A. R. Silva
On Tue, Dec 01, 2020 at 12:52:27AM -0500, Martin K. Petersen wrote: > > Gustavo, > > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > Applied 20-22,54,120-124 to 5.11/scsi-staging, thanks. Awesome! :) Thanks, Mart

[Nouveau] [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-03-05 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev

[Nouveau] [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-03-05 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of break statements instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[Nouveau] [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-03-05 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-04-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? Thanks -- Gustavo On 3/5/21 03:56, Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > by explicitly adding a break statement instead of letting the code fall > through to the

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-04-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? Thanks -- Gustavo On 3/5/21 03:56, Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple > of warnings by explicitly adding a couple of break statements instead > of letting the code fall t

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-04-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? Thanks -- Gustavo On 3/5/21 03:58, Gustavo A. R. Silva wrote: > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning > by explicitly adding a break statement instead of letting the code fall > through to the

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-06-01 Thread Gustavo A. R. Silva
stavo A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this, please? > > Thanks > -- > Gustavo > > On 3/5/21 03:56, Gustavo A. R. Silva wrote: >> In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple >> of warnings by explicitly

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-06-01 Thread Gustavo A. R. Silva
stavo A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this, please? > > Thanks > -- > Gustavo > > On 3/5/21 03:56, Gustavo A. R. Silva wrote: >> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning >> by explicitly adding a

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-06-01 Thread Gustavo A. R. Silva
stavo A. R. Silva wrote: > Hi all, > > Friendly ping: who can take this, please? > > Thanks > -- > Gustavo > > On 3/5/21 03:58, Gustavo A. R. Silva wrote: >> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning >> by explicitly adding a

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau/therm: Fix fall-through warnings for Clang

2021-06-03 Thread Gustavo A. R. Silva
Hi all, If you don't mind, I'm taking this in my -next[1] branch for v5.14. Thanks -- Gustavo [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp On 6/1/21 17:58, Gustavo A. R. Silva wrote: > Hi, > > Friendly second ping: who ca

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau: Fix fall-through warnings for Clang

2021-06-03 Thread Gustavo A. R. Silva
drivers? No other person has replied after pinging multiple times and resending these patches, so I guess people don't care. I'll add this and the other similar patches to my -next branch for 5.14. Thanks, Karol. -- Gustavo > > On Wed, Jun 2, 2021 at 1:16 AM Gustavo A. R. Silva

Re: [Nouveau] [PATCH RESEND][next] drm/nouveau/clk: Fix fall-through warnings for Clang

2021-06-03 Thread Gustavo A. R. Silva
Hi all, If you don't mind, I'm taking this in my -next[1] branch for v5.14. Thanks -- Gustavo [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp On 6/1/21 17:57, Gustavo A. R. Silva wrote: > Hi, > > Friendly second ping: who ca

[Nouveau] [PATCH][next] nouveau/svm: Use kvcalloc() instead of kvzalloc()

2021-09-28 Thread Gustavo A. R. Silva
Use 2-factor argument form kvcalloc() instead of kvzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b

Re: [Nouveau] [PATCH][next] nouveau/svm: Use kvcalloc() instead of kvzalloc()

2021-10-28 Thread Gustavo A. R. Silva
that kvcalloc checks whether the multiplication overflows and > > returns NULL in this case? > > That's correct. :) > > > On Wed, Sep 29, 2021 at 12:21 AM Gustavo A. R. Silva > > wrote: > > > > > > Use 2-factor argument form kvcalloc() instead of

[Nouveau] [PATCH][next] nouveau/svm: Use struct_size() helper in nouveau_pfns_map()

2022-02-07 Thread Gustavo A. R. Silva
Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worse scenario, could lead to heap overflows. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu

Re: [Nouveau] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-20 Thread Gustavo A. R. Silva
On Wed, Feb 16, 2022 at 08:05:47PM +0100, Rafael J. Wysocki wrote: > On Tue, Feb 15, 2022 at 8:24 PM Gustavo A. R. Silva > wrote: > > Can you also send the ACPI patch separately, please? > > We would like to route it through the upstream ACPICA code base. Yeah; no problem. Thanks -- Gustavo

Re: [Nouveau] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-20 Thread Gustavo A. R. Silva
On Tue, Feb 15, 2022 at 09:19:29PM +0200, Leon Romanovsky wrote: > On Tue, Feb 15, 2022 at 01:21:10PM -0600, Gustavo A. R. Silva wrote: > > On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > > > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: >

Re: [Nouveau] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-20 Thread Gustavo A. R. Silva
On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: > > There is a regular need in the kernel to provide a way to declare > > having a dynamically sized set of trailing elements in a structure. > &g

[Nouveau] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-20 Thread Gustavo A. R. Silva
off-by: Gustavo A. R. Silva --- Hi all, I'm expecting to carry this patch in my tree, so it'd be great to get some Acks. And given the size of the patch, I'm only sending this to mailing lists. Thanks! arch/alpha/include/asm/hwrpb.h| 2 +- arch/ia64

Re: [Nouveau] [PATCH] drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array

2022-11-18 Thread Gustavo A. R. Silva
ude Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Gourav Samaiya > Cc: "Gustavo A. R. Silva" > Cc: dri-de...@lists.freedesktop.org > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo >

Re: [Nouveau] [RESEND][PATCH] drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array

2023-01-03 Thread Gustavo A. R. Silva
ude Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Gourav Samaiya > Cc: "Gustavo A. R. Silva" > Cc: dri-de...@lists.freedesktop.org > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Kees Cook Here is my RB again: Reviewed-by: Gustavo A. R. Silva T

[Nouveau] [PATCH][next] drm/nouveau/nvkm: Replace zero-length array with flexible-array member

2023-01-09 Thread Gustavo A. R. Silva
/issues/78 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/include/nvfw/hs.h b/drivers/gpu/drm/nouveau/include/nvfw/hs.h index 8c4cd08a7b5f..8b58b668fc0c 100644 --- a

[PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-08-21 Thread Gustavo A. R. Silva
: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-08-27 Thread Gustavo A. R. Silva
On 22/08/24 11:27, Kees Cook wrote: On Wed, Aug 21, 2024 at 02:16:21PM -0600, Gustavo A. R. Silva wrote: Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? 🙂 Thanks -Gustavo On 21/08/24 22:16, Gustavo A. R. Silva wrote: Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest

[Nouveau] [PATCH] drm/nouveau/mmu: use struct_size() helper

2019-05-24 Thread Gustavo A. R. Silva
, data, mmu->kind_nr) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvif/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvif/mmu.c b/drivers/gpu/drm/nouveau/nvif/mm

[PATCH] drm/nouveau/nvif/mmu: Use struct_size() helper

2019-08-07 Thread Gustavo A. R. Silva
ed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvif/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvif/mmu.c b/drivers/gpu/drm/nouveau/nvif/mmu.c index ae08a1ca8044..5641bda2046d 100644 --- a/drivers/gpu/drm/nouveau/nvif/mmu.c +++ b/driver

[Nouveau] [PATCH] drm/nouveau/devinit/nv04: mark expected switch fall-throughs

2017-11-02 Thread Gustavo A. R. Silva
-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c index 158977f..c3dae05 100644

[Nouveau] [PATCH] drm/nouveau/bios/timing: mark expected switch fall-throughs

2017-11-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1260018 Addresses-Coverity-ID: 1260019 Addresses-Coverity-ID: 1260022 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/timing.c | 5

[Nouveau] [drm-nouveau-mmu] question about potential NULL pointer dereference

2018-02-13 Thread Gustavo A. R. Silva
Hi all, While doing some static analysis I ran into the following piece of code at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:957: 957#define node(root, dir) ((root)->head.dir == &vmm->list) ? NULL : \ 958list_entry((root)->head.dir, struct nvkm_vma, head) 959

Re: [Nouveau] [drm-nouveau-mmu] question about potential NULL pointer dereference

2018-02-13 Thread Gustavo A. R. Silva
Quoting Ben Skeggs : On Wed, Feb 14, 2018 at 1:40 AM, Gustavo A. R. Silva wrote: Hi all, While doing some static analysis I ran into the following piece of code at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:957: 957#define node(root, dir) ((root)->head.dir == &vmm->li

[Nouveau] [PATCH] drm/nouveau/secboot: remove VLA usage

2018-03-23 Thread Gustavo A. R. Silva
kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c b/drivers

Re: [Nouveau] [PATCH] drm/nouveau/secboot: remove VLA usage

2018-03-23 Thread Gustavo A. R. Silva
Hi David, On 03/13/2018 11:10 AM, David Laight wrote: From: Gustavo A. R. Silva Sent: 13 March 2018 14:48 In preparation to enabling -Wvla, remove VLA. In this particular case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local variable cmdline_size. Also, remove cmdline_size as it

[Nouveau] [PATCH v2] drm/nouveau/secboot: remove VLA usage

2018-03-23 Thread Gustavo A. R. Silva
kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change is based on the feedback provided by David Laight. Thanks David. drivers/gpu/drm/nouveau/nvkm/subdev/secboot

[Nouveau] [PATCH] drm/nouveau/nvkm: mark expected switch fall-throughs

2018-06-26 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c| 17 + drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c | 1 + drivers/gpu

[Nouveau] [PATCH] drm/nouveau/secboot/acr: fix memory leak

2018-07-24 Thread Gustavo A. R. Silva
In case memory resources for *bl_desc* were allocated, release them before return. Addresses-Coverity-ID: 1472021 ("Resource leak") Fixes: 0d466901552a ("drm/nouveau/secboot/acr: Remove VLA usage") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev/se

Re: [Nouveau] [PATCH] drm/nouveau/secboot/acr: fix memory leak

2018-08-02 Thread Gustavo A. R. Silva
Hi all, Friendly ping! Who can take this? Thanks -- Gustavo On 07/24/2018 08:27 AM, Gustavo A. R. Silva wrote: > In case memory resources for *bl_desc* were allocated, release > them before return. > > Addresses-Coverity-ID: 1472021 ("Resource leak") > Fixes: 0d4669015

[Nouveau] [PATCH] drm/nouveau/nvkm: mark expected switch fall-throughs

2018-10-17 Thread Gustavo A. R. Silva
ot;) Addresses-Coverity-ID: 141435 ("Missing break in switch") Addresses-Coverity-ID: 141436 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c| 17 + drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c

Re: [Nouveau] [PATCH] drm/nouveau/nvkm: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva
Hi, Friendly ping: Who can take this? Thanks -- Gustavo On 10/17/18 9:28 AM, Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch aims to suppress 29 missing-break-in-switch false positives

[Nouveau] [PATCH] drm/nouveau: mark expected switch fall-through

2019-01-29 Thread Gustavo A. R. Silva
: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm

Re: [Nouveau] [PATCH] drm/nouveau: fix missing break in switch statement

2019-01-29 Thread Gustavo A. R. Silva
On 1/29/19 2:49 PM, Gustavo A. R. Silva wrote: > > > On 10/8/18 3:47 PM, Colin King wrote: >> From: Colin Ian King >> >> The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls >> through to the following NOUVEAU_GETPARAM_BUS_TYPE case a

Re: [Nouveau] [PATCH] drm/nouveau: fix missing break in switch statement

2019-01-29 Thread Gustavo A. R. Silva
Fix this by adding > in the missing break. > > Detected by CoverityScan, CID#1460507 ("Missing break in switch") > > Fixes: 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() > usage") > Signed-off-by: Colin Ian King Reviewed-by: Gusta

Re: [Nouveau] [PATCH] drm/nouveau: mark expected switch fall-through

2019-01-29 Thread Gustavo A. R. Silva
Ben, I wonder if you can take this too: https://lore.kernel.org/patchwork/patch/1001180/ Thanks -- Gustavo On 1/29/19 8:51 PM, Ben Skeggs wrote: > Got it, thanks. > > On Wed, 30 Jan 2019 at 06:55, Gustavo A. R. Silva > wrote: >> >> In preparation to enabling -Wim

[Nouveau] [PATCH] drm/nouveau/abi16: add missing break in switch statement

2019-02-11 Thread Gustavo A. R. Silva
orm) { ^~ drivers/gpu/drm/nouveau/nouveau_abi16.c:217:2: note: here case NOUVEAU_GETPARAM_FB_SIZE: ^~~~ This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 + 1 file changed, 1 insert

Re: [Nouveau] [PATCH] drm/nouveau/nvkm: mark expected switch fall-throughs

2019-02-15 Thread Gustavo A. R. Silva
Hello, Friendly ping (second one): Who can take this, please? Thanks -- Gustavo On 1/10/19 1:33 PM, Gustavo A. R. Silva wrote: > Hi, > > Friendly ping: > > Who can take this? > > Thanks > -- > Gustavo > > On 10/17/18 9:28 AM, Gustavo A. R. Silva wro

[Nouveau] [PATCH] drm: Mark expected switch fall-throughs

2019-02-15 Thread Gustavo A. R. Silva
ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 1 + drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 ++ drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 2 ++ drivers/gpu/drm/amd

Re: [Nouveau] [PATCH] drm/nouveau/bo: mark expected switch fall-through

2019-02-15 Thread Gustavo A. R. Silva
Hi, Please drop this, as I have included this fix into the following patch, which addresses all the expected fall-throughs in drivers/gpu/drm: https://lore.kernel.org/patchwork/patch/1042856/ Thanks -- Gustavo On 2/11/19 12:58 PM, Gustavo A. R. Silva wrote: > In preparation to enabl

Re: [Nouveau] [PATCH] drm: Mark expected switch fall-throughs

2019-02-15 Thread Gustavo A. R. Silva
On 2/15/19 10:11 AM, Alex Deucher wrote: > On Fri, Feb 15, 2019 at 11:08 AM Gustavo A. R. Silva > wrote: >> >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we are expecting to fall through. >> >> Warning level 3 was used: -

Re: [Nouveau] [PATCH] drm/nouveau/bo: mark expected switch fall-through

2019-02-15 Thread Gustavo A. R. Silva
Hi all, Alex Deucher requested me to send separate patches for each driver, which makes this patch available to be taken, again. Thanks -- Gustavo On 2/15/19 10:02 AM, Gustavo A. R. Silva wrote: > Hi, > > Please drop this, as I have included this fix into > the following patch, whi

[Nouveau] [PATCH] gpu: drm: nouveau: add null check before pointer dereference

2017-05-23 Thread Gustavo A. R. Silva
Add null check before dereferencing pointer asyc Addresses-Coverity-ID: 1397932 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nv50_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau

Re: [Nouveau] [PATCH] drm/nouveau/disp: More DP_RECEIVER_CAP_SIZE array fixes

2023-03-22 Thread Gustavo A. R. Silva
ire_dp(struct nvif_outp *outp, u8 dpcd[DP_RECEIVER_CAP_SIZE], | ~~~^~ Fixes: 813443721331 ("drm/nouveau/disp: move DP link config into acquire") Cc: Ben Skeggs Cc: Lyude Paul Cc: Karol Herbst Cc: David Air

[Nouveau] [PATCH 0/2][next] nouveau/svm: Replace one-element array with flexible-array member

2023-08-16 Thread Gustavo A. R. Silva
This small series aims to replace a one-element array with a flexible-array member in struct nouveau_svm. And, while at it, fix a checkpatch.pl error. Gustavo A. R. Silva (2): nouveau/svm: Replace one-element array with flexible-array member in struct nouveau_svm nouveau/svm: Split

[Nouveau] [PATCH 1/2][next] nouveau/svm: Replace one-element array with flexible-array member in struct nouveau_svm

2023-08-16 Thread Gustavo A. R. Silva
One-element and zero-length arrays are deprecated. So, replace one-element array in struct nouveau_svm with flexible-array member. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/338 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau

[Nouveau] [PATCH 2/2][next] nouveau/svm: Split assignment from if conditional

2023-08-16 Thread Gustavo A. R. Silva
Fix checkpatch.pl ERROR: do not use assignment in if condition. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_svm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index

Re: [PATCH 3/9] drm/i915/selftests: Annotate struct perf_series with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Airlie Cc: Daniel Vetter Cc: Chris Wilson Cc: John Harrison Cc: Andi Shyti Cc: Matthew Brost Cc: intel-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/i915/selftests

Re: [Nouveau] [PATCH 2/9] drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Cc: David Airlie Cc: Daniel Vetter Cc: Hawking Zhang Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH 4/9] drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Cc: David Airlie Cc: Daniel Vetter Cc: Bjorn Andersson Cc: linux-arm-...@vger.kernel.org Cc: dri-de...@lists.freedesktop.org Cc: freedr...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/msm/disp/dpu1

Re: [PATCH 6/9] drm/vc4: Annotate struct vc4_perfmon with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index bf66499765fb

Re: [Nouveau] [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Xiaojian Du Cc: Huang Rui Cc: Kevin Wang Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/am

Re: [Nouveau] [PATCH 8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm

Re: [Nouveau] [PATCH 7/9] drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc: virtualizat...@lists.linux-foundation.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

Re: [Nouveau] [PATCH 5/9] drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by

2023-09-24 Thread Gustavo A. R. Silva
Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau

[Nouveau] [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-16 Thread Gustavo A. R. Silva
subscript 0 is outside array bounds of 'PACKED_REGISTRY_ENTRY[0]' [-Warray-bounds=] While there, also make use of the struct_size() helper, and address checkpatch.pl warning: WARNING: please, no spaces at the start of a line This results in no differences in binary output. Signed-of

Re: [Nouveau] [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-28 Thread Gustavo A. R. Silva
On 11/28/23 19:01, Danilo Krummrich wrote: On 11/16/23 20:55, Timur Tabi wrote: On Thu, 2023-11-16 at 20:45 +0100, Danilo Krummrich wrote: As I already mentioned for Timur's patch [2], I'd prefer to get a fix upstream (meaning [1] in this case). Of course, that's probably more up to Timur to

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-10-03 Thread Gustavo A. R. Silva
On 03/10/24 12:36, Danilo Krummrich wrote: On 9/13/24 12:23 PM, Danilo Krummrich wrote: Hi, On 9/13/24 10:09 AM, Gustavo A. R. Silva wrote: Hi all, Friendly ping: who can take this, please? 🙂 Usually, that's me. But I thought you might want to send a v2 based on Kees' comm

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-10-03 Thread Gustavo A. R. Silva
Yes, it's not great, but I think it's better than having the length in two places. Agreed. I'll respin. :) Thanks -- Gustavo

[PATCH][next] drm/nouveau: Avoid multiple -Wflex-array-member-not-at-end warnings

2025-02-12 Thread Gustavo A. R. Silva
] drivers/gpu/drm/nouveau/nouveau_svm.c:82:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/include/nvif/ioctl.h | 32 +--- drivers/gpu/drm

[PATCH][next] drm/nouveau: fence: Avoid -Wflex-array-member-not-at-end warning

2025-04-05 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/nouveau_fence.c:188:38: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

Re: [PATCH][next] drm/nouveau: chan: Avoid -Wflex-array-member-not-at-end warnings

2025-04-07 Thread Gustavo A. R. Silva
[..] - struct { - struct nvif_chan_v0 chan; - char name[TASK_COMM_LEN+16]; - } args; + DEFINE_RAW_FLEX(struct nvif_chan_v0, args, name, TASK_COMM_LEN + 16); struct nvif_device *device = &cli->device; struct nouveau_channel *chan;

Re: [PATCH][next] drm/nouveau: chan: Avoid -Wflex-array-member-not-at-end warnings

2025-04-07 Thread Gustavo A. R. Silva
On 07/04/25 13:50, Kees Cook wrote: On Thu, Apr 03, 2025 at 10:45:18AM -0600, Gustavo A. R. Silva wrote: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for a few on-stack definitions of a flexible

Re: [PATCH][next] drm/nouveau: chan: Avoid -Wflex-array-member-not-at-end warnings

2025-04-11 Thread Gustavo A. R. Silva
On 08/04/25 17:40, Kees Cook wrote: On Mon, Apr 07, 2025 at 05:35:47PM -0600, Gustavo A. R. Silva wrote: [..] - struct { - struct nvif_chan_v0 chan; - char name[TASK_COMM_LEN+16]; - } args; + DEFINE_RAW_FLEX(struct nvif_chan_v0, args, name

[PATCH][next] drm/nouveau: disp: Use __member_size() helper

2025-04-22 Thread Gustavo A. R. Silva
Use __member_size() to get the size of the flex-array member at compile time, instead of the convoluted expression `__struct_size(p) - sizeof(*p)` Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH][next] drm/nouveau: outp: Use __member_size() helper

2025-04-22 Thread Gustavo A. R. Silva
Use __member_size() to get the size of the flex-array member at compile time, instead of the convoluted expression `__struct_size(p) - sizeof(*p)` Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvif/outp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH v2][next] drm/nouveau: chan: Avoid -Wflex-array-member-not-at-end warnings

2025-04-16 Thread Gustavo A. R. Silva
] Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Use __member_size() instead of __struct_size() to get the compile-time size of the flexible array. v1: - Link: https://lore.kernel.org/linux-hardening/Z-67Hm9uHEJs0RGw@kspp/ drivers/gpu/drm/nouveau/nouveau_chan.c | 114

Re: [PATCH][next] drm/nouveau: Avoid multiple -Wflex-array-member-not-at-end warnings

2025-02-27 Thread Gustavo A. R. Silva
> Applied to drm-misc-next, thanks! Awesome. :) Thank you, guys. -- Gustavo

Re: [PATCH][next] drm/nouveau/outp: Avoid -Wflex-array-member-not-at-end warning

2025-03-28 Thread Gustavo A. R. Silva
On 28/03/25 09:05, Danilo Krummrich wrote: On Fri, Mar 28, 2025 at 08:45:32AM -0600, Gustavo A. R. Silva wrote: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a

[PATCH v2][next] drm/nouveau/outp: Avoid -Wflex-array-member-not-at-end warning

2025-03-28 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/nvif/outp.c:199:45: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- Changes in v2

[PATCH][next] drm/nouveau/outp: Avoid -Wflex-array-member-not-at-end warning

2025-03-28 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/nvif/outp.c:199:45: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH][next] drm/nouveau/conn: Avoid -Wflex-array-member-not-at-end warning

2025-03-28 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/nvif/conn.c:34:38: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH v2][next] drm/nouveau: fifo: Avoid -Wflex-array-member-not-at-end warning

2025-04-04 Thread Gustavo A. R. Silva
/nouveau/nvif/fifo.c:29:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Adjust heap allocation instead of using the DEFINE_RAW_FLEX() helper. - Link: https

Re: [PATCH][next] drm/nouveau: fifo: Avoid -Wflex-array-member-not-at-end warning

2025-04-04 Thread Gustavo A. R. Silva
On 03/04/25 11:41, Gustavo A. R. Silva wrote: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known

Re: [PATCH v2][next] drm/nouveau: disp: Avoid -Wflex-array-member-not-at-end warning

2025-04-03 Thread Gustavo A. R. Silva
Applied this one (as well as the svm and fence one) to drm-misc-next, thanks! Awesome. :) Thanks! -- Gustavo

[PATCH][next] drm/nouveau: fifo: Avoid -Wflex-array-member-not-at-end warning

2025-04-03 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/nvif/fifo.c:29:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH][next] drm/nouveau: chan: Avoid -Wflex-array-member-not-at-end warnings

2025-04-03 Thread Gustavo A. R. Silva
] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nouveau_chan.c | 115 - 1 file changed, 56 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index cd659b9fd1d9..a7e70517b7cd 100644 --- a

[PATCH][next] drm/nouveau: svm: Avoid -Wflex-array-member-not-at-end warning

2025-04-02 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/nouveau_svm.c:724:44: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH v2][next] drm/nouveau: disp: Avoid -Wflex-array-member-not-at-end warning

2025-04-02 Thread Gustavo A. R. Silva
, accordingly. So, with these changes, fix the following warning: drivers/gpu/drm/nouveau/dispnv50/disp.c:779:47: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- Changes in v2