huzhi001 at 208suo.com
2023-Jul-14 05:21 UTC
[Nouveau] [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: : trailing statements should be on next line
Signed-off-by: ZhiHu <huzhi001 at 208suo.com> --- .../gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c index d8a4d773a58c..b99e0a7c96bb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c @@ -137,15 +137,29 @@ gk104_ectx_bind(struct nvkm_engn *engn, struct nvkm_cctx *cctx, struct nvkm_chan u64 addr = 0ULL; switch (engn->engine->subdev.type) { - case NVKM_ENGINE_SW : return; - case NVKM_ENGINE_GR : ptr0 = 0x0210; break; - case NVKM_ENGINE_SEC : ptr0 = 0x0220; break; - case NVKM_ENGINE_MSPDEC: ptr0 = 0x0250; break; - case NVKM_ENGINE_MSPPP : ptr0 = 0x0260; break; - case NVKM_ENGINE_MSVLD : ptr0 = 0x0270; break; - case NVKM_ENGINE_VIC : ptr0 = 0x0280; break; - case NVKM_ENGINE_MSENC : ptr0 = 0x0290; break; - case NVKM_ENGINE_NVDEC : + case NVKM_ENGINE_SW: + return; + case NVKM_ENGINE_GR: + ptr0 = 0x0210; + break; + case NVKM_ENGINE_SEC: + ptr0 = 0x0220; + break; + case NVKM_ENGINE_MSPDEC: + ptr0 = 0x0250; + break; + case NVKM_ENGINE_MSPPP: + ptr0 = 0x0260; + break; + case NVKM_ENGINE_MSVLD: + ptr0 = 0x0270; + break; + case NVKM_ENGINE_VIC: + ptr0 = 0x0280; break; + case NVKM_ENGINE_MSENC: + ptr0 = 0x0290; + break; + case NVKM_ENGINE_NVDEC: ptr1 = 0x0270; ptr0 = 0x0210; break; @@ -435,8 +449,12 @@ gk104_runl_commit(struct nvkm_runl *runl, struct nvkm_memory *memory, u32 start, int target; switch (nvkm_memory_target(memory)) { - case NVKM_MEM_TARGET_VRAM: target = 0; break; - case NVKM_MEM_TARGET_NCOH: target = 3; break; + case NVKM_MEM_TARGET_VRAM: + target = 0; + break; + case NVKM_MEM_TARGET_NCOH: + target = 3; + break; default: WARN_ON(1); return;
huzhi001 at 208suo.com
2023-Jul-14 06:58 UTC
[Nouveau] [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: : trailing statements should be on next line
Signed-off-by: ZhiHu <huzhi001 at 208suo.com> --- .../gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c index d8a4d773a58c..b99e0a7c96bb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c @@ -137,15 +137,29 @@ gk104_ectx_bind(struct nvkm_engn *engn, struct nvkm_cctx *cctx, struct nvkm_chan u64 addr = 0ULL; switch (engn->engine->subdev.type) { - case NVKM_ENGINE_SW : return; - case NVKM_ENGINE_GR : ptr0 = 0x0210; break; - case NVKM_ENGINE_SEC : ptr0 = 0x0220; break; - case NVKM_ENGINE_MSPDEC: ptr0 = 0x0250; break; - case NVKM_ENGINE_MSPPP : ptr0 = 0x0260; break; - case NVKM_ENGINE_MSVLD : ptr0 = 0x0270; break; - case NVKM_ENGINE_VIC : ptr0 = 0x0280; break; - case NVKM_ENGINE_MSENC : ptr0 = 0x0290; break; - case NVKM_ENGINE_NVDEC : + case NVKM_ENGINE_SW: + return; + case NVKM_ENGINE_GR: + ptr0 = 0x0210; + break; + case NVKM_ENGINE_SEC: + ptr0 = 0x0220; + break; + case NVKM_ENGINE_MSPDEC: + ptr0 = 0x0250; + break; + case NVKM_ENGINE_MSPPP: + ptr0 = 0x0260; + break; + case NVKM_ENGINE_MSVLD: + ptr0 = 0x0270; + break; + case NVKM_ENGINE_VIC: + ptr0 = 0x0280; break; + case NVKM_ENGINE_MSENC: + ptr0 = 0x0290; + break; + case NVKM_ENGINE_NVDEC: ptr1 = 0x0270; ptr0 = 0x0210; break; @@ -435,8 +449,12 @@ gk104_runl_commit(struct nvkm_runl *runl, struct nvkm_memory *memory, u32 start, int target; switch (nvkm_memory_target(memory)) { - case NVKM_MEM_TARGET_VRAM: target = 0; break; - case NVKM_MEM_TARGET_NCOH: target = 3; break; + case NVKM_MEM_TARGET_VRAM: + target = 0; + break; + case NVKM_MEM_TARGET_NCOH: + target = 3; + break; default: WARN_ON(1); return; -------------- next part -------------- An embedded message was scrubbed... From: huzhi001 at 208suo.com Subject: [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxE) ERROR: space prohibited before that ':' (ctx:WxE) ERROR: trailing statements should be on next line ERROR: trailing s tatements should be on next line Date: Fri, 14 Jul 2023 11:51:25 +0800 Size: 4813 URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20230714/5e8b8383/attachment-0004.eml> -------------- next part -------------- An embedded message was scrubbed... From: huzhi001 at 208suo.com Subject: [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxE) ERROR: space prohibited before that ':' (ctx:WxE) ERROR: trailing statements should be on next line ERROR: trailing s tatements should be on next line Date: Fri, 14 Jul 2023 13:14:34 +0800 Size: 3810 URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20230714/5e8b8383/attachment-0005.eml> -------------- next part -------------- An embedded message was scrubbed... From: huzhi001 at 208suo.com Subject: [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: space prohibited before that ':' (ctx:WxW) ERROR: : trailing statements should be on next line Date: Fri, 14 Jul 2023 13:17:10 +0800 Size: 2950 URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20230714/5e8b8383/attachment-0006.eml> -------------- next part -------------- An embedded message was scrubbed... From: huzhi001 at 208suo.com Subject: [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: : trailing statements should be on next line Date: Fri, 14 Jul 2023 13:21:22 +0800 Size: 2899 URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20230714/5e8b8383/attachment-0007.eml>
Lyude Paul
2023-Jul-14 23:07 UTC
[Nouveau] [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: : trailing statements should be on next line
NAK - checkpatch.pl is a (strongish) guideline, but not a rule. In the cases corrected in the patch series here, we format the switch cases on single lines as it dramatically improves the readability of what is otherwise just a /long/ list of slightly different static mappings. I don't believe we're the only part of the kernel to do this either. On Fri, 2023-07-14 at 14:58 +0800, huzhi001 at 208suo.com wrote:> Signed-off-by: ZhiHu <huzhi001 at 208suo.com> > --- > .../gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 40 ++++++++++++++----- > 1 file changed, 29 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c > b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c > index d8a4d773a58c..b99e0a7c96bb 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c > @@ -137,15 +137,29 @@ gk104_ectx_bind(struct nvkm_engn *engn, struct > nvkm_cctx *cctx, struct nvkm_chan > u64 addr = 0ULL; > > switch (engn->engine->subdev.type) { > - case NVKM_ENGINE_SW : return; > - case NVKM_ENGINE_GR : ptr0 = 0x0210; break; > - case NVKM_ENGINE_SEC : ptr0 = 0x0220; break; > - case NVKM_ENGINE_MSPDEC: ptr0 = 0x0250; break; > - case NVKM_ENGINE_MSPPP : ptr0 = 0x0260; break; > - case NVKM_ENGINE_MSVLD : ptr0 = 0x0270; break; > - case NVKM_ENGINE_VIC : ptr0 = 0x0280; break; > - case NVKM_ENGINE_MSENC : ptr0 = 0x0290; break; > - case NVKM_ENGINE_NVDEC : > + case NVKM_ENGINE_SW: > + return; > + case NVKM_ENGINE_GR: > + ptr0 = 0x0210; > + break; > + case NVKM_ENGINE_SEC: > + ptr0 = 0x0220; > + break; > + case NVKM_ENGINE_MSPDEC: > + ptr0 = 0x0250; > + break; > + case NVKM_ENGINE_MSPPP: > + ptr0 = 0x0260; > + break; > + case NVKM_ENGINE_MSVLD: > + ptr0 = 0x0270; > + break; > + case NVKM_ENGINE_VIC: > + ptr0 = 0x0280; break; > + case NVKM_ENGINE_MSENC: > + ptr0 = 0x0290; > + break; > + case NVKM_ENGINE_NVDEC: > ptr1 = 0x0270; > ptr0 = 0x0210; > break; > @@ -435,8 +449,12 @@ gk104_runl_commit(struct nvkm_runl *runl, struct > nvkm_memory *memory, u32 start, > int target; > > switch (nvkm_memory_target(memory)) { > - case NVKM_MEM_TARGET_VRAM: target = 0; break; > - case NVKM_MEM_TARGET_NCOH: target = 3; break; > + case NVKM_MEM_TARGET_VRAM: > + target = 0; > + break; > + case NVKM_MEM_TARGET_NCOH: > + target = 3; > + break;This one isn't very long, but I'd still say it's definitely a lot easier to read in the compact form. If anything, the only change I would make here is formatting the default: case to be on a single line as well> default: > WARN_ON(1); > return;-- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat
Reasonably Related Threads
- [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should
- [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should be on next line ERROR: space prohibited before that ':' (ctx:WxW) ERROR: trailing statements should
- [PATCH] drm/nouveau/fifo:Fix Nineteen occurrences of the gk104.c error: ERROR: : trailing statements should be on next line
- [RFC] Design of a TBAA sanitizer
- [RFC] Design of a TBAA sanitizer