Linux block layer
 help / color / mirror / Atom feed
* [PATCH] lightnvm: Avoid validation of default op value Avoid validation of default op value, if default value is given. In preparation of using the rsvd field of the extended config for additional paramters while using default op.
@ 2018-02-26 19:45 Heiner Litz
  2018-02-26 19:58 ` Javier Gonzalez
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Litz @ 2018-02-26 19:45 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 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index dcc9e621e651..4e6095e2af06 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -304,10 +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 ||
+	} 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] 2+ messages in thread

* Re: [PATCH] lightnvm: Avoid validation of default op value Avoid validation of default op value, if default value is given. In preparation of using the rsvd field of the extended config for additional paramters while using default op.
  2018-02-26 19:45 [PATCH] lightnvm: Avoid validation of default op value Avoid validation of default op value, if default value is given. In preparation of using the rsvd field of the extended config for additional paramters while using default op Heiner Litz
@ 2018-02-26 19:58 ` Javier Gonzalez
  0 siblings, 0 replies; 2+ messages in thread
From: Javier Gonzalez @ 2018-02-26 19:58 UTC (permalink / raw)
  To: Heiner Litz; +Cc: linux-block@vger.kernel.org, Matias Bjørling

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

> On 26 Feb 2018, at 20.45, 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 | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index dcc9e621e651..4e6095e2af06 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -304,10 +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 ||
> +	} else if (e->op < NVM_TARGET_MIN_OP ||
> 	    e->op > NVM_TARGET_MAX_OP) {

While you are at it, can you fix this and put it in a single line - not
sure why this ended up this way...

> 		pr_err("nvm: invalid over provisioning value\n");
> 		return -EINVAL;
> --
> 2.14.1

Apart from the comment, the patch looks good. However, the description
went over to the subject. I guess Matias can fix this when picking it
up.

Reviewed-by: Javier González <javier@cnexlabs.com>


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-02-26 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26 19:45 [PATCH] lightnvm: Avoid validation of default op value Avoid validation of default op value, if default value is given. In preparation of using the rsvd field of the extended config for additional paramters while using default op Heiner Litz
2018-02-26 19:58 ` Javier Gonzalez

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