* [lm-sensors] [PATCH] atxp1: signed/unsigned char bug
2006-07-24 8:31 [lm-sensors] [PATCH] atxp1: signed/unsigned char bug Alexey Dobriyan
@ 2006-07-27 18:20 ` Jean Delvare
2006-07-27 18:30 ` Alexey Dobriyan
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jean Delvare @ 2006-07-27 18:20 UTC (permalink / raw)
To: lm-sensors
Hi Alexey,
> vid_to_reg() can return -1 and char can be unsigned.
What does it take for char be unsigned? Never seen that.
> Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
> ---
>
> drivers/hwmon/atxp1.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/hwmon/atxp1.c
> +++ b/drivers/hwmon/atxp1.c
> @@ -116,8 +116,7 @@ static ssize_t atxp1_storevcore(struct d
> {
> struct atxp1_data *data;
> struct i2c_client *client;
> - char vid;
> - char cvid;
> + int vid, cvid;
> unsigned int vcore;
>
> client = to_i2c_client(dev);
Whatever, this looks better with ints, I agree. I'll take that patch,
unless Sebastian objects.
--
Jean Delvare
^ permalink raw reply [flat|nested] 6+ messages in thread* [lm-sensors] [PATCH] atxp1: signed/unsigned char bug
2006-07-24 8:31 [lm-sensors] [PATCH] atxp1: signed/unsigned char bug Alexey Dobriyan
2006-07-27 18:20 ` Jean Delvare
@ 2006-07-27 18:30 ` Alexey Dobriyan
2006-07-27 19:15 ` Sebastian Witt
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alexey Dobriyan @ 2006-07-27 18:30 UTC (permalink / raw)
To: lm-sensors
On Thu, Jul 27, 2006 at 08:20:53PM +0200, Jean Delvare wrote:
> > vid_to_reg() can return -1 and char can be unsigned.
>
> What does it take for char be unsigned? Never seen that.
Cross-gcc for arm here. That's how it was noticed. Or -funsigned-char
gcc flag.
^ permalink raw reply [flat|nested] 6+ messages in thread* [lm-sensors] [PATCH] atxp1: signed/unsigned char bug
2006-07-24 8:31 [lm-sensors] [PATCH] atxp1: signed/unsigned char bug Alexey Dobriyan
2006-07-27 18:20 ` Jean Delvare
2006-07-27 18:30 ` Alexey Dobriyan
@ 2006-07-27 19:15 ` Sebastian Witt
2006-07-27 20:28 ` Jean Delvare
2006-07-27 20:36 ` Alexey Dobriyan
4 siblings, 0 replies; 6+ messages in thread
From: Sebastian Witt @ 2006-07-27 19:15 UTC (permalink / raw)
To: lm-sensors
Jean Delvare wrote:
>
> Whatever, this looks better with ints, I agree. I'll take that patch,
> unless Sebastian objects.
No, I'm fine with that.
Bye,
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread
* [lm-sensors] [PATCH] atxp1: signed/unsigned char bug
2006-07-24 8:31 [lm-sensors] [PATCH] atxp1: signed/unsigned char bug Alexey Dobriyan
` (2 preceding siblings ...)
2006-07-27 19:15 ` Sebastian Witt
@ 2006-07-27 20:28 ` Jean Delvare
2006-07-27 20:36 ` Alexey Dobriyan
4 siblings, 0 replies; 6+ messages in thread
From: Jean Delvare @ 2006-07-27 20:28 UTC (permalink / raw)
To: lm-sensors
> On Thu, Jul 27, 2006 at 08:20:53PM +0200, Jean Delvare wrote:
> > > vid_to_reg() can return -1 and char can be unsigned.
> >
> > What does it take for char be unsigned? Never seen that.
>
> Cross-gcc for arm here. That's how it was noticed.
I'd call it a bug.
> Or -funsigned-char gcc flag.
Irrelevant as far as the kernel compilation goes - but thanks for the
hint.
I take the patch anyway.
--
Jean Delvare
^ permalink raw reply [flat|nested] 6+ messages in thread* [lm-sensors] [PATCH] atxp1: signed/unsigned char bug
2006-07-24 8:31 [lm-sensors] [PATCH] atxp1: signed/unsigned char bug Alexey Dobriyan
` (3 preceding siblings ...)
2006-07-27 20:28 ` Jean Delvare
@ 2006-07-27 20:36 ` Alexey Dobriyan
4 siblings, 0 replies; 6+ messages in thread
From: Alexey Dobriyan @ 2006-07-27 20:36 UTC (permalink / raw)
To: lm-sensors
On Thu, Jul 27, 2006 at 10:28:49PM +0200, Jean Delvare wrote:
> > On Thu, Jul 27, 2006 at 08:20:53PM +0200, Jean Delvare wrote:
> > > > vid_to_reg() can return -1 and char can be unsigned.
> > >
> > > What does it take for char be unsigned? Never seen that.
> >
> > Cross-gcc for arm here. That's how it was noticed.
>
> I'd call it a bug.
C standard explicitly says that "char" equivalence to either
"signed char" or "unsigned char" is implementation defined.
But, yes, it's confusing.
^ permalink raw reply [flat|nested] 6+ messages in thread