-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Linkdata] [Deepin Kernel SIG] Fix compile errors with clang-19 #493
[Linkdata] [Deepin Kernel SIG] Fix compile errors with clang-19 #493
Conversation
Some platforms such as 'x86_64' does not support '-mno-outline-atomics' option, so add a compiler check before it. Fix follow error with clang-19: clang: error: 'x86_64' does not support '-mno-outline-atomics'; flag ignored [-Werror,-Woption-ignored] By the way, EXTRA_{A,C,CPP,LD}FLAGS are deprecated and should be replaced by the new flags added via commit f77bf01 ("kbuild: introduce ccflags-y, asflags-y and ldflags-y"). Fixes: 6572288 ("deepin: arm: scsi: fix build error of linkdata ps3stor driver") Signed-off-by: WangYuli <[email protected]>
Fix follow errors: error: unknown warning option '-Wmaybe-uninitialized'; did you mean '-Wuninitialized'? [-Werror,-Wunknown-warning-option] Signed-off-by: WangYuli <[email protected]>
Fix follow compile errors with clang-19: drivers/net/ethernet/linkdata/sxe/sxepf/sxe_host_cli.c:182:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 182 | s32 sxe_cli_cdev_register() | ^ | void drivers/net/ethernet/linkdata/sxe/sxepf/sxe_host_cli.c:215:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 215 | void sxe_cli_cdev_unregister() | ^ | void 2 errors generated. drivers/net/ethernet/linkdata/sxe/sxepf/sxe_host_hdc.c:137:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 137 | struct semaphore *sxe_hdc_sema_get() | ^ | void 1 error generated. Signed-off-by: WangYuli <[email protected]>
Fix follow error with clang-19: drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_ring.c:119:3: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] 119 | default: | ^ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_ring.c:119:3: note: insert 'break;' to avoid fall-through 119 | default: | ^ | break; 1 error generated. Signed-off-by: WangYuli <[email protected]>
Fix follow compile error with clang-19: drivers/scsi/linkdata/ps3_mgr_cmd_err.c:133:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] 133 | default: | ^ drivers/scsi/linkdata/ps3_mgr_cmd_err.c:133:2: note: insert 'break;' to avoid fall-through 133 | default: | ^ | break; 1 error generated. Signed-off-by: WangYuli <[email protected]>
SXE_VFMAILBOX_VFU is just a bitmask. We need to perform a bitwise AND operation between this bitmask and the returned register value to determine if the specific flags are set successfully. Fix follow error with clang-19: drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_msg.c:107:30: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] 107 | if (sxevf_mbx_reg_read(hw) && SXE_VFMAILBOX_VFU) { | ^ ~~~~~~~~~~~~~~~~~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_msg.c:107:30: note: use '&' for a bitwise operation 107 | if (sxevf_mbx_reg_read(hw) && SXE_VFMAILBOX_VFU) { | ^~ | & drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_msg.c:107:30: note: remove constant to silence this warning 107 | if (sxevf_mbx_reg_read(hw) && SXE_VFMAILBOX_VFU) { | ^~~~~~~~~~~~~~~~~~~~ 1 error generated. Signed-off-by: WangYuli <[email protected]>
Fix follow compile errors with clang-19: drivers/scsi/linkdata/ps3_device_manager_sas.c:234:11: error: explicitly assigning value of variable of type 'struct ps3_instance *' to itself [-Werror,-Wself-assign] 234 | instance = instance; | ~~~~~~~~ ^ ~~~~~~~~ 1 error generated. drivers/scsi/linkdata/linux/ps3_cli_debug.c:3609:7: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign] 3609 | argc = argc; | ~~~~ ^ ~~~~ drivers/scsi/linkdata/linux/ps3_cli_debug.c:3610:7: error: explicitly assigning value of variable of type 'char **' to itself [-Werror,-Wself-assign] 3610 | argv = argv; | ~~~~ ^ ~~~~ 2 errors generated. Signed-off-by: WangYuli <[email protected]>
Fix follow error with clang-19: drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:73:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 73 | if (xdp_rxq_info_reg(&ring->xdp_rxq, adapter->netdev, ring->idx, 0) < 0) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:96:9: note: uninitialized use occurs here 96 | return ret; | ^~~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:73:2: note: remove the 'if' if its condition is always false 73 | if (xdp_rxq_info_reg(&ring->xdp_rxq, adapter->netdev, ring->idx, 0) < 0) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | LOG_ERROR_BDF("ring[%u] xdp rxq info reg failed\n",ring->idx); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | goto l_xdp_rxq_reg_failed; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | } | ~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:35:9: note: initialize the variable 'ret' to silence this warning 35 | s32 ret; | ^ | = 0 1 error generated. Signed-off-by: WangYuli <[email protected]>
Fix follow compile errors with clang-19: drivers/scsi/linkdata/ps3_sas_transport.c:816:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 816 | S32 ps3_sas_attach_transport() | ^ | void drivers/scsi/linkdata/ps3_sas_transport.c:837:31: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 837 | void ps3_sas_release_transport() | ^ | void 2 errors generated. Signed-off-by: WangYuli <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
895a1e0
into
deepin-community:linux-6.6.y
deepin pr auto review代码审查意见:
总的来说,代码的修改是合理的,但是需要确保移除未使用的参数和成员不会影响代码的功能和性能。 |
No description provided.