nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] nouveau: Add missing break statement
       [not found] <20240430131840.742924-1-chaitanya.kumar.borah@intel.com>
@ 2024-04-30 13:53 ` Lucas De Marchi
  2024-04-30 14:28 ` Danilo Krummrich
  1 sibling, 0 replies; 2+ messages in thread
From: Lucas De Marchi @ 2024-04-30 13:53 UTC (permalink / raw)
  To: Chaitanya Kumar Borah
  Cc: nouveau, dri-devel, ttabi, dakr, airlied, lyude, bskeggs

On Tue, Apr 30, 2024 at 06:48:40PM GMT, Chaitanya Kumar Borah wrote:
>Add the missing break statement that causes the following build error
>
>	  CC [M]  drivers/gpu/drm/i915/display/intel_display_device.o
>	../drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c: In function ‘build_registry’:
>	../drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1266:3: error: label at end of compound statement
>	1266 |   default:
>	      |   ^~~~~~~
>	  CC [M]  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.o
>	  HDRTEST drivers/gpu/drm/xe/compat-i915-headers/i915_reg.h
>	  CC [M]  drivers/gpu/drm/amd/amdgpu/imu_v11_0.o
>	make[7]: *** [../scripts/Makefile.build:244: drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.o] Error 1
>	make[7]: *** Waiting for unfinished jobs....
>
>Fixes: b58a0bc904ff ("nouveau: add command-line GSP-RM registry support")
>Closes: https://lore.kernel.org/all/913052ca6c0988db1bab293cfae38529251b4594.camel@nvidia.com/T/#m3c9acebac754f2e74a85b76c858c093bb1aacaf0

Just found a previous bug report, so we can add here:

Closes: https://lore.kernel.org/all/CA+G9fYu7Ug0K8h9QJT0WbtWh_LL9Juc+VC0WMU_Z_vSSPDNymg@mail.gmail.com/


>Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
>---
> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
>index 0b46db5c77b8..63619512e7f6 100644
>--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
>+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
>@@ -1264,6 +1264,7 @@ static void build_registry(struct nvkm_gsp *gsp, PACKED_REGISTRY_TABLE *registry
> 			str_offset += reg->vlen;
> 			break;
> 		default:
>+			break;


since reg->type is an enum and we are handling all the values, another
possible approach is to remove the default handling and then the
compiler will warn you of missing cases if built with -Wswitch.

Any of the approaches seem good to me.

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

> 		}
>
> 		i++;
>-- 
>2.25.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nouveau: Add missing break statement
       [not found] <20240430131840.742924-1-chaitanya.kumar.borah@intel.com>
  2024-04-30 13:53 ` [PATCH] nouveau: Add missing break statement Lucas De Marchi
@ 2024-04-30 14:28 ` Danilo Krummrich
  1 sibling, 0 replies; 2+ messages in thread
From: Danilo Krummrich @ 2024-04-30 14:28 UTC (permalink / raw)
  To: Chaitanya Kumar Borah, nouveau, dri-devel
  Cc: ttabi, lucas.demarchi, airlied, lyude, bskeggs

On 4/30/24 15:18, Chaitanya Kumar Borah wrote:
> Add the missing break statement that causes the following build error
> 
> 	  CC [M]  drivers/gpu/drm/i915/display/intel_display_device.o
> 	../drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c: In function ‘build_registry’:
> 	../drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1266:3: error: label at end of compound statement
> 	1266 |   default:
> 	      |   ^~~~~~~
> 	  CC [M]  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.o
> 	  HDRTEST drivers/gpu/drm/xe/compat-i915-headers/i915_reg.h
> 	  CC [M]  drivers/gpu/drm/amd/amdgpu/imu_v11_0.o
> 	make[7]: *** [../scripts/Makefile.build:244: drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.o] Error 1
> 	make[7]: *** Waiting for unfinished jobs....
> 
> Fixes: b58a0bc904ff ("nouveau: add command-line GSP-RM registry support")
> Closes: https://lore.kernel.org/all/913052ca6c0988db1bab293cfae38529251b4594.camel@nvidia.com/T/#m3c9acebac754f2e74a85b76c858c093bb1aacaf0
> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

Applied to drm-misc-next, thanks!

> ---
>   drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> index 0b46db5c77b8..63619512e7f6 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> @@ -1264,6 +1264,7 @@ static void build_registry(struct nvkm_gsp *gsp, PACKED_REGISTRY_TABLE *registry
>   			str_offset += reg->vlen;
>   			break;
>   		default:
> +			break;
>   		}
>   
>   		i++;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-30 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240430131840.742924-1-chaitanya.kumar.borah@intel.com>
2024-04-30 13:53 ` [PATCH] nouveau: Add missing break statement Lucas De Marchi
2024-04-30 14:28 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).