From: Wolfgang Denk Date: Wed, 23 Jun 2010 22:51:28 +0200 Subject: [U-Boot] [PATCH] cmd_ide: Convert to [read,write][b,w] In-Reply-To: <1277320683-2057-1-git-send-email-marek.vasut@gmail.com> References: <1277320683-2057-1-git-send-email-marek.vasut@gmail.com> Message-ID: <20100623205128.52C001524F4@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 Marek Vasut, In message <1277320683-2057-1-git-send-email-marek.vasut@gmail.com> you wrote: > Signed-off-by: Marek Vasut > --- > common/cmd_ide.c | 22 +++++++++++++--------- > 1 files changed, 13 insertions(+), 9 deletions(-) I don't see the big advantage of this patch yet. > #ifndef CONFIG_SYS_ATA_PORT_ADDR > @@ -526,7 +526,7 @@ __ide_outb(int dev, int port, unsigned char val) > { > debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n", > dev, port, val, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port))); > - outb(val, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port))); > + writeb(val, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port))); So we replace outb() => writeb(), but the function where this is used is still __ide_outb() ? The __ide_outb() => outb() mapping looks more logical to me. > -output_data(int dev, ulong *sect_buf, int words) > +output_data(int dev, uint16_t *sect_buf, int words) > { > - outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1); > + int i; > + for (i = 0; i < (words << 1); i++) > + writew(sect_buf[i], ATA_CURR_BASE(dev)+ATA_DATA_REG); And here the code size is growing, too. What are the exact advantages of your version? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 We are all agreed that your theory is crazy. The question which divides us is whether it is crazy enough to have a chance of being correct. My own feeling is that it is not crazy enough. - Niels Bohr