mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
PATCH 1/1 mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
From: Ted Juan <[email protected]>
These two function's switch case lack the 'break' that make them always return error.
--- 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"
drivers/mtd/devices/elm.c +2 -0
@@ -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 ; }
toreqq\033\033qq\033\033 new file +20 -0
@@ -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
Signature · 1 line
1.7.9.5
PATCH 1/1 mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions
Sorry, last mail has some error. please drop it.
These two function's switch case lack the 'break' that make them always return error.
--- drivers/mtd/devices/elm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mtd/devices/elm.c +2 -0
@@ -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 ; }
Signature · 1 line
1.7.9.5
Quoted 30 lines
From: Ted Juan [mailto:[email protected]]
These two function's switch case lack the 'break' that make them always return error.
Signed-off-by Ted Juan <[email protected]>---
drivers/mtd/devices/elm.c| 2 ++1 file changed, 2 insertions(+)drivers/mtd/devices/elm.c +2
-1@@ -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 ; } --
Quoted 1 line
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
with regards, pekon
Brian Norris
AppliedQuoted 5 lines · Pekon Gupta
Quoted 5 lines
From: Ted Juan [mailto:[email protected]]
These two function's switch case lack the 'break' that make them always return error.
Signed-off-by Ted Juan <[email protected]>
...
Quoted 6 lines
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 <[email protected]> # 3.12.x+Acked-by Pekon Gupta <[email protected]>
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