[PATCH v2 2/4] spi: Remove uses of #ifndef __U_BOOT__ from spi-mem.c

Sean Anderson seanga2 at gmail.com
Sun Oct 25 20:21:13 CET 2020


On 10/23/20 2:26 PM, Jagan Teki wrote:
> On Fri, Aug 7, 2020 at 10:43 PM Sean Anderson <seanga2 at gmail.com> wrote:
>>
>> Preprocessing out large sections of the file is confusing and makes it
>> difficult to follow the control flow. Presumably these were initially added
>> to make porting easier, but this code has not been synced with Linux since
>> it was introduced two years ago.
>>
>> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
>> ---
>>
>> Changes in v2:
>> - Don't remove in-use headers
>> - Split removal of EXPORT_SYMBOL_GPL into another patch
>>
>>  drivers/spi/spi-mem.c | 273 ------------------------------------------
>>  1 file changed, 273 deletions(-)
>>
>> diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
>> index c095ae9505..d7209837d0 100644
>> --- a/drivers/spi/spi-mem.c
>> +++ b/drivers/spi/spi-mem.c
>> @@ -6,13 +6,6 @@
>>   * Author: Boris Brezillon <boris.brezillon at bootlin.com>
>>   */
>>
>> -#ifndef __UBOOT__
> 
> I think these ifdef to track Linux change. Of course, I'm not fond of
> these changes, if Vignesh is fine I'll push.

I'm not particularly attached to this patch. However, it can be quite
difficult to read this file because of how much code is ifdef'd out.
Entire functions (spi_controller_dma_(un)map_mem_op_data,
spi_mem_{probe,shutdown,remove}, etc.) are included but ifdef'd out.
When reading this code, I often found myself reading some code only to
realize that it wouldn't be compiled.

--Sean


More information about the U-Boot mailing list