Skip to content
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

[Motorcomm] [Deepin Kernel SIG] Fix compile errors with clang-19 #506

Merged

Conversation

Avenger-285714
Copy link
Collaborator

No description provided.

Fix follow compile errors with clang-19:

drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:500:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign]
  500 |         pdata = pdata;
      |         ~~~~~ ^ ~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:611:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign]
  611 |         pdata = pdata;
      |         ~~~~~ ^ ~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:1321:14: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
 1321 |         start_index = start_index;
      |         ~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:1618:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign]
 1618 |         pdata = pdata;
      |         ~~~~~ ^ ~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:2628:7: error: explicitly assigning value of variable of type 'unsigned int' to itself [-Werror,-Wself-assign]
 2628 |         type = type;
      |         ~~~~ ^ ~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:5019:9: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
 5019 |         int_id = int_id;
      |         ~~~~~~ ^ ~~~~~~
6 errors generated.

Signed-off-by: WangYuli <[email protected]>
…ffset

Fix follow errors with clang-19:

drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:983:6: error: variable 'pcie_msi_mask_bits' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
  983 |         if (pcie_cap_offset) {
      |             ^~~~~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:994:43: note: uninitialized use occurs here
  994 |         pcie_msi_mask_bits = FXGMAC_SET_REG_BITS(pcie_msi_mask_bits,
      |                                                  ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-os.h:189:22: note: expanded from macro 'FXGMAC_SET_REG_BITS'
  189 |         typeof(var) _var = (var);                                                   \
      |                             ^~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:983:2: note: remove the 'if' if its condition is always true
  983 |         if (pcie_cap_offset) {
      |         ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:979:24: note: initialize the variable 'pcie_msi_mask_bits' to silence this warning
  979 |         u32 pcie_msi_mask_bits;
      |                               ^
      |                                = 0
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1014:6: error: variable 'pcie_msi_mask_bits' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
 1014 |         if (pcie_cap_offset) {
      |             ^~~~~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1025:43: note: uninitialized use occurs here
 1025 |         pcie_msi_mask_bits = FXGMAC_SET_REG_BITS(pcie_msi_mask_bits,
      |                                                  ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-os.h:189:22: note: expanded from macro 'FXGMAC_SET_REG_BITS'
  189 |         typeof(var) _var = (var);                                                   \
      |                             ^~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1014:2: note: remove the 'if' if its condition is always true
 1014 |         if (pcie_cap_offset) {
      |         ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1010:24: note: initialize the variable 'pcie_msi_mask_bits' to silence this warning
 1010 |         u32 pcie_msi_mask_bits;
      |                               ^
      |                                = 0
2 errors generated.

Signed-off-by: WangYuli <[email protected]>
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from avenger-285714. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714 Avenger-285714 merged commit 3be1423 into deepin-community:linux-6.6.y Nov 28, 2024
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants