Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-12 Thread Andy Shevchenko
On Sun, Dec 6, 2015 at 2:05 AM, Rasmus Villemoes wrote: > If char is signed and ch happens to be negative, printing ch with > "%02x" will not do as intended (when ch is -19, one will get > "ffed"). Fix that by masking with 0xff. > > Signed-off-by: Rasmus Villemoes > --- >

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-12 Thread Andy Shevchenko
On Sun, Dec 6, 2015 at 2:05 AM, Rasmus Villemoes wrote: > If char is signed and ch happens to be negative, printing ch with > "%02x" will not do as intended (when ch is -19, one will get > "ffed"). Fix that by masking with 0xff. > > Signed-off-by: Rasmus Villemoes

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Joe Perches
On Sun, 2015-12-06 at 01:21 +0100, Rasmus Villemoes wrote: > On Sun, Dec 06 2015, Joe Perches wrote: > > > On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote: > > > If char is signed and ch happens to be negative, printing ch with > > > "%02x" will not do as intended (when ch is -19, one

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Rasmus Villemoes
On Sun, Dec 06 2015, Joe Perches wrote: > On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote: >> If char is signed and ch happens to be negative, printing ch with >> "%02x" will not do as intended (when ch is -19, one will get >> "ffed"). Fix that by masking with 0xff. > > I presume

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Joe Perches
On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote: > If char is signed and ch happens to be negative, printing ch with > "%02x" will not do as intended (when ch is -19, one will get > "ffed"). Fix that by masking with 0xff. I presume there are a lot of these in the kernel. Did you use

[PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Rasmus Villemoes
If char is signed and ch happens to be negative, printing ch with "%02x" will not do as intended (when ch is -19, one will get "ffed"). Fix that by masking with 0xff. Signed-off-by: Rasmus Villemoes --- drivers/staging/speakup/kobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Rasmus Villemoes
If char is signed and ch happens to be negative, printing ch with "%02x" will not do as intended (when ch is -19, one will get "ffed"). Fix that by masking with 0xff. Signed-off-by: Rasmus Villemoes --- drivers/staging/speakup/kobjects.c | 2 +- 1 file changed, 1

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Joe Perches
On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote: > If char is signed and ch happens to be negative, printing ch with > "%02x" will not do as intended (when ch is -19, one will get > "ffed"). Fix that by masking with 0xff. I presume there are a lot of these in the kernel. Did you use

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Joe Perches
On Sun, 2015-12-06 at 01:21 +0100, Rasmus Villemoes wrote: > On Sun, Dec 06 2015, Joe Perches wrote: > > > On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote: > > > If char is signed and ch happens to be negative, printing ch with > > > "%02x" will not do as intended

Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x

2015-12-05 Thread Rasmus Villemoes
On Sun, Dec 06 2015, Joe Perches wrote: > On Sun, 2015-12-06 at 01:05 +0100, Rasmus Villemoes wrote: >> If char is signed and ch happens to be negative, printing ch with >> "%02x" will not do as intended (when ch is -19, one will get >> "ffed"). Fix that by masking with