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

-Wenum-conversion in drivers/power/supply/bq25890_charger.c #1707

Closed
nathanchance opened this issue Sep 12, 2022 · 2 comments
Closed

-Wenum-conversion in drivers/power/supply/bq25890_charger.c #1707

nathanchance opened this issue Sep 12, 2022 · 2 comments
Assignees
Labels
-Wenum-conversion [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

Comments

@nathanchance
Copy link
Member

drivers/power/supply/bq25890_charger.c:625:40: error: implicit conversion from enumeration type 'enum bq25890_fields' to different enumeration type 'enum bq25890_table_ids' [-Werror,-Wenum-conversion]
                lval = bq25890_find_idx(val->intval, F_IINLIM);
                       ~~~~~~~~~~~~~~~~              ^~~~~~~~
1 error generated.

Patch submitted: https://lore.kernel.org/20220912141553.1743568-1-nathan@kernel.org/

@nathanchance nathanchance added -Wenum-conversion [PATCH] Submitted A patch has been submitted for review [BUG] linux-next This is an issue only seen in linux-next labels Sep 12, 2022
@nathanchance nathanchance self-assigned this Sep 12, 2022
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 12, 2022
…et_property()

Clang warns:

  drivers/power/supply/bq25890_charger.c:625:40: error: implicit conversion from enumeration type 'enum bq25890_fields' to different enumeration type 'enum bq25890_table_ids' [-Werror,-Wenum-conversion]
                  lval = bq25890_find_idx(val->intval, F_IINLIM);
                         ~~~~~~~~~~~~~~~~              ^~~~~~~~
  1 error generated.

Use the proper value from the right enumerated type, TBL_IINLIM, so
there is no more implcit conversion. The numerical values of F_IINLIM
and TBL_IINLIM happen to be the same so there is no change in behavior.

Fixes: 4a4748f ("power: supply: bq25890: Add support for setting IINLIM")
Link: ClangBuiltLinux#1707
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 14, 2022
…et_property()

Clang warns:

  drivers/power/supply/bq25890_charger.c:625:40: error: implicit conversion from enumeration type 'enum bq25890_fields' to different enumeration type 'enum bq25890_table_ids' [-Werror,-Wenum-conversion]
                  lval = bq25890_find_idx(val->intval, F_IINLIM);
                         ~~~~~~~~~~~~~~~~              ^~~~~~~~
  1 error generated.

Use the proper value from the right enumerated type, TBL_IINLIM, so
there is no more implcit conversion. The numerical values of F_IINLIM
and TBL_IINLIM happen to be the same so there is no change in behavior.

Fixes: 4a4748f ("power: supply: bq25890: Add support for setting IINLIM")
Link: ClangBuiltLinux#1707
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Sep 14, 2022
@nathanchance
Copy link
Member Author

@nathanchance nathanchance 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 Sep 15, 2022
Fishwaldo pushed a commit to Fishwaldo/Star64_linux that referenced this issue Aug 18, 2023
…et_property()

Clang warns:

  drivers/power/supply/bq25890_charger.c:625:40: error: implicit conversion from enumeration type 'enum bq25890_fields' to different enumeration type 'enum bq25890_table_ids' [-Werror,-Wenum-conversion]
                  lval = bq25890_find_idx(val->intval, F_IINLIM);
                         ~~~~~~~~~~~~~~~~              ^~~~~~~~
  1 error generated.

Use the proper value from the right enumerated type, TBL_IINLIM, so
there is no more implcit conversion. The numerical values of F_IINLIM
and TBL_IINLIM happen to be the same so there is no change in behavior.

Fixes: 4a4748f ("power: supply: bq25890: Add support for setting IINLIM")
Link: ClangBuiltLinux/linux#1707
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wenum-conversion [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
Projects
None yet
Development

No branches or pull requests

1 participant