* [PATCH][RESEND] lightnvm: Avoid validation of default op value
@ 2018-02-26 20:22 Heiner Litz
2018-02-26 20:35 ` Javier Gonzalez
2018-02-27 7:44 ` Matias Bjørling
0 siblings, 2 replies; 3+ messages in thread
From: Heiner Litz @ 2018-02-26 20:22 UTC (permalink / raw)
To: linux-block; +Cc: javier, mb, Heiner Litz
Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl")
Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
---
drivers/lightnvm/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index dcc9e621e651..74b53fc1b813 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -304,11 +304,9 @@ static int __nvm_config_extended(struct nvm_dev *dev,
}
/* op not set falls into target's default */
- if (e->op == 0xFFFF)
+ if (e->op == 0xFFFF) {
e->op = NVM_TARGET_DEFAULT_OP;
-
- if (e->op < NVM_TARGET_MIN_OP ||
- e->op > NVM_TARGET_MAX_OP) {
+ } else if (e->op < NVM_TARGET_MIN_OP || e->op > NVM_TARGET_MAX_OP) {
pr_err("nvm: invalid over provisioning value\n");
return -EINVAL;
}
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][RESEND] lightnvm: Avoid validation of default op value
2018-02-26 20:22 [PATCH][RESEND] lightnvm: Avoid validation of default op value Heiner Litz
@ 2018-02-26 20:35 ` Javier Gonzalez
2018-02-27 7:44 ` Matias Bjørling
1 sibling, 0 replies; 3+ messages in thread
From: Javier Gonzalez @ 2018-02-26 20:35 UTC (permalink / raw)
To: Heiner Litz; +Cc: linux-block, Matias Bjørling
[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]
> On 26 Feb 2018, at 21.22, Heiner Litz <hlitz@ucsc.edu> wrote:
>
> Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl")
>
> Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
> ---
> drivers/lightnvm/core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index dcc9e621e651..74b53fc1b813 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -304,11 +304,9 @@ static int __nvm_config_extended(struct nvm_dev *dev,
> }
>
> /* op not set falls into target's default */
> - if (e->op == 0xFFFF)
> + if (e->op == 0xFFFF) {
> e->op = NVM_TARGET_DEFAULT_OP;
> -
> - if (e->op < NVM_TARGET_MIN_OP ||
> - e->op > NVM_TARGET_MAX_OP) {
> + } else if (e->op < NVM_TARGET_MIN_OP || e->op > NVM_TARGET_MAX_OP) {
> pr_err("nvm: invalid over provisioning value\n");
> return -EINVAL;
> }
> --
> 2.14.1
Thanks for applying the changes. Looks good to me now.
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][RESEND] lightnvm: Avoid validation of default op value
2018-02-26 20:22 [PATCH][RESEND] lightnvm: Avoid validation of default op value Heiner Litz
2018-02-26 20:35 ` Javier Gonzalez
@ 2018-02-27 7:44 ` Matias Bjørling
1 sibling, 0 replies; 3+ messages in thread
From: Matias Bjørling @ 2018-02-27 7:44 UTC (permalink / raw)
To: Heiner Litz, linux-block; +Cc: javier
On 02/26/2018 09:22 PM, Heiner Litz wrote:
> Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl")
>
> Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
> ---
> drivers/lightnvm/core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index dcc9e621e651..74b53fc1b813 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -304,11 +304,9 @@ static int __nvm_config_extended(struct nvm_dev *dev,
> }
>
> /* op not set falls into target's default */
> - if (e->op == 0xFFFF)
> + if (e->op == 0xFFFF) {
> e->op = NVM_TARGET_DEFAULT_OP;
> -
> - if (e->op < NVM_TARGET_MIN_OP ||
> - e->op > NVM_TARGET_MAX_OP) {
> + } else if (e->op < NVM_TARGET_MIN_OP || e->op > NVM_TARGET_MAX_OP) {
> pr_err("nvm: invalid over provisioning value\n");
> return -EINVAL;
> }
>
Thanks Heiner. Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-27 7:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26 20:22 [PATCH][RESEND] lightnvm: Avoid validation of default op value Heiner Litz
2018-02-26 20:35 ` Javier Gonzalez
2018-02-27 7:44 ` Matias Bjørling
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.