[U-Boot] [PATCH V2 08/11] SPI: mxc_spi: fix swapping bug and add missing swapping in unaligned rx case

Stefano Babic sbabic at denx.de
Thu Jan 20 11:29:19 CET 2011


On 01/20/2011 10:32 AM, Wolfgang Denk wrote:
> Dear Stefano Babic,
> 
> In message <1295513194-16158-9-git-send-email-sbabic at denx.de> you wrote:
>> From: Anatolij Gustschin <agust at denx.de>
>>
>> We need to shift only one time in each cycle in the swapping loop
>> for unaligned tx case. Currently two byte shift operations are
>> performed in each loop cycle causing zero gaps in the transmited
>> data, so not all data scheduled for transmition is actually
>> transmited.
>>
>> The proper swapping in unaligned rx case is missing, so add it
>> as we need to put the received data into the rx buffer in the
>> correct byte order.
>>
>> Signed-off-by: Anatolij Gustschin <agust at denx.de>
>> Tested-by: Stefano Babic <sbabic at denx.de>
> 
> Checkpatch says:
> 
> 	[U-Boot] [PATCH V2 08/11] SPI: mxc_spi: fix swapping bug and add
> 	total: 0 errors, 1 warnings, 22 lines checked

WARNING: braces {} are not necessary for single statement blocks
#31: FILE: drivers/spi/mxc_spi.c:375:
+				for (i = 0; i < 4; i++) {
 					data = (data << 8) | (*dout++ & 0xFF);
 				}

total: 0 errors, 1 warnings, 22 lines checked

This is exactly what you prefer, but checkpatch complains. IMHO I prefer
to fix in this patch removing braces, and do not change in previous
patches where you suggest to add braces (and then checkpatch will
complain about it).

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list