Skip to content

"error: initializer element is not constant" in drivers/regulator/max77857-regulator.c #1889

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

Closed
nathanchance opened this issue Jul 18, 2023 · 5 comments
Labels
[BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle [FIXED][LLVM] 17 This bug was fixed in LLVM 17.0 [FIXED][LLVM] 18 This bug was fixed in LLVM 18 Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.

Comments

@nathanchance
Copy link
Member

drivers/regulator/max77857-regulator.c:312:16: error: initializer element is not a compile-time constant
  312 |         .ramp_delay = max77857_ramp_table[0][0],
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Reported upstream: https://lore.kernel.org/[email protected]/

@nathanchance nathanchance added [BUG] linux-next This is an issue only seen in linux-next Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. labels Jul 18, 2023
@nathanchance
Copy link
Member Author

https://reviews.llvm.org/D151587 + https://reviews.llvm.org/D76096 resolves this (i.e., makes clang match the behavior of GCC 8 and newer), but the kernel code should still be adjusted for older toolchains.

@nickdesaulniers
Copy link
Member

nickdesaulniers commented Aug 2, 2023

The first patch landed in release/17.x, the second I just landed in main (clang-18). I've requested a backport for clang-17 though.

EDIT: seems like the author hasn't followed up with a fix yet.

@nickdesaulniers nickdesaulniers added the [FIXED][LLVM] 18 This bug was fixed in LLVM 18 label Aug 2, 2023
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added the [PATCH] Accepted A submitted patch has been accepted upstream label Aug 3, 2023
@nickdesaulniers
Copy link
Member

backport picked up to clang-17: llvm/llvm-project-release-prs@0b2d5b9

@nickdesaulniers nickdesaulniers added the [FIXED][LLVM] 17 This bug was fixed in LLVM 17.0 label Aug 3, 2023
@nickdesaulniers nickdesaulniers added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Aug 17, 2023
@nickdesaulniers
Copy link
Member

This issue never hit mainline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle [FIXED][LLVM] 17 This bug was fixed in LLVM 17.0 [FIXED][LLVM] 18 This bug was fixed in LLVM 18 Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.
Projects
None yet
Development

No branches or pull requests

2 participants