Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
@ 2014-06-20  9:11 Ted Juan
  2014-06-20  9:32 ` Ted Juan
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Juan @ 2014-06-20  9:11 UTC (permalink / raw)
  To: computersforpeace; +Cc: Ted Juan, linux-mtd, pekon

From: Ted Juan <ted.juan@weintek.com>

 These two function's switch case lack the 'break' that make them always return error.


Signed-off-by: Ted Juan <ted.juan@weintek.com>
---
 drivers/mtd/devices/elm.c  |    2 ++
 "toreqq\033\033qq\033\033" |   20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 "toreqq\033\033qq\033\033"

diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index 7df8694..b4f61c7 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info)
 					ELM_SYNDROME_FRAGMENT_1 + offset);
 			regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_0 + offset);
+			break;
 		default:
 			return -EINVAL;
 		}
@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info)
 					regs->elm_syndrome_fragment_1[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,
 					regs->elm_syndrome_fragment_0[i]);
+			break;
 		default:
 			return -EINVAL;
 		}
diff --git "a/toreqq\033\033qq\033\033" "b/toreqq\033\033qq\033\033"
new file mode 100644
index 0000000..4a7b35c
--- /dev/null
+++ "b/toreqq\033\033qq\033\033"
@@ -0,0 +1,20 @@
+^[[1mdiff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c^[[m
+^[[1mindex 7df8694..8e6ba6c 100644^[[m
+^[[1m--- a/drivers/mtd/devices/elm.c^[[m
+^[[1m+++ b/drivers/mtd/devices/elm.c^[[m
+^[[36m@@ -475,6 +475,7 @@^[[m ^[[mstatic int elm_context_save(struct elm_info *info)^[[m
+ 					ELM_SYNDROME_FRAGMENT_1 + offset);^[[m
+ 			regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,^[[m
+ 					ELM_SYNDROME_FRAGMENT_0 + offset);^[[m
+^[[32m+^[[m^[[32m                        break;^[[m
+ 		default:^[[m
+ 			return -EINVAL;^[[m
+ 		}^[[m
+^[[36m@@ -520,6 +521,7 @@^[[m ^[[mstatic int elm_context_restore(struct elm_info *info)^[[m
+ 					regs->elm_syndrome_fragment_1[i]);^[[m
+ 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,^[[m
+ 					regs->elm_syndrome_fragment_0[i]);^[[m
+^[[32m+^[[m^[[32m                        break;^[[m
+ 		default:^[[m
+ 			return -EINVAL;^[[m
+ 		}^[[m
-- 
1.7.9.5

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

* [PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
  2014-06-20  9:11 [PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions Ted Juan
@ 2014-06-20  9:32 ` Ted Juan
  2014-06-20  9:45   ` Gupta, Pekon
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Juan @ 2014-06-20  9:32 UTC (permalink / raw)
  To: computersforpeace; +Cc: Ted Juan, linux-mtd, pekon

 Sorry, last mail has some error. please drop it.

 These two function's switch case lack the 'break' that make them always return error.

Signed-off-by: Ted Juan <ted.juan@gmail.com>
---
 drivers/mtd/devices/elm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index 7df8694..b4f61c7 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info)
 					ELM_SYNDROME_FRAGMENT_1 + offset);
 			regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,
 					ELM_SYNDROME_FRAGMENT_0 + offset);
+			break;
 		default:
 			return -EINVAL;
 		}
@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info)
 					regs->elm_syndrome_fragment_1[i]);
 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,
 					regs->elm_syndrome_fragment_0[i]);
+			break;
 		default:
 			return -EINVAL;
 		}
-- 
1.7.9.5

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

* RE: [PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
  2014-06-20  9:32 ` Ted Juan
@ 2014-06-20  9:45   ` Gupta, Pekon
  2014-07-05 22:50     ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Gupta, Pekon @ 2014-06-20  9:45 UTC (permalink / raw)
  To: Ted Juan, computersforpeace@gmail.com
  Cc: Liu, Yan, linux-mtd@lists.infradead.org

>From: Ted Juan [mailto:ted.juan@gmail.com]
>
> These two function's switch case lack the 'break' that make them always return error.
>
>Signed-off-by: Ted Juan <ted.juan@gmail.com>
>---
> drivers/mtd/devices/elm.c |    2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
>index 7df8694..b4f61c7 100644
>--- a/drivers/mtd/devices/elm.c
>+++ b/drivers/mtd/devices/elm.c
>@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info)
> 					ELM_SYNDROME_FRAGMENT_1 + offset);
> 			regs->elm_syndrome_fragment_0[i] = elm_read_reg(info,
> 					ELM_SYNDROME_FRAGMENT_0 + offset);
>+			break;
> 		default:
> 			return -EINVAL;
> 		}
>@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info)
> 					regs->elm_syndrome_fragment_1[i]);
> 			elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset,
> 					regs->elm_syndrome_fragment_0[i]);
>+			break;
> 		default:
> 			return -EINVAL;
> 		}
>--
>1.7.9.5

Thanks for fixing this. Apologies, my bad, I didn't test this nicely.
Also, marking it for stable, as it might break transition to low-power modes

CC: <stable@vger.kernel.org> # 3.12.x+
Acked-by: Pekon Gupta <pekon@ti.com>

with regards, pekon

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

* Re: [PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
  2014-06-20  9:45   ` Gupta, Pekon
@ 2014-07-05 22:50     ` Brian Norris
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2014-07-05 22:50 UTC (permalink / raw)
  To: Gupta, Pekon; +Cc: Ted Juan, Liu, Yan, linux-mtd@lists.infradead.org

On Fri, Jun 20, 2014 at 09:45:32AM +0000, Pekon Gupta wrote:
> >From: Ted Juan [mailto:ted.juan@gmail.com]
> >
> > These two function's switch case lack the 'break' that make them always return error.
> >
> >Signed-off-by: Ted Juan <ted.juan@gmail.com>
...
> 
> Thanks for fixing this. Apologies, my bad, I didn't test this nicely.
> Also, marking it for stable, as it might break transition to low-power modes
> 
> CC: <stable@vger.kernel.org> # 3.12.x+
> Acked-by: Pekon Gupta <pekon@ti.com>

Pushed to linux-mtd.git, tagged for -stable. I'll try to send this to
Linus during the 3.16 cycle.

Thanks for the fix and the review!

Brian

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

end of thread, other threads:[~2014-07-05 22:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-20  9:11 [PATCH] mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions Ted Juan
2014-06-20  9:32 ` Ted Juan
2014-06-20  9:45   ` Gupta, Pekon
2014-07-05 22:50     ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox