HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error: conversion from 'int' to 'signed char:1' ......................................................................
ec/lenovo/pmh7: Fix error: conversion from 'int' to 'signed char:1'
Change-Id: Ie6c5a424ff49a2df586432e1390d5a30166d6c6a Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/lenovo/pmh7/chip.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34092/1
diff --git a/src/ec/lenovo/pmh7/chip.h b/src/ec/lenovo/pmh7/chip.h index 46f74c1..3189767 100644 --- a/src/ec/lenovo/pmh7/chip.h +++ b/src/ec/lenovo/pmh7/chip.h @@ -17,8 +17,8 @@ #define EC_LENOVO_PMH7_CHIP_H
struct ec_lenovo_pmh7_config { - int backlight_enable:1; - int dock_event_enable:1; + signed char backlight_enable:1; + signed char dock_event_enable:1; };
#endif /* EC_LENOVO_PMH7_CHIP_H */
Hello Alexander Couzens, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34092
to look at the new patch set (#2).
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1'
Change-Id: Ie6c5a424ff49a2df586432e1390d5a30166d6c6a Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/lenovo/pmh7/chip.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34092/2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 4:
What does this fix? Where is the conversion?
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 4: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/34092/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34092/4//COMMIT_MSG@8 PS4, Line 8: Found-by: …
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 4:
Patch Set 4:
What does this fix? Where is the conversion?
Please see https://qa.coreboot.org/job/coreboot-gerrit/110495/consoleFull:
/cb-build/coreboot-gerrit.0/default/LENOVO_T410/mainboard/lenovo/t410/static.c:74:22: error: conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Werror=conversion] .backlight_enable = 0x01, ^~~~ /cb-build/coreboot-gerrit.0/default/LENOVO_T410/mainboard/lenovo/t410/static.c:75:23: error: conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Werror=conversion] .dock_event_enable = 0x01, ^~~~
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34092/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34092/4//COMMIT_MSG@8 PS4, Line 8:
Found-by: …
Ack
Hello Alexander Couzens, Paul Menzel, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34092
to look at the new patch set (#5).
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1'
error found using '-Wconversion' Option.
Change-Id: Ie6c5a424ff49a2df586432e1390d5a30166d6c6a Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/lenovo/pmh7/chip.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34092/5
Hello Alexander Couzens, Paul Menzel, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34092
to look at the new patch set (#6).
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1'
error found using '-Wconversion' option.
Change-Id: Ie6c5a424ff49a2df586432e1390d5a30166d6c6a Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/lenovo/pmh7/chip.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34092/6
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 6:
What does this fix? Where is the conversion?
Please see https://qa.coreboot.org/job/coreboot-gerrit/110495/consoleFull:
/cb-build/coreboot-gerrit.0/default/LENOVO_T410/mainboard/lenovo/t410/static.c:74:22: error: conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Werror=conversion] .backlight_enable = 0x01, ^~~~ /cb-build/coreboot-gerrit.0/default/LENOVO_T410/mainboard/lenovo/t410/static.c:75:23: error: conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Werror=conversion] .dock_event_enable = 0x01, ^~~~
Where is the test that this patch fixes it? I don't think it does.
What the error tells us:
* GCC treats `.backlight_enable` and `.dock_event_enable` as `signed char:1`. Making that explicit in `chip.h` shouldn't change anything. * The problem is that both are declared as `signed` with only 1 bit width. This means the only possible values are `0` and `-1`. Hence the error, when assigning `1`.
The proper solution should be to make them `unsigned` or get rid of the `:1`.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 6: -Code-Review
James has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34092/6/src/ec/lenovo/pmh7/chip.h File src/ec/lenovo/pmh7/chip.h:
https://review.coreboot.org/c/coreboot/+/34092/6/src/ec/lenovo/pmh7/chip.h@2... PS6, Line 21: signed char dock_event_enable:1; The signed single-bit bit field doesn't make sense to me, as the possible values are 0 or -1. It seems to me that the more sensible type is unsigned int or unsigned char, or forgoing bit fields and using uint8_t or bool.
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34092/6/src/ec/lenovo/pmh7/chip.h File src/ec/lenovo/pmh7/chip.h:
https://review.coreboot.org/c/coreboot/+/34092/6/src/ec/lenovo/pmh7/chip.h@2... PS6, Line 21: signed char dock_event_enable:1;
The signed single-bit bit field doesn't make sense to me, as the possible values are 0 or -1. […]
not sure, but I think 'devicetree.c' will not like it
Hello Alexander Couzens, Paul Menzel, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34092
to look at the new patch set (#7).
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1'
Found-by: gcc-8.3.0 using '-Wconversion' option Change-Id: Ie6c5a424ff49a2df586432e1390d5a30166d6c6a Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/lenovo/pmh7/chip.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34092/7
Hello Alexander Couzens, Paul Menzel, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34092
to look at the new patch set (#8).
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1'
Fix the error found using '-Wconversion' option: /cb-build/coreboot-gerrit.0/default/LENOVO_T410/mainboard/lenovo/t410/static.c:74:22: error: conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Werror=conversion] .backlight_enable = 0x01, ^~~~ /cb-build/coreboot-gerrit.0/default/LENOVO_T410/mainboard/lenovo/t410/static.c:75:23: error: conversion from 'int' to 'signed char:1' changes value from '1' to '-1' [-Werror=conversion] .dock_event_enable = 0x01, ^~~~
Found-by: gcc-8.3.0 using '-Wconversion' option Change-Id: Ie6c5a424ff49a2df586432e1390d5a30166d6c6a Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/lenovo/pmh7/chip.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34092/8
James has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34092/6/src/ec/lenovo/pmh7/chip.h File src/ec/lenovo/pmh7/chip.h:
https://review.coreboot.org/c/coreboot/+/34092/6/src/ec/lenovo/pmh7/chip.h@2... PS6, Line 21: signed char dock_event_enable:1;
not sure, but I think 'devicetree. […]
I believe `int bf : 1` is the same as `signed char bf : 1`, both representing 1-bit wide signed integers. The warning is due to the devicetree bits setting these values to 0x01, which is converted to -1 in 2's complement.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Patch Set 8: Code-Review-1
a 1 bit wide signed type is very likely a bug. this patch might silence the compiler, but i'm pretty sure that it doesn't do the right thing
HAOUAS Elyes has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34092 )
Change subject: ec/lenovo/pmh7: Fix error conversion from 'int' to 'signed char:1' ......................................................................
Abandoned