[RFC/PATCH] mtd: nand: Refactor print messages

Brian Norris computersforpeace at gmail.com
Wed Dec 4 21:01:37 EST 2013


Hi Ezequiel,

On Mon, Nov 25, 2013 at 08:30:31AM -0300, Ezequiel Garcia wrote:
> Add a nice "nand:" prefix to all pr_xxx() messages. This allows
> to get rid of the "NAND" words in messages, given the context
> is already given by the prefix.

This ptach looks mostly good to me. A few comments below. If no one
objects soon, I'll push this.

> Remove the __func__ report from messages where it's not needed and refactor
> the device detection messages to show itself in several lines.

There are a few more instances of __func__ that might not be needed, but
I think we're OK for now.

> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
> ---

...

> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index bd39f7b..4bdc0df 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
...
> @@ -3372,8 +3374,8 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
>  		id_data[i] = chip->read_byte(mtd);
>  
>  	if (id_data[0] != *maf_id || id_data[1] != *dev_id) {
> -		pr_info("%s: second ID read did not match "
> -			"%02x,%02x against %02x,%02x\n", __func__,
> +		pr_info("second ID read did not match "
> +			"%02x,%02x against %02x,%02x\n",

scripts/checkpatch.pl and Documentation/CodingStyle don't like this long
string (even though it would be over 80 chars). I think we should combine them.

If no one objects to the patch, I'll just make the modification myself.

>  			*maf_id, *dev_id, id_data[0], id_data[1]);
>  		return ERR_PTR(-ENODEV);
>  	}

Brian



More information about the linux-mtd mailing list