linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: misplaced parenthesis in find_boot_record()
@ 2010-02-15 21:57 Roel Kluin
  2010-02-15 22:01 ` Roel Kluin
  2010-02-26 13:08 ` David Woodhouse
  0 siblings, 2 replies; 4+ messages in thread
From: Roel Kluin @ 2010-02-15 21:57 UTC (permalink / raw)
  To: David Woodhouse, linux-mtd, Andrew Morton, LKML

The parenthesis was misplaced, upon error a one was shown.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 32e82ae..a269c62 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -102,7 +102,7 @@ static int find_boot_record(struct INFTLrecord *inftl)
 		/* To be safer with BIOS, also use erase mark as discriminant */
 		if ((ret = inftl_read_oob(mtd, block * inftl->EraseSize +
 					  SECTORSIZE + 8, 8, &retlen,
-					  (char *)&h1) < 0)) {
+					  (char *)&h1)) < 0) {
 			printk(KERN_WARNING "INFTL: ANAND header found at "
 				"0x%x in mtd%d, but OOB data read failed "
 				"(err %d)\n", block * inftl->EraseSize,

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

* Re: [PATCH] mtd: misplaced parenthesis in find_boot_record()
  2010-02-15 21:57 [PATCH] mtd: misplaced parenthesis in find_boot_record() Roel Kluin
@ 2010-02-15 22:01 ` Roel Kluin
  2010-02-16  9:09   ` Artem Bityutskiy
  2010-02-26 13:08 ` David Woodhouse
  1 sibling, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2010-02-15 22:01 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-mtd, Andrew Morton, David Woodhouse, LKML

The parenthesis was misplaced

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Not sure if you care about this one, it is between #if 0 ... #endif 

diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
index 8b22b18..1ae6a02 100644
--- a/drivers/mtd/nftlmount.c
+++ b/drivers/mtd/nftlmount.c
@@ -109,7 +109,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
 
 		/* Finally reread to check ECC */
 		if ((ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE,
-				     &retlen, buf) < 0)) {
+				     &retlen, buf)) < 0) {
 			printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n",
 			       block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
 			continue;

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

* Re: [PATCH] mtd: misplaced parenthesis in find_boot_record()
  2010-02-15 22:01 ` Roel Kluin
@ 2010-02-16  9:09   ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2010-02-16  9:09 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-mtd, Andrew Morton, David Woodhouse, LKML

On Mon, 2010-02-15 at 23:01 +0100, Roel Kluin wrote:
> The parenthesis was misplaced
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Not sure if you care about this one, it is between #if 0 ... #endif 
> 
> diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
> index 8b22b18..1ae6a02 100644
> --- a/drivers/mtd/nftlmount.c
> +++ b/drivers/mtd/nftlmount.c
> @@ -109,7 +109,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
>  
>  		/* Finally reread to check ECC */
>  		if ((ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE,
> -				     &retlen, buf) < 0)) {
> +				     &retlen, buf)) < 0) {
>  			printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n",
>  			       block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
>  			continue;

Pushed both patches to my l2-mtd-2.6.git / master.
-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCH] mtd: misplaced parenthesis in find_boot_record()
  2010-02-15 21:57 [PATCH] mtd: misplaced parenthesis in find_boot_record() Roel Kluin
  2010-02-15 22:01 ` Roel Kluin
@ 2010-02-26 13:08 ` David Woodhouse
  1 sibling, 0 replies; 4+ messages in thread
From: David Woodhouse @ 2010-02-26 13:08 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Andrew Morton, linux-mtd, LKML

On Mon, 2010-02-15 at 22:57 +0100, Roel Kluin wrote:
> The parenthesis was misplaced, upon error a one was shown.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

> ---
> diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
> index 32e82ae..a269c62 100644
> --- a/drivers/mtd/inftlmount.c
> +++ b/drivers/mtd/inftlmount.c
> @@ -102,7 +102,7 @@ static int find_boot_record(struct INFTLrecord *inftl)
>  		/* To be safer with BIOS, also use erase mark as discriminant */
>  		if ((ret = inftl_read_oob(mtd, block * inftl->EraseSize +
>  					  SECTORSIZE + 8, 8, &retlen,
> -					  (char *)&h1) < 0)) {
> +					  (char *)&h1)) < 0) {

Ick.

This code is broken because it's fugly. You can see the causality just
by looking at it.

Why on earth would you fix the bug but not fix the fugliness which
caused it?

   ret = inftl_read_oob(...);
   if (ret < 0) {



-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

end of thread, other threads:[~2010-02-26 13:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 21:57 [PATCH] mtd: misplaced parenthesis in find_boot_record() Roel Kluin
2010-02-15 22:01 ` Roel Kluin
2010-02-16  9:09   ` Artem Bityutskiy
2010-02-26 13:08 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).