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

[Phytium] [Deepin Kernel SIG] Fix compile errors with clang-19 #504

Merged

Conversation

Avenger-285714
Copy link
Collaborator

No description provided.

Fix follow error with clang-19:

drivers/pwm/pwm-phytium.c:233:2: error: variable 'dbcly' is uninitialized when used here [-Werror,-Wuninitialized]
  233 |         dbcly &= 0x0;
      |         ^~~~~
drivers/pwm/pwm-phytium.c:226:11: note: initialize the variable 'dbcly' to silence this warning
  226 |         u64 dbcly, cycles, upcycles, dwcycles;
      |                  ^
      |                   = 0
1 error generated.

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

Fix follow errors with clang-19:

sound/soc/phytium/phytium_i2s.c:979:18: error: variable 'bus_widths' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  979 | static const u32 bus_widths[COMP_MAX_DATA_WIDTH] = {
      |                  ^~~~~~~~~~
sound/soc/phytium/phytium_i2s.c:987:18: error: variable 'formats' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  987 | static const u32 formats[COMP_MAX_WORDSIZE] = {
      |                  ^~~~~~~
2 errors generated.

Signed-off-by: WangYuli <[email protected]>
Fix follow error with clang-19:

drivers/i3c/master/i3c-master-phytium.c:1710:7: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
 1710 |                 if (!master->prescl0)
      |                     ^~~~~~~~~~~~~~~~
drivers/i3c/master/i3c-master-phytium.c:1788:9: note: uninitialized use occurs here
 1788 |         return ret;
      |                ^~~
drivers/i3c/master/i3c-master-phytium.c:1710:3: note: remove the 'if' if its condition is always false
 1710 |                 if (!master->prescl0)
      |                 ^~~~~~~~~~~~~~~~~~~~~
 1711 |                         goto err_disable_sysclk;
      |                         ~~~~~~~~~~~~~~~~~~~~~~~
drivers/i3c/master/i3c-master-phytium.c:1669:9: note: initialize the variable 'ret' to silence this warning
 1669 |         int ret, irq;
      |                ^
      |                 = 0
1 error generated.

Signed-off-by: WangYuli <[email protected]>
We'll apply a bitwise AND to the controller's rxerrirq and rxerrien
to isolate interrupts that are both triggered and enabled.
This filtering ensures that we only process relevant interrupts.

Self bitwise AND operations are meaningless.

Fix follow error with clang-19:

drivers/usb/phytium/host.c:451:11: error: explicitly assigning value of variable of type 'uint16_t' (aka 'unsigned short') to itself [-Werror,-Wself-assign]
  451 |         rxerrirq &= rxerrirq;
      |         ~~~~~~~~ ^  ~~~~~~~~
1 error generated.

Signed-off-by: WangYuli <[email protected]>
Fix follow error with clang-19:

drivers/net/ethernet/phytium/phytmac_main.c:1818:2: error: variable 'ret' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
 1818 |         default:
      |         ^~~~~~~
drivers/net/ethernet/phytium/phytmac_main.c:1822:9: note: uninitialized use occurs here
 1822 |         return ret;
      |                ^~~
drivers/net/ethernet/phytium/phytmac_main.c:1799:9: note: initialize the variable 'ret' to silence this warning
 1799 |         int ret;
      |                ^
      |                 = 0
1 error generated.

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

Fix follow error with clang-19:

drivers/net/ethernet/phytium/phytmac_platform.c:130:8: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
  130 |                         if (!pdata->msg_regs) {
      |                             ^~~~~~~~~~~~~~~~
drivers/net/ethernet/phytium/phytmac_platform.c:202:9: note: uninitialized use occurs here
  202 |         return ret;
      |                ^~~
drivers/net/ethernet/phytium/phytmac_platform.c:130:4: note: remove the 'if' if its condition is always false
  130 |                         if (!pdata->msg_regs) {
      |                         ^~~~~~~~~~~~~~~~~~~~~~~
  131 |                                 dev_err(&pdev->dev, "msg_regs ioremap failed, i=%d\n", i);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  132 |                                 goto err_mem;
      |                                 ~~~~~~~~~~~~~
  133 |                         }
      |                         ~
drivers/net/ethernet/phytium/phytmac_platform.c:81:9: note: initialize the variable 'ret' to silence this warning
   81 |         int ret, i;
      |                ^
      |                 = 0
1 error generated.

Signed-off-by: WangYuli <[email protected]>
@Avenger-285714 Avenger-285714 merged commit f39973c into deepin-community:linux-6.6.y Nov 28, 2024
4 of 5 checks passed
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.

1 participant