All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: dedekind1@gmail.com, koen.beel.barco@gmail.com,
	marek.vasut@gmail.com, linux-mtd@lists.infradead.org,
	shijie8@gmail.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v11 1/3] MTD : add the common code for GPMI-NAND controller driver
Date: Tue, 6 Sep 2011 10:00:28 +0800	[thread overview]
Message-ID: <4E657EBC.7060800@freescale.com> (raw)
In-Reply-To: <20110905151752.GA10987@pengutronix.de>

Hi Wolfram:
> On Mon, Aug 29, 2011 at 07:12:59PM +0800, Huang Shijie wrote:
>> These files contain the common code for the GPMI-NAND driver.
>>
>> Signed-off-by: Huang Shijie <b32955@freescale.com>
>> Acked-by: Marek Vasut <marek.vasut@gmail.com>
>> Tested-by: Koen Beel <koen.beel@barco.com>
> ...
>
>> +static int __devinit
>> +acquire_register_block(struct gpmi_nand_data *this, const char *res_name)
>> +{
>> +	struct platform_device *pdev = this->pdev;
>> +	struct resources *res = &this->resources;
>> +	struct resource *r;
>> +	void *p;
>> +
>> +	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name);
>> +	if (!r) {
>> +		pr_err("Can't get resource for %s\n", res_name);
>> +		return -ENXIO;
>> +	}
>> +
>> +	p = ioremap(r->start, resource_size(r));
>> +	if (!p) {
>> +		pr_err("Can't remap %s\n", res_name);
>> +		return -ENOMEM;
>> +	}
>> +
>> +	if (res_name == GPMI_NAND_GPMI_REGS_ADDR_RES_NAME)
>> +		res->gpmi_regs = p;
>> +	else if (res_name == GPMI_NAND_BCH_REGS_ADDR_RES_NAME)
>> +		res->bch_regs = p;
> Am I the only one getting warnings here?
>
I did not meet the warinings. but it does worth fixing. thanks
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c: In function 'acquire_register_block':
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c:345:15: warning: comparison with string literal results in unspecified behavior
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c:347:20: warning: comparison with string literal results in unspecified behavior
>
> Really worth fixing IMHO...
>
>> +	else
>> +		BUG();
> dev_err + ENODEV?
>
> Might be worth checking the other BUG()-occurences as well if they really need
> to halt the kernel.
ok. no problem.


Did you test the driver with rootfs?

Best Regards
Huang Shijie
> Regards,
>
>    Wolfram
>

WARNING: multiple messages have this Message-ID (diff)
From: b32955@freescale.com (Huang Shijie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v11 1/3] MTD : add the common code for GPMI-NAND controller driver
Date: Tue, 6 Sep 2011 10:00:28 +0800	[thread overview]
Message-ID: <4E657EBC.7060800@freescale.com> (raw)
In-Reply-To: <20110905151752.GA10987@pengutronix.de>

Hi Wolfram:
> On Mon, Aug 29, 2011 at 07:12:59PM +0800, Huang Shijie wrote:
>> These files contain the common code for the GPMI-NAND driver.
>>
>> Signed-off-by: Huang Shijie <b32955@freescale.com>
>> Acked-by: Marek Vasut <marek.vasut@gmail.com>
>> Tested-by: Koen Beel <koen.beel@barco.com>
> ...
>
>> +static int __devinit
>> +acquire_register_block(struct gpmi_nand_data *this, const char *res_name)
>> +{
>> +	struct platform_device *pdev = this->pdev;
>> +	struct resources *res = &this->resources;
>> +	struct resource *r;
>> +	void *p;
>> +
>> +	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name);
>> +	if (!r) {
>> +		pr_err("Can't get resource for %s\n", res_name);
>> +		return -ENXIO;
>> +	}
>> +
>> +	p = ioremap(r->start, resource_size(r));
>> +	if (!p) {
>> +		pr_err("Can't remap %s\n", res_name);
>> +		return -ENOMEM;
>> +	}
>> +
>> +	if (res_name == GPMI_NAND_GPMI_REGS_ADDR_RES_NAME)
>> +		res->gpmi_regs = p;
>> +	else if (res_name == GPMI_NAND_BCH_REGS_ADDR_RES_NAME)
>> +		res->bch_regs = p;
> Am I the only one getting warnings here?
>
I did not meet the warinings. but it does worth fixing. thanks
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c: In function 'acquire_register_block':
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c:345:15: warning: comparison with string literal results in unspecified behavior
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c:347:20: warning: comparison with string literal results in unspecified behavior
>
> Really worth fixing IMHO...
>
>> +	else
>> +		BUG();
> dev_err + ENODEV?
>
> Might be worth checking the other BUG()-occurences as well if they really need
> to halt the kernel.
ok. no problem.


Did you test the driver with rootfs?

Best Regards
Huang Shijie
> Regards,
>
>    Wolfram
>

  reply	other threads:[~2011-09-06  2:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 11:12 [PATCH v11 0/3] add the GPMI controller driver for IMX23/IMX28 Huang Shijie
2011-08-29 11:12 ` Huang Shijie
2011-08-29 11:12 ` [PATCH v11 1/3] MTD : add the common code for GPMI-NAND controller driver Huang Shijie
2011-08-29 11:12   ` Huang Shijie
2011-09-05 15:17   ` Wolfram Sang
2011-09-05 15:17     ` Wolfram Sang
2011-09-06  2:00     ` Huang Shijie [this message]
2011-09-06  2:00       ` Huang Shijie
2011-09-06 10:31     ` Huang Shijie
2011-09-06 10:31       ` Huang Shijie
2011-09-06 14:17       ` Wolfram Sang
2011-09-06 14:17         ` Wolfram Sang
2011-09-07  9:59         ` Wolfram Sang
2011-09-07  9:59           ` Wolfram Sang
2011-09-08  1:22           ` Huang Shijie
2011-09-08  1:22             ` Huang Shijie
2011-08-29 11:13 ` [PATCH v11 2/3] MTD : add helper functions library and header files for GPMI NAND driver Huang Shijie
2011-08-29 11:13   ` Huang Shijie
2011-08-29 11:13 ` [PATCH v11 3/3] MTD : add GPMI-NAND driver in the config and Makefile Huang Shijie
2011-08-29 11:13   ` Huang Shijie

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=4E657EBC.7060800@freescale.com \
    --to=b32955@freescale.com \
    --cc=dedekind1@gmail.com \
    --cc=koen.beel.barco@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=shijie8@gmail.com \
    --cc=w.sang@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.