Re: [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code

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

 



On Wed, 11 Apr 2012, Arnd Bergmann wrote:

> On Wednesday 11 April 2012, Paul Walmsley wrote:
> > +void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> > +{
> > +       struct nand_chip *this = mtd->priv;
> > +       unsigned long mask;
> > +
> > +       if (cmd == NAND_CMD_NONE)
> > +               return;
> > +
> > +       mask = (ctrl & NAND_CLE) ? 0x02 : 0;
> > +       if (ctrl & NAND_ALE)
> > +               mask |= 0x04;
> > +
> > +       mask |= (unsigned long)this->IO_ADDR_W;
> > +
> > +       writeb(cmd, (void __iomem *)mask);
> > +}
> 
> IO_ADDR_W is always a page aligned pointer AFAICT, so you can actually
> remove both casts and make it more readable at the same time by writing
> the last two lines as
> 
> 	writeb(cmd, this->IO_ADDR_W + mask);

Thanks, patch updated.


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux