From: Wolfgang Denk Date: Mon, 26 Oct 2020 11:24:55 +0100 Subject: [PATCH v2 2/4] spi: Remove uses of #ifndef __U_BOOT__ from spi-mem.c In-Reply-To: <0897a97a-1630-b0ec-9e27-06d1aa940d47@gmail.com> References: <20200807171334.307491-1-seanga2@gmail.com> <20200807171334.307491-3-seanga2@gmail.com> <0897a97a-1630-b0ec-9e27-06d1aa940d47@gmail.com> Message-ID: <15618.1603707895@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Sean, In message <0897a97a-1630-b0ec-9e27-06d1aa940d47@gmail.com> you wrote: > > > I think these ifdef to track Linux change. Of course, I'm not fond of > > these changes, if Vignesh is fine I'll push. Indeed the #ifdef's have probably been used to keep the difference to the original Linux kernel source minimal. Before they are removed, one should test how difficult it is to update code as is against current Linux mainline, maybe by rebasing against or cherry-pickin from there. I have no idea how much code has checnged in both driver versions since, and how difficult any such upgrade might be, but we should check it. > 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. If its just for reading / understanding the code, you can always run it through the unifdef tool ... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Real programmers don't comment their code. It was hard to write, it should be hard to understand.