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

2019-08-07 Thread Gustavo A. R. Silva
igned-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

[PATCH] video: fbdev/mmp/core: Use struct_size() in kzalloc()

2019-08-07 Thread Gustavo A. R. Silva
that, in this case, variable size is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/mmp/core.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/mmp/core.c b/drivers

[PATCH] drm/i915/gvt: Fix use-after-free in intel_vgpu_create_workload

2019-08-06 Thread Gustavo A. R. Silva
or its further use. Addresses-Coverity-ID: 1452235 ("Read from pointer after free") Fixes: 2089a76ade90 ("drm/i915/gvt: Checking workload's gma earlier") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/scheduler.c | 8 ++-- 1 file changed, 6 insertions(+),

[PATCH] drm/msm: Use struct_size() helper

2019-08-05 Thread Gustavo A. R. Silva
elp of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/msm/msm_gem_submit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 348f8c2be806..7c17c6154058 100644 --- a/drivers/gpu/

[PATCH] video: fbdev: omapfb_main: Mark expected switch fall-throughs

2019-08-02 Thread Gustavo A. R. Silva
fall through [-Wimplicit-fallthrough=] drivers/video/fbdev/omap/omapfb_main.c:1535:3: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/omap/omapfb_main.c | 8 1 file changed, 8 insertions(+) diff --git

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

2019-07-29 Thread Gustavo A. R. Silva
case 4: ^~~~ drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=] audio_cfg |= HDMI_AUD_CFG_CH34_VALID | HDMI_AUD_CFG_8CH; drivers/gpu/drm/sti/sti_hdmi.c:856:2: note: here case 2: ^~~~ Signed-off-by: Gustavo A. R. Silva --- drivers/gpu

Re: [PATCH] video: fbdev: Mark expected switch fall-through

2019-07-29 Thread Gustavo A. R. Silva
Hi Anders, On 7/26/19 6:28 AM, Anders Roxell wrote: > When fall-through warnings was enabled by default the following warnings > was starting to show up: > > ../drivers/video/fbdev/sh_mobile_lcdcfb.c: In function > ‘sh_mobile_lcdc_channel_fb_init’: >

Re: [PATCH] drm: mali-dp: Mark expected switch fall-through

2019-07-29 Thread Gustavo A. R. Silva
On 7/29/19 4:58 AM, Liviu Dudau wrote: >> case MW_RESTART: >> drm_writeback_signal_completion(>mw_connector, >> 0); >> -/* fall through to a new start */ > > It's a shame that the compiler throws a warning here, it would've been really >

[PATCH] video: fbdev: pvr2fb: remove unnecessary comparison of unsigned integer with < 0

2019-07-22 Thread Gustavo A. R. Silva
There is no need to compare *var->xoffset* or *var->yoffset* with < 0 because such variables are of type unsigned, making it impossible to hold a negative value. Fix this by removing such comparisons. Addresses-Coverity-ID: 1451964 ("Unsigned compared against 0") Signed-o

Re: [PATCH] drm/amdkfd: Fix missing break in switch statement

2019-07-22 Thread Gustavo A. R. Silva
On 7/22/19 2:45 PM, Alex Deucher wrote: >> >> By the way, Alex, I'm planning to add these fixes to my tree. I want >> to send a pull-request to Linus for v5.3-rc2 this afternoon. We want >> to have the -Wimplicit-fallthrough option globally enabled in v5.3, >> and these are some of the last

Re: [PATCH] drm/amdgpu/gfx10: Fix missing break in switch statement

2019-07-22 Thread Gustavo A. R. Silva
On 7/22/19 2:12 PM, Alex Deucher wrote: > On Sun, Jul 21, 2019 at 6:39 PM Gustavo A. R. Silva > wrote: >> >> Add missing break statement in order to prevent the code from falling >> through to case AMDGPU_IRQ_STATE_ENABLE. >> >> This bug was found tha

[PATCH] drm/i915: Mark expected switch fall-throughs

2019-07-22 Thread Gustavo A. R. Silva
_OUTPUT_DP: ^~~~ Also, notice that the Makefile is modified in order to stop ignoring fall-through warnings. The -Wimplicit-fallthrough option will be enabled globally in v5.3. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. S

[PATCH] drm/amdkfd/kfd_mqd_manager_v10: Avoid fall-through warning

2019-07-22 Thread Gustavo A. R. Silva
o pr_debug() in KFD_MQD_TYPE_CP: "The mqd init for CP and COMPUTE will have the same routine." [1] This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough. [1] https://lore.kernel.org/lkml/c735a1cc-a545-50fb-44e7-c0ad93ee8...@amd.com/ Signed-off-by:

Re: [PATCH] drm/amdkfd/kfd_mqd_manager_v10: Fix missing break in switch statement

2019-07-22 Thread Gustavo A. R. Silva
func__, __LINE__); mqd->allocate_mqd = allocate_mqd; Thanks -- Gustavo > Alex > > From: Liu, Shaoyun > Sent: Monday, July 22, 2019 11:14 AM > To: Gustavo A. R. Silva ; Cox, Philip > ; Oded Gabbay ; Deucher, Alexander &

[PATCH] drm/amdkfd/kfd_mqd_manager_v10: Fix missing break in switch statement

2019-07-21 Thread Gustavo A. R. Silva
org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c index 4f8a6ffc5775..1d8b13ad46f9 100644 --- a/drive

[PATCH] drm/amdgpu/gfx10: Fix missing break in switch statement

2019-07-21 Thread Gustavo A. R. Silva
org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 1675d5837c3c..35e8e29139b1 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10

[PATCH] drm/amdkfd: Fix missing break in switch statement

2019-07-21 Thread Gustavo A. R. Silva
Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 792371442195..4e3fc284f6ac 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drive

Re: [PATCH] video: fbdev: s3c-fb: Mark expected switch fall-throughs

2019-06-25 Thread Gustavo A. R. Silva
On 6/25/19 11:52 AM, Joe Perches wrote: > On Tue, 2019-06-25 at 11:01 -0500, Gustavo A. R. Silva wrote: >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we are expecting to fall through. > [] >> This patch is part of the ongoing efforts

[PATCH] video: fbdev: s3c-fb: Mark expected switch fall-throughs

2019-06-25 Thread Gustavo A. R. Silva
mments are 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 --- drivers/video/fbdev/s3c-fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/driv

[PATCH] video: fbdev-MMP: Use struct_size() in devm_kzalloc()

2019-06-04 Thread Gustavo A. R. Silva
size is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b

[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/i915/kvmgt: Use struct_size() helper

2019-05-24 Thread Gustavo A. R. Silva
rse, areas, sparse->nr_areas) and so on... Also, notice that variable size is unnecessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/kvmgt.c | 12 +--- 1 file changed, 5 insertions(+), 7 del

Re: [PATCH] gpu: drm: use struct_size() in kmalloc()

2019-05-21 Thread Gustavo A. R. Silva
On 5/21/19 3:59 AM, Christian König wrote: > BTW: Is there actually good documentation how to correctly do the variable > length array at end of structure thing in the kernel? > > I do know that I've seen a lot of different variants like array[] array[0] or > array[1] and I have also seen a

Re: [PATCH] gpu: drm: use struct_size() in kmalloc()

2019-05-20 Thread Gustavo A. R. Silva
On 5/20/19 12:41 PM, Alex Deucher wrote: > On Fri, May 17, 2019 at 8:43 AM xiaolinkui wrote: >> >> Use struct_size() helper to keep code simple. >> Again, this is not the reason why this helper was created. >> Signed-off-by: xiaolinkui >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3

Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param

2019-03-21 Thread Gustavo A. R. Silva
Hi Harry, I noticed this patch is already in mainline, but the stable tag was removed. What is the reason for that if this bug is present in stable? Thanks -- Gustavo On 1/3/19 3:11 PM, Wentland, Harry wrote: > On 2019-01-03 2:48 p.m., Gustavo A. R. Silva wrote: >> Fix boolean e

Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param

2019-03-21 Thread Gustavo A. R. Silva
On 3/21/19 10:14 PM, Joe Perches wrote: > On Thu, 2019-03-21 at 22:10 -0500, Gustavo A. R. Silva wrote: >> Hi Harry, >> >> I noticed this patch is already in mainline, but the stable tag >> was removed. What is the reason for that if this bug is present >> in

Re: [PATCH] xen, fbfront: mark expected switch fall-through

2019-03-20 Thread Gustavo A. R. Silva
Hi all, Friendly ping: Who can take this? Thanks -- Gustavo On 2/28/19 5:51 AM, Oleksandr Andrushchenko wrote: > +Xen-devel list > > On 2/27/19 10:53 PM, Gustavo A. R. Silva wrote: >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we

Re: [PATCH] drm/amdkfd: Fix unchecked return value

2019-03-18 Thread Gustavo A. R. Silva
On 3/18/19 1:25 PM, Kuehling, Felix wrote: > Alex already applied an equivalent patch by Colin King (attached for > reference). > Oh, that's great. Good to know. Thanks, Felix. -- Gustavo ___ dri-devel mailing list dri-devel@lists.freedesktop.org

[PATCH] drm/amdkfd: Fix unchecked return value

2019-03-18 Thread Gustavo A. R. Silva
Assign return value of function amdgpu_bo_sync_wait() to variable ret for its further check. Addresses-Coverity-ID: 1443914 ("Logically dead code") Fixes: c60cd590cb7d ("drm/amdgpu: Replace ttm_bo_wait with amdgpu_bo_sync_wait") Signed-off-by: Gustavo A. R. Silva --- driver

Re: [PATCH] drm/amdgpu/powerplay: Fix missing break in switch statement

2019-03-01 Thread Gustavo A. R. Silva
On 3/1/19 5:54 PM, Alex Deucher wrote: > On Fri, Mar 1, 2019 at 4:51 PM Gustavo A. R. Silva > wrote: >> >> Add missing break statement in order to prevent the code from falling >> through to case SMU_Discrete_DpmTable. >> >> This bug was found tha

[PATCH] drm/amdgpu/powerplay: Fix missing break in switch statement

2019-03-01 Thread Gustavo A. R. Silva
") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smum

[PATCH] drm/amdgpu/gfx_v8_0: Mark expected switch fall-through

2019-03-01 Thread Gustavo A. R. Silva
0:2: note: here case CHIP_CARRIZO: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 1 + 1 file changed, 1 insertion(+) diff --

[PATCH] xen, fbfront: mark expected switch fall-through

2019-02-27 Thread Gustavo A. R. Silva
ied 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 --- drivers/video/fbdev/xen-fbfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/xen-fbfront.c

Re: [PATCH] drm/amd/powerplay/smu10_hwmgr: use struct_size() in kzalloc()

2019-02-19 Thread Gustavo A. R. Silva
On 2/19/19 1:51 PM, Alex Deucher wrote: > On Tue, Feb 19, 2019 at 1:55 PM Gustavo A. R. Silva > wrote: >> >> One of the more common cases of allocation size calculations is finding >> the size of a structure that has a zero-sized array at the end, along >&g

[PATCH] drm/amd/powerplay/smu10_hwmgr: use struct_size() in kzalloc()

2019-02-19 Thread Gustavo A. R. Silva
is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr

[PATCH] drm/amd/powerplay/smu8_hwmgr: use struct_size() in kzalloc()

2019-02-19 Thread Gustavo A. R. Silva
is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c

Re: [PATCH] drm/amdgpu/powerplay/polaris10_smumgr: Mark expected switch fall-through

2019-02-18 Thread Gustavo A. R. Silva
On 2/18/19 4:40 PM, Alex Deucher wrote: > On Fri, Feb 15, 2019 at 1:50 PM 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: -Wimp

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

2019-02-18 Thread Gustavo A. R. Silva
Hi Daniel, On 2/18/19 2:57 AM, Daniel Vetter wrote: > On Fri, Feb 15, 2019 at 11:05:46AM -0600, 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 use

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

2019-02-16 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

[PATCH] drm/drm_vm: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/drm_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index c3301046dfaa..8987501f53b2 100644

[PATCH] drm/amdgpu/powerplay/polaris10_smumgr: Mark expected switch fall-through

2019-02-16 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH] drm/radeon/si_dpm: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

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

2019-02-16 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: -

[PATCH] drm/amdgpu/si_dpm: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH] drm/radeon/evergreen_cs: fix missing break in switch statement

2019-02-16 Thread Gustavo A. R. Silva
Signed-off-by: Gustavo A. R. Silva --- NOTE: Notice that this code has been out there since 2012. So, it would be helpful if someone can double-check this. drivers/gpu/drm/radeon/evergreen_cs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/

[PATCH] drm/amd/powerplay/smu7_hwmgr: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH] drm/amd/display/dce_mem_input: Mark expected switch fall-through

2019-02-16 Thread Gustavo A. R. Silva
of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display

[PATCH] drm: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
of the 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

[PATCH] drm/amd/display/dc/bios_parser2: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

[PATCH] drm/radeon/ci_dpm: Mark expected switch fall-throughs

2019-02-16 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm

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

2019-02-16 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: [PATCH] drm/nouveau/nvkm: mark expected switch fall-throughs

2019-02-16 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

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

2019-02-12 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

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

2019-02-12 Thread Gustavo A. R. Silva
l 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 --- drivers/gpu/drm/nouveau/nouv

Re: [PATCH] drm/vc4: Use struct_size() in kzalloc()

2019-02-08 Thread Gustavo A. R. Silva
On 2/7/19 4:59 PM, Eric Anholt wrote: > "Gustavo A. R. Silva" writes: > >> One of the more common cases of allocation size calculations is finding >> the size of a structure that has a zero-sized array at the end, along >> with memory for some number of el

[PATCH] drm/vc4: Use struct_size() in kzalloc()

2019-01-31 Thread Gustavo A. R. Silva
-by: Gustavo A. R. Silva --- drivers/gpu/drm/vc4/vc4_perfmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_perfmon.c b/drivers/gpu/drm/vc4/vc4_perfmon.c index 437e7a27f21d..495150415020 100644 --- a/drivers/gpu/drm/vc4/vc4_perfmon.c +++ b/drivers/gpu/drm/vc4

Re: [PATCH] drm/savage: mark expected switch fall-throughs

2019-01-31 Thread Gustavo A. R. Silva
On 1/30/19 10:35 AM, Daniel Vetter wrote: > On Tue, Jan 29, 2019 at 02:20:06PM -0600, Gustavo A. R. Silva wrote: >> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >> where we are expecting to fall through. >> >> This patch fixes the following warn

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

2019-01-30 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

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

2019-01-30 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

[PATCH] drm/savage: mark expected switch fall-throughs

2019-01-30 Thread Gustavo A. R. Silva
-fallthrough=] Warning level 3 was used: -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/savage/savage_state.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/savage

[PATCH] drm/via: mark expected switch fall-throughs

2019-01-30 Thread Gustavo A. R. Silva
level 3 was used: -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/via/via_dmablit.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers

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

2019-01-30 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: [PATCH] drm/nouveau: fix missing break in switch statement

2019-01-30 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 ca

Re: [PATCH] drm/amd/powerplay: Fix missing break in switch

2019-01-29 Thread Gustavo A. R. Silva
On 1/28/19 10:19 AM, Alex Deucher wrote: > On Fri, Jan 25, 2019 at 5:31 PM Gustavo A. R. Silva > wrote: >> >> Add missing break statement in order to prevent the code from falling >> through to the default case. >> >> The resoning for this is that pclk_vol_t

[PATCH] drm/amd/powerplay: Fix missing break in switch

2019-01-26 Thread Gustavo A. R. Silva
thanks to the ongoing efforts to enabling -Wimplicit-fallthrough. Fixes: cd70f3d6e3fa ("drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 1 + 1 file

[PATCH] drm/vmwgfx: Replace PTR_RET with PTR_ERR_OR_ZERO

2019-01-23 Thread Gustavo A. R. Silva
PTR_RET is deprecated and will be removed soon. Use PTR_ERR_OR_ZERO instead. Notice that these are the last instances of PTR_RET in the whole codebase. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH] drm/komeda: Remove unused variable

2019-01-20 Thread Gustavo A. R. Silva
); ^~~~ Fixes: 7e8d4fcf8daf ("drm: arm/komeda: Remove IRQ parsing from initial series") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/arm/disp

[PATCH] drm/amdgpu: Replace kzalloc with kcalloc

2019-01-14 Thread Gustavo A. R. Silva
(struct dc_plane_state) to sizeof(*updates) and sizeof(*surfaces), correspondingly. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] video: offb: annotate implicit fall throughs

2019-01-14 Thread Gustavo A. R. Silva
through [-Wimplicit-fallthrough=] drivers/video/fbdev/offb.c:142:3: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Mathieu Malaterre Acked-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/video/fbdev/offb.c | 2 ++ 1 file changed, 2 insertions

Re: [PATCH] drm/dp: annotate implicit fall throughs

2019-01-14 Thread Gustavo A. R. Silva
A. R. Silva --- drivers/gpu/drm/drm_dp_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 516e82d0ed50..26835d174939 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c

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

2019-01-11 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

[PATCH] qxl: Use struct_size() in kzalloc()

2019-01-09 Thread Gustavo A. R. Silva
A. R. Silva --- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index ce0b9c40fc21..c8642712412e 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl

Re: [PATCH v2] drm/amdgpu_vm: fix boolean expressions

2019-01-07 Thread Gustavo A. R. Silva
Hi Ezequiel, On 1/4/19 10:40 AM, Ezequiel Garcia wrote: Hey Gustavo, On Thu, 3 Jan 2019 at 17:25, Gustavo A. R. Silva wrote: Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes:

[PATCH] drm/amdgpu_vm: fix boolean expressions

2019-01-04 Thread Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes: c8c5e569c5b0 ("drm/amdgpu: Consolidate visible vs. real vram check v2.") Cc: sta...@vger.kernel.org Signed-off-b

[PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param

2019-01-04 Thread Gustavo A. R. Silva
Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes: 6d04ee9dc101 ("drm/amd/display: Restructuring and cleaning up DML") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A.

Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param

2019-01-04 Thread Gustavo A. R. Silva
On 1/3/19 3:11 PM, Wentland, Harry wrote: On 2019-01-03 2:48 p.m., Gustavo A. R. Silva wrote: Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes: 6d04ee9dc101 ("drm/amd/displ

Re: [PATCH] drm/amdgpu_vm: fix boolean expressions

2019-01-04 Thread Gustavo A. R. Silva
On 1/3/19 1:17 PM, Kuehling, Felix wrote: On 2019-01-03 12:34 p.m., Gustavo A. R. Silva wrote: Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes: c8c5e569c5b0 ("drm/am

[PATCH v2] drm/amdgpu_vm: fix boolean expressions

2019-01-04 Thread Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes: 9a4b7d4c769e ("drm/amdgpu: Add vm context module param") Cc: sta...@vger.kernel.org Reviewed-by: Felix Kuehling Signe

[PATCH] drm/ioctl: Fix Spectre v1 vulnerabilities

2018-12-20 Thread Gustavo A. R. Silva
e that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel=152449131114778=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva ---

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

2018-10-18 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: [PATCH] drm/bufs: Fix Spectre v1 vulnerability

2018-10-17 Thread Gustavo A. R. Silva
On 10/17/18 9:19 AM, Daniel Vetter wrote: >> Cc: sta...@vger.kernel.org >> Signed-off-by: Gustavo A. R. Silva > > Applied since it's correct, but I dropped the cc: stable. This code is > very dead and full of security issues, and spectre is the least of your > worrie

[PATCH] drm/bufs: Fix Spectre v1 vulnerability

2018-10-17 Thread Gustavo A. R. Silva
114778=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/drm_bufs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 7412aca..d7d10ca 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/g

Re: [PATCH] drm/radeon/r300: Mark expected switch fall-throughs

2018-10-15 Thread Gustavo A. R. Silva
On 10/12/18 7:29 PM, Alex Deucher wrote: > This and the r420 patch applied. Thanks! > Thanks, Alex. :) -- Gustavo ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/radeon/r420: mark expected switch fall-through

2018-10-15 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1357317 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/radeon/r420.c | 1 + 1 file changed, 1 insertion(+)

[PATCH] drm/radeon/r300: Mark expected switch fall-throughs

2018-10-15 Thread Gustavo A. R. Silva
t;Missing break in switch") Addresses-Coverity-ID: 114735 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/radeon/r300.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/rad

[PATCH] video: fbdev: arcfb: mark expected switch fall-through

2018-10-04 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115017 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/arcfb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH] drm/i915/dp: fix shifting by a negative number of bits

2018-09-13 Thread Gustavo A. R. Silva
915/icl: implement the tc/legacy HPD {dis,}connect flows") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_dp.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 436c22d..e34b7b1 100644 --- a/d

[PATCH] video/fbdev/stifb: Fix spelling mistake in fall-through annotation

2018-09-04 Thread Gustavo A. R. Silva
Replace "fall though" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Addresses-Coverity-ID: 402013 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/sti

[PATCH] drm/rockchip: Use struct_size() in devm_kzalloc()

2018-08-27 Thread Gustavo A. R. Silva
() helper: instance = devm_kzalloc(dev, struct_size(instance, entry, count), GFP_KERNEL); This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [Linux-graphics-maintainer] [PATCH] drm/vmwgfx: Fix potential Spectre v1

2018-08-24 Thread Gustavo A. R. Silva
Hi all, On 8/21/18 3:19 AM, Thomas Hellstrom wrote: >>>   #include "vmwgfx_drv.h" >>>   #include "vmwgfx_reg.h" >>> @@ -4520,8 +4521,10 @@ int vmw_execbuf_ioctl(struct drm_device *dev, >>> unsigned long data, >>>   return -EINVAL; >>>   } >>> >>> -    if (arg.version > 1 && >>> - 

[PATCH] drm/sun4i: tcon-top: Use struct_size() in devm_kzalloc()

2018-08-24 Thread Gustavo A. R. Silva
of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c index 55fe398..3040a79 100644 --- a/drivers/gpu/drm/sun4i

[PATCH] drm/vmwgfx: Fix potential Spectre v1

2018-08-17 Thread Gustavo A. R. Silva
=152449131114778=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 1f13457..ad91c6e

Re: [PATCH] drm/i915/kvmgt: Fix potential Spectre v1

2018-08-11 Thread Gustavo A. R. Silva
Hi Zhenyu, On 8/6/18 9:26 PM, Zhenyu Wang wrote: > On 2018.08.02 22:40:19 -0500, Gustavo A. R. Silva wrote: >> info.index can be indirectly controlled by user-space, hence leading >> to a potential exploitation of the Spectre variant 1 vulnerability. >> >> This issue

[PATCH] drm/amd/amdkfd/kfd_int_process_v9: Use true and false for boolean values

2018-08-06 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] drm/vmwgfx: Use true and false for boolean values

2018-08-06 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] drm/amdkfd: Use true and false for boolean values

2018-08-06 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true or false instead of an integer value. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] drm/i915/kvmgt: Fix potential Spectre v1

2018-08-03 Thread Gustavo A. R. Silva
nfo/?l=linux-kernel=152449131114778=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/kvmgt.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 4d2f53a..b

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

2018-08-03 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

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

2018-07-25 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

[PATCH] drm/msm: Replace PTR_RET with PTR_ERR_OR_ZERO

2018-07-24 Thread Gustavo A. R. Silva
PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c

<    1   2   3   4   5   >