Skip to contentSkip to conversation

drm/amdkfd/kfd_mqd_manager_v10: Avoid fall-through warning

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Jul 22, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd/kfd_mqd_manager_v10: Avoid fall-through warning

In preparation to enabling -Wimplicit-fallthrough, this patch silences the following warning:

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c: In function ‘mqd_manager_init_v10’:
./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]

 #define __dynamic_func_call(id, fmt, func, ...) do { \
                                                    ^

./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:153:2: note: in expansion of macro ‘_dynamic_func_call’
_dynamic_func_call(fmt, __dynamic_pr_debug, \
^~~~~~~~~~~~~~~~~~
./include/linux/printk.h:336:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:432:3: note: in expansion of macro ‘pr_debug’
pr_debug("%s@%i\n", __func__, __LINE__);
^~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:433:2: note: here
case KFD_MQD_TYPE_COMPUTE:
^~~~

by removing the call to 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/[email protected]/

---
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -1
index 4f8a6ffc5775..9cd3eb2d90bd 100644
@@ -429,7 +429,6 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type,
 
 	switch (type) {
 	case KFD_MQD_TYPE_CP:
-		pr_debug("%s@%i\n", __func__, __LINE__);
 	case KFD_MQD_TYPE_COMPUTE:
 		pr_debug("%s@%i\n", __func__, __LINE__);
 		mqd->allocate_mqd = allocate_mqd;
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 42 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, this patch silences the following warning:

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c: In function ‘mqd_manager_init_v10’:
./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]

  #define __dynamic_func_call(id, fmt, func, ...) do { \
                                                     ^

./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:153:2: note: in expansion of macro ‘_dynamic_func_call’

   _dynamic_func_call(fmt, __dynamic_pr_debug,  \
   ^~~~~~~~~~~~~~~~~~

./include/linux/printk.h:336:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:432:3: note: in expansion of macro ‘pr_debug’

    pr_debug("%s@%i\n", __func__, __LINE__);
    ^~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:433:2: note: here
   case KFD_MQD_TYPE_COMPUTE:
   ^~~~

by removing the call to 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/[email protected]/

---
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -0
index 4f8a6ffc5775..9cd3eb2d90bd 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type, · line 434

Quoted 7 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -1
@@ -429,7 +429,6 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type,
 
  	switch (type) {
  	case KFD_MQD_TYPE_CP:
-		pr_debug("%s@%i\n", __func__, __LINE__);
  	case KFD_MQD_TYPE_COMPUTE:
  		pr_debug("%s@%i\n", __func__, __LINE__);
  		mqd->allocate_mqd = allocate_mqd;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 47 lines · Shaoyun
Quoted 43 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, this patch silences the following warning:

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c: In function ‘mqd_manager_init_v10’:
./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]

  #define __dynamic_func_call(id, fmt, func, ...) do { \
                                                     ^

./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:153:2: note: in expansion of macro ‘_dynamic_func_call’

   _dynamic_func_call(fmt, __dynamic_pr_debug,  \
   ^~~~~~~~~~~~~~~~~~

./include/linux/printk.h:336:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:432:3: note: in expansion of macro ‘pr_debug’

    pr_debug("%s@%i\n", __func__, __LINE__);
    ^~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:433:2: note: here
   case KFD_MQD_TYPE_COMPUTE:
   ^~~~

by removing the call to 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/[email protected]/

---
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -0
index 4f8a6ffc5775..9cd3eb2d90bd 100644
@@ -429,7 +429,6 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type,
 
Quoted 10 lines

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type, · line 434

Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -1
      switch (type) {
      case KFD_MQD_TYPE_CP:
-             pr_debug("%s@%i\n", __func__, __LINE__);
      case KFD_MQD_TYPE_COMPUTE:
              pr_debug("%s@%i\n", __func__, __LINE__);
              mqd->allocate_mqd = allocate_mqd;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx