-
Notifications
You must be signed in to change notification settings - Fork 63
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
[Mucse] [Deepin Kernel SIG] Fix compile errors with clang-19 #495
[Mucse] [Deepin Kernel SIG] Fix compile errors with clang-19 #495
Conversation
Follow error with clang-19: drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c:517:18: error: array index 0 is past the end of the array (that has type 'char[0]', cast to 'int *') [-Werror,-Warray-bounds] 517 | ret = ((int *)(cookie->priv))[0]; | ^ ~ drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.h:29:2: note: array 'priv' declared here 29 | char priv[0]; | ^ 1 error generated. To fix this, define a MAX_PRIV_LEN just like what 'struct mbx_req_cookie' at 'rnp_type.h' does. Signed-off-by: WangYuli <wangyuli@uniontech.com>
Fix follow compile errors with clang-19: drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c:3394:10: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign] 3394 | voltage = voltage; | ~~~~~~~ ^ ~~~~~~~ 1 error generated. drivers/net/ethernet/mucse/rnp/rnp_n10.c:4208:10: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign] 4208 | voltage = voltage; | ~~~~~~~ ^ ~~~~~~~ 1 error generated. Signed-off-by: WangYuli <wangyuli@uniontech.com>
Fix follow errors with clang-19: drivers/net/ethernet/mucse/rnp/rnp_main.c:6165:24: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] 6165 | } else if ((protocol == htons(ETH_P_8021Q))) { | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnp/rnp_main.c:6165:24: note: remove extraneous parentheses around the comparison to silence this warning 6165 | } else if ((protocol == htons(ETH_P_8021Q))) { | ~ ^ ~ drivers/net/ethernet/mucse/rnp/rnp_main.c:6165:24: note: use '=' to turn this equality comparison into an assignment 6165 | } else if ((protocol == htons(ETH_P_8021Q))) { | ^~ | = 1 error generated. drivers/net/ethernet/mucse/rnp/rnp_n10.c:3329:30: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] 3329 | if ((hw->force_speed_stat == | ~~~~~~~~~~~~~~~~~~~~~^~ 3330 | FORCE_SPEED_STAT_DISABLED)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnp/rnp_n10.c:3329:30: note: remove extraneous parentheses around the comparison to silence this warning 3329 | if ((hw->force_speed_stat == | ~ ^ 3330 | FORCE_SPEED_STAT_DISABLED)) { | ~ drivers/net/ethernet/mucse/rnp/rnp_n10.c:3329:30: note: use '=' to turn this equality comparison into an assignment 3329 | if ((hw->force_speed_stat == | ^~ | = 1 error generated. Signed-off-by: WangYuli <wangyuli@uniontech.com>
Fix follow error with clang-19: drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_ethtool.c:143:3: error: variable 'advertising' is uninitialized when used here [-Werror,-Wuninitialized] 143 | advertising |= ADVERTISED_FIBRE | ADVERTISED_1000baseKX_Full; | ^~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_ethtool.c:131:28: note: initialize the variable 'advertising' to silence this warning 131 | u32 supported, advertising; | ^ | = 0 1 error generated. Signed-off-by: WangYuli <wangyuli@uniontech.com>
bab2ac7
into
deepin-community:linux-6.6.y
deepin pr auto review代码审查意见:
总体来说,代码的改动是合理的,但需要注意错误处理和潜在的性能优化问题。 |
[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 |
These drivers is to support follow ethernet cards: *mucse n500/n210 (rnpgbe) mucse n500/n210 virtual function (rnpgbevf) mucse n10-2ports (rnp) mucse n10 virtual function (rnpvf) Link: deepin-community/kernel#413 Link: deepin-community/kernel#441 Link: deepin-community/kernel#447 Link: deepin-community/kernel#448 Link: deepin-community/kernel#449 Link: deepin-community/kernel#468 Link: deepin-community/kernel#495 Co-developed-by: WangYuli <wangyuli@uniontech.com> Signed-off-by: WangYuli <wangyuli@uniontech.com> Signed-off-by: Dong Yibo <dong100@mucse.com> Signed-off-by: WangYuli <wangyuli@uniontech.com>
These drivers is to support follow ethernet cards: *mucse n500/n210 (rnpgbe) mucse n500/n210 virtual function (rnpgbevf) mucse n10-2ports (rnp) mucse n10 virtual function (rnpvf) Link: deepin-community/kernel#413 Link: deepin-community/kernel#441 Link: deepin-community/kernel#447 Link: deepin-community/kernel#448 Link: deepin-community/kernel#449 Link: deepin-community/kernel#468 Link: deepin-community/kernel#495 Co-developed-by: WangYuli <wangyuli@uniontech.com> Signed-off-by: WangYuli <wangyuli@uniontech.com> Signed-off-by: Dong Yibo <dong100@mucse.com> Signed-off-by: WangYuli <wangyuli@uniontech.com>
No description provided.