public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: vimal singh <vimalsingh@ti.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] [MTD] [NAND] Add OMAP2 / OMAP3 NAND driver
Date: Fri, 24 Apr 2009 11:13:34 +0300	[thread overview]
Message-ID: <1240560814.22645.21.camel@localhost.localdomain> (raw)
In-Reply-To: <49321.192.168.10.89.1239008519.squirrel@dbdmail.itg.ti.com>

Few comments of stylistic nature are below.

On Mon, 2009-04-06 at 14:31 +0530, vimal singh wrote:
> +/*
> + * drivers/mtd/nand/omap2.c
Would it be possible to remove the above?

> +#define GPMC_IRQ_STATUS		0x18
> +#define GPMC_ECC_CONFIG		0x1F4
> +#define GPMC_ECC_CONTROL	0x1F8
> +#define GPMC_ECC_SIZE_CONFIG	0x1FC
> +#define GPMC_ECC1_RESULT	0x200
> +
> +#define	DRIVER_NAME	"omap2-nand"
Are you going to change driver name often? If not, do not
define this.

> +#define	NAND_IO_SIZE	SZ_4K
Confusing variable, can you please add a comment?

> +
> +#define	NAND_WP_ON	1
> +#define	NAND_WP_OFF	0
I think these defines should be killed.

> +#define TF(value)	(value ? 1 : 0)\
Could this define be killed please?


> +
> +/*
> + * omap_nand_wp - This function enable or disable the Write Protect feature on
> + * NAND device
> + * @mtd: MTD device structure
> + * @mode: WP ON/OFF
> + */

Kerneldoc comments should start with /**

> +/*
> + * hardware specific access to control-lines
> + * NOTE: boards may use different bits for these!!
> + *
> + * ctrl:
> + * NAND_NCE: bit 0 - don't care
> + * NAND_CLE: bit 1 -> Command Latch
> + * NAND_ALE: bit 2 -> Address Latch
> + */

If you try to use kerneldoc comments, use them everywhere,
be consistent please.

Documentation/kernel-doc-nano-HOWTO.txt

Glance at all comments.

> +static int omap_verify_buf(struct mtd_info *mtd, const u_char * buf, int len)
> +{
> +	struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
> +							mtd);
It is less ugly to do:

struct omap_nand_info *info;

info = container_of(mtd, struct omap_nand_info, mtd);

> +	u16 *p = (u16 *) buf;
> +
> +	len >>= 1;
> +
> +	while (len--) {
> +
> +		if (*p++ != cpu_to_le16(readw(info->nand.IO_ADDR_R)))
> +			return -EFAULT;
> +	}
> +
> +	return 0;
> +}
Very sparse code, too many blank lines...

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

  reply	other threads:[~2009-04-24  8:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06  9:01 [PATCH] [MTD] [NAND] Add OMAP2 / OMAP3 NAND driver vimal singh
2009-04-24  8:13 ` Artem Bityutskiy [this message]
     [not found] <49321.192.168.10.89.1239008520.squirrel@dbdmail.itg.ti.com>
2009-04-24  6:40 ` vimal singh
2009-04-24  8:16   ` Artem Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2009-04-24 11:04 vimal singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1240560814.22645.21.camel@localhost.localdomain \
    --to=dedekind@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vimalsingh@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox