All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 11:59 ` Nicolas Ferre
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2010-12-15 11:59 UTC (permalink / raw)
  To: dwmw2, linux-mtd; +Cc: linux-kernel, linux-arm-kernel, Nicolas Ferre

Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
it is done in m25p80_write() function.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/mtd/devices/m25p80.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index bf5a002..e6b5707 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
 	size_t actual;
 	int cmd_sz, ret;
 
+	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
+			dev_name(&flash->spi->dev), __func__, "to",
+			(u32)to, len);
+
 	*retlen = 0;
 
 	/* sanity checks */
-- 
1.7.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 11:59 ` Nicolas Ferre
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2010-12-15 11:59 UTC (permalink / raw)
  To: dwmw2, linux-mtd; +Cc: Nicolas Ferre, linux-kernel, linux-arm-kernel

Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
it is done in m25p80_write() function.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/mtd/devices/m25p80.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index bf5a002..e6b5707 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
 	size_t actual;
 	int cmd_sz, ret;
 
+	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
+			dev_name(&flash->spi->dev), __func__, "to",
+			(u32)to, len);
+
 	*retlen = 0;
 
 	/* sanity checks */
-- 
1.7.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 11:59 ` Nicolas Ferre
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2010-12-15 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
it is done in m25p80_write() function.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/mtd/devices/m25p80.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index bf5a002..e6b5707 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
 	size_t actual;
 	int cmd_sz, ret;
 
+	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
+			dev_name(&flash->spi->dev), __func__, "to",
+			(u32)to, len);
+
 	*retlen = 0;
 
 	/* sanity checks */
-- 
1.7.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
  2010-12-15 11:59 ` Nicolas Ferre
  (?)
@ 2010-12-15 13:25   ` Sergei Shtylyov
  -1 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2010-12-15 13:25 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: dwmw2, linux-mtd, linux-kernel, linux-arm-kernel

Hello.

On 15-12-2010 14:59, Nicolas Ferre wrote:

> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
> it is done in m25p80_write() function.

> Signed-off-by: Nicolas Ferre<nicolas.ferre@atmel.com>
[...]

> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index bf5a002..e6b5707 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
>   	size_t actual;
>   	int cmd_sz, ret;
>
> +	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
> +			dev_name(&flash->spi->dev), __func__, "to",

    What's the point of printing "to" as variable? :-)

> +			(u32)to, len);
> +

WBR, Sergei

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 13:25   ` Sergei Shtylyov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2010-12-15 13:25 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: linux-mtd, dwmw2, linux-kernel, linux-arm-kernel

Hello.

On 15-12-2010 14:59, Nicolas Ferre wrote:

> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
> it is done in m25p80_write() function.

> Signed-off-by: Nicolas Ferre<nicolas.ferre@atmel.com>
[...]

> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index bf5a002..e6b5707 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
>   	size_t actual;
>   	int cmd_sz, ret;
>
> +	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
> +			dev_name(&flash->spi->dev), __func__, "to",

    What's the point of printing "to" as variable? :-)

> +			(u32)to, len);
> +

WBR, Sergei

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 13:25   ` Sergei Shtylyov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2010-12-15 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 15-12-2010 14:59, Nicolas Ferre wrote:

> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
> it is done in m25p80_write() function.

> Signed-off-by: Nicolas Ferre<nicolas.ferre@atmel.com>
[...]

> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index bf5a002..e6b5707 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
>   	size_t actual;
>   	int cmd_sz, ret;
>
> +	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
> +			dev_name(&flash->spi->dev), __func__, "to",

    What's the point of printing "to" as variable? :-)

> +			(u32)to, len);
> +

WBR, Sergei

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
  2010-12-15 13:25   ` Sergei Shtylyov
  (?)
@ 2010-12-15 13:43     ` Nicolas Ferre
  -1 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2010-12-15 13:43 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: dwmw2, linux-mtd, linux-kernel, linux-arm-kernel

Le 15/12/2010 14:25, Sergei Shtylyov :
> Hello.
> 
> On 15-12-2010 14:59, Nicolas Ferre wrote:
> 
>> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write()
>> function as
>> it is done in m25p80_write() function.
> 
>> Signed-off-by: Nicolas Ferre<nicolas.ferre@atmel.com>
> [...]
> 
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index bf5a002..e6b5707 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t
>> to, size_t len,
>>       size_t actual;
>>       int cmd_sz, ret;
>>
>> +    DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> +            dev_name(&flash->spi->dev), __func__, "to",
> 
>    What's the point of printing "to" as variable? :-)

Good question... Maybe a way to have the same shape of messages...

In my patch it is for sure to comply with this driver way of dealing
with DEBUG messages.
It is "to" in this function like its sister m25p80_write(). But it is
also "from" or "at" in others...

>> +            (u32)to, len);
>> +

Cheers,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 13:43     ` Nicolas Ferre
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2010-12-15 13:43 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mtd, dwmw2, linux-kernel, linux-arm-kernel

Le 15/12/2010 14:25, Sergei Shtylyov :
> Hello.
> 
> On 15-12-2010 14:59, Nicolas Ferre wrote:
> 
>> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write()
>> function as
>> it is done in m25p80_write() function.
> 
>> Signed-off-by: Nicolas Ferre<nicolas.ferre@atmel.com>
> [...]
> 
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index bf5a002..e6b5707 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t
>> to, size_t len,
>>       size_t actual;
>>       int cmd_sz, ret;
>>
>> +    DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> +            dev_name(&flash->spi->dev), __func__, "to",
> 
>    What's the point of printing "to" as variable? :-)

Good question... Maybe a way to have the same shape of messages...

In my patch it is for sure to comply with this driver way of dealing
with DEBUG messages.
It is "to" in this function like its sister m25p80_write(). But it is
also "from" or "at" in others...

>> +            (u32)to, len);
>> +

Cheers,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
  2010-12-15 13:25   ` Sergei Shtylyov
  (?)
@ 2010-12-15 16:12     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2010-12-15 16:12 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Nicolas Ferre, linux-mtd, dwmw2, linux-kernel, linux-arm-kernel

On Wed, Dec 15, 2010 at 04:25:28PM +0300, Sergei Shtylyov wrote:
>> +	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> +			dev_name(&flash->spi->dev), __func__, "to",
>
>    What's the point of printing "to" as variable? :-)

One valid reason to do this is if you have several formatting strings
all the same.  GCC can merge identical strings together.

So, if you have:

 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "to"
 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "from"
 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "foo"

Then you end up with one long string and three short strings instead of

 "%s: %s to 0x%08x, len %zd", dev_name(), __func__
 "%s: %s from 0x%08x, len %zd", dev_name(), __func__
 "%s: %s foo 0x%08x, len %zd", dev_name(), __func__

which'd be three long strings.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 16:12     ` Russell King - ARM Linux
  0 siblings, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2010-12-15 16:12 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-mtd, Nicolas Ferre, dwmw2, linux-arm-kernel, linux-kernel

On Wed, Dec 15, 2010 at 04:25:28PM +0300, Sergei Shtylyov wrote:
>> +	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> +			dev_name(&flash->spi->dev), __func__, "to",
>
>    What's the point of printing "to" as variable? :-)

One valid reason to do this is if you have several formatting strings
all the same.  GCC can merge identical strings together.

So, if you have:

 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "to"
 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "from"
 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "foo"

Then you end up with one long string and three short strings instead of

 "%s: %s to 0x%08x, len %zd", dev_name(), __func__
 "%s: %s from 0x%08x, len %zd", dev_name(), __func__
 "%s: %s foo 0x%08x, len %zd", dev_name(), __func__

which'd be three long strings.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 16:12     ` Russell King - ARM Linux
  0 siblings, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2010-12-15 16:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 15, 2010 at 04:25:28PM +0300, Sergei Shtylyov wrote:
>> +	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> +			dev_name(&flash->spi->dev), __func__, "to",
>
>    What's the point of printing "to" as variable? :-)

One valid reason to do this is if you have several formatting strings
all the same.  GCC can merge identical strings together.

So, if you have:

 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "to"
 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "from"
 "%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "foo"

Then you end up with one long string and three short strings instead of

 "%s: %s to 0x%08x, len %zd", dev_name(), __func__
 "%s: %s from 0x%08x, len %zd", dev_name(), __func__
 "%s: %s foo 0x%08x, len %zd", dev_name(), __func__

which'd be three long strings.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
  2010-12-15 11:59 ` Nicolas Ferre
  (?)
@ 2010-12-19 17:00   ` Artem Bityutskiy
  -1 siblings, 0 replies; 15+ messages in thread
From: Artem Bityutskiy @ 2010-12-19 17:00 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: dwmw2, linux-mtd, linux-kernel, linux-arm-kernel

On Wed, 2010-12-15 at 12:59 +0100, Nicolas Ferre wrote:
> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
> it is done in m25p80_write() function.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

So do you do this only becaus it is done in m25p80_write()? This is what
the commit message suggests... Have you found these DEBUG macros useful
for you? (I never found them any useful).

Anyway, I've put this to my l2-mtd-2.6.git tree, thanks.

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-19 17:00   ` Artem Bityutskiy
  0 siblings, 0 replies; 15+ messages in thread
From: Artem Bityutskiy @ 2010-12-19 17:00 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: linux-mtd, dwmw2, linux-kernel, linux-arm-kernel

On Wed, 2010-12-15 at 12:59 +0100, Nicolas Ferre wrote:
> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
> it is done in m25p80_write() function.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

So do you do this only becaus it is done in m25p80_write()? This is what
the commit message suggests... Have you found these DEBUG macros useful
for you? (I never found them any useful).

Anyway, I've put this to my l2-mtd-2.6.git tree, thanks.

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-19 17:00   ` Artem Bityutskiy
  0 siblings, 0 replies; 15+ messages in thread
From: Artem Bityutskiy @ 2010-12-19 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2010-12-15 at 12:59 +0100, Nicolas Ferre wrote:
> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as
> it is done in m25p80_write() function.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

So do you do this only becaus it is done in m25p80_write()? This is what
the commit message suggests... Have you found these DEBUG macros useful
for you? (I never found them any useful).

Anyway, I've put this to my l2-mtd-2.6.git tree, thanks.

-- 
Best Regards,
Artem Bityutskiy (???????? ?????)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] MTD: m25p80: add debugging trace in sst_write()
@ 2010-12-15 13:43     ` Nicolas Ferre
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2011-07-08 16:43 UTC (permalink / raw)
  To: linux-arm-kernel

Le 15/12/2010 14:25, Sergei Shtylyov :
> Hello.
> 
> On 15-12-2010 14:59, Nicolas Ferre wrote:
> 
>> Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write()
>> function as
>> it is done in m25p80_write() function.
> 
>> Signed-off-by: Nicolas Ferre<nicolas.ferre@atmel.com>
> [...]
> 
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index bf5a002..e6b5707 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -482,6 +482,10 @@ static int sst_write(struct mtd_info *mtd, loff_t
>> to, size_t len,
>>       size_t actual;
>>       int cmd_sz, ret;
>>
>> +    DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> +            dev_name(&flash->spi->dev), __func__, "to",
> 
>    What's the point of printing "to" as variable? :-)

Good question... Maybe a way to have the same shape of messages...

In my patch it is for sure to comply with this driver way of dealing
with DEBUG messages.
It is "to" in this function like its sister m25p80_write(). But it is
also "from" or "at" in others...

>> +            (u32)to, len);
>> +

Cheers,
-- 
Nicolas Ferre

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-07-08 16:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-15 11:59 [PATCH] MTD: m25p80: add debugging trace in sst_write() Nicolas Ferre
2010-12-15 11:59 ` Nicolas Ferre
2010-12-15 11:59 ` Nicolas Ferre
2010-12-15 13:25 ` Sergei Shtylyov
2010-12-15 13:25   ` Sergei Shtylyov
2010-12-15 13:25   ` Sergei Shtylyov
2010-12-15 13:43   ` Nicolas Ferre
2011-07-08 16:43     ` Nicolas Ferre
2010-12-15 13:43     ` Nicolas Ferre
2010-12-15 16:12   ` Russell King - ARM Linux
2010-12-15 16:12     ` Russell King - ARM Linux
2010-12-15 16:12     ` Russell King - ARM Linux
2010-12-19 17:00 ` Artem Bityutskiy
2010-12-19 17:00   ` Artem Bityutskiy
2010-12-19 17:00   ` Artem Bityutskiy

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.