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

[Glenfly] [Deepin Kernel SIG] Fix compile errors with clang-19 #496

Merged

Conversation

Avenger-285714
Copy link
Collaborator

No description provided.

Fix follow error:
 error: unknown warning option '-Wno-missing-attributes' [-Werror,-Wunknown-warning-option]

Signed-off-by: WangYuli <wangyuli@uniontech.com>
There is a spelling mistake of 'peff' which should be 'perf'.

Fix follow compile error with clang-19:

drivers/gpu/drm/arise/shared/gf_perf.h:15:9: error: '__gf_perf_h__' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]
   15 | #ifndef __gf_perf_h__
      |         ^~~~~~~~~~~~~
drivers/gpu/drm/arise/shared/gf_perf.h:16:9: note: '__gf_peff_h__' is defined here; did you mean '__gf_perf_h__'?
   16 | #define __gf_peff_h__
      |         ^~~~~~~~~~~~~
      |         __gf_perf_h__
1 error generated.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
Fix follow compile error with clang-19:

drivers/gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c:136:22: error: implicit truncation from 'int' to bit-field changes value from 2 to 0 [-Werror,-Wbitfield-constant-conversion]
  136 |         /*.Flags = */0x2,//backlight control = 0, use hard code link para
      |                      ^~~
1 error generated.

According to the comments, 'Flags' should be 0.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
As ulTemp is declared as CBIOS_U32, it cannot <126 and >125 at the
same time.

Fix follow error with clang-19:

drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c:55:25: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare]
   55 |     else if((ulTemp<126)&&(ulTemp>125))
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~~
1 error generated.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
Fix follow error with clang-19:

drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:200:44: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
  200 |         if((pAVIInfoFrameData->ColorFormat == 0))//RGB
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:200:44: note: remove extraneous parentheses around the comparison to silence this warning
  200 |         if((pAVIInfoFrameData->ColorFormat == 0))//RGB
      |            ~                               ^   ~
drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:200:44: note: use '=' to turn this equality comparison into an assignment
  200 |         if((pAVIInfoFrameData->ColorFormat == 0))//RGB
      |                                            ^~
      |                                            =
1 error generated.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
Fix follow compile errors with clang-19:

drivers/gpu/drm/arise/linux/os_interface.c:1995:10: error: explicitly assigning value of variable of type 'unsigned long' to itself [-Werror,-Wself-assign]
 1995 |     base = base;
      |     ~~~~ ^ ~~~~
drivers/gpu/drm/arise/linux/os_interface.c:1996:10: error: explicitly assigning value of variable of type 'unsigned long' to itself [-Werror,-Wself-assign]
 1996 |     size = size;
      |     ~~~~ ^ ~~~~
2 errors generated.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
@Avenger-285714 Avenger-285714 merged commit f88ecca into deepin-community:linux-6.6.y Nov 25, 2024
3 of 5 checks passed
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. Makefile中,移除了-Wno-missing-attributes警告,这可能会隐藏一些潜在的问题。建议在移除之前确认是否有必要,或者是否有其他方式可以处理这些属性。

  2. CBiosHDMIMonitor.c文件中,注释掉了if((pAVIInfoFrameData->ColorFormat == 0))条件下的代码块。如果这部分代码不再需要,应该完全删除,而不是注释掉。这样可以保持代码的整洁。

  3. CBiosITN156.c文件中,将Flags字段的值从0x2改为0。需要确认这个更改是否符合预期的功能,并且是否有相关的测试来验证这个更改。

  4. CBiosUtil.c文件中,删除了else if((ulTemp<126)&&(ulTemp>125))条件下的代码块。如果这部分代码不再需要,应该完全删除,而不是注释掉。这样可以保持代码的整洁。

  5. os_interface.c文件中,注释掉了basesize变量,这可能会隐藏一些潜在的问题。建议在移除之前确认是否有必要,或者是否有其他方式可以处理这些变量。

  6. gf_perf.h文件中,将宏定义__gf_peff_h__改为__gf_perf_h__。这个更改可能是为了修正拼写错误,但是需要确保这个更改不会导致其他问题。

以上是代码审查的初步意见,具体的改进还需要根据项目的具体需求和上下文来确定。

@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 pushed a commit to KernelSIG-cn/Linux-LTS-CN-6.6-dev that referenced this pull request Dec 29, 2024
[Glenfly]:
This version driver is the initial version for linux kernel 6.6,
and added basic arch support for amd64/arm64/loongarch64.

Test pass on deepin V23.

Version: 25.00.36.

Link: deepin-community/kernel#333
Link: https://gitee.com/openkylin/linux/pulls/241
Link: deepin-community/kernel#390
Link: deepin-community/kernel#490
Link: deepin-community/kernel#496
Link: deepin-community/kernel#509
Co-developed-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: brightyi <brightyi@glenfly.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Avenger-285714 pushed a commit to KernelSIG-cn/Linux-LTS-CN-6.6-dev that referenced this pull request Jan 4, 2025
[Glenfly]:
This version driver is the initial version for linux kernel 6.6,
and added basic arch support for amd64/arm64/loongarch64.

Test pass on deepin V23.

Version: 25.00.36.

Link: deepin-community/kernel#333
Link: https://gitee.com/openkylin/linux/pulls/241
Link: deepin-community/kernel#390
Link: deepin-community/kernel#490
Link: deepin-community/kernel#496
Link: deepin-community/kernel#509
Co-developed-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: brightyi <brightyi@glenfly.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
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