Re: [PATCH v2 3/4] staging: speakup: reuse native hex2bin()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2013-03-29 at 01:38 +0100, Samuel Thibault wrote: 
> Andy Shevchenko, le Thu 28 Mar 2013 11:02:45 +0200, a écrit :
> > -		} else if (*p1 == 'x' &&
> > -				strchr(hx, p1[1]) && strchr(hx, p1[2])) {
> ...
> > -		} else
> > -			*p++ = *p1++;
> > +		} else {
> > +			if (*p1 == 'x' && !hex2bin(&num, p1 + 1, 1)) {
> ...
> > +			} else
> > +				*p++ = *p1++;
> > +		}
> 
> Why not keeping the same else if structure?  It looks nicer to me to
> keep a series of else if.

Will fix.

> 
> > +			if (*p1 == 'x' && !hex2bin(&num, p1 + 1, 1)) {
> 
> Count should be 2, shouldn't it?

Actually, no. It means bytes in the result.
If I got it correctly the original code translates '\xNN' into NN which
is exactly one byte.

-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux