2017-09-17 21:04:18

by Rakesh Pandit

[permalink] [raw]
Subject: [PATCH] lightnvm: remove already calculated nr_chnls

Remove repeated calculation for number of channels while creating a
target device.

Signed-off-by: Rakesh Pandit <[email protected]>
---

This is also a trivial change I found while investigating/working on
other issue.

drivers/lightnvm/core.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 1b8338d..01536b8 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -139,7 +139,6 @@ static struct nvm_tgt_dev *nvm_create_tgt_dev(struct nvm_dev *dev,
int prev_nr_luns;
int i, j;

- nr_chnls = nr_luns / dev->geo.luns_per_chnl;
nr_chnls = (nr_chnls_mod == 0) ? nr_chnls : nr_chnls + 1;

dev_map = kmalloc(sizeof(struct nvm_dev_map), GFP_KERNEL);
--
2.7.4


2017-09-18 07:56:11

by Javier González

[permalink] [raw]
Subject: Re: [PATCH] lightnvm: remove already calculated nr_chnls

> On 17 Sep 2017, at 23.04, Rakesh Pandit <[email protected]> wrote:
>
> Remove repeated calculation for number of channels while creating a
> target device.
>
> Signed-off-by: Rakesh Pandit <[email protected]>
> ---
>
> This is also a trivial change I found while investigating/working on
> other issue.
>
> drivers/lightnvm/core.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index 1b8338d..01536b8 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -139,7 +139,6 @@ static struct nvm_tgt_dev *nvm_create_tgt_dev(struct nvm_dev *dev,
> int prev_nr_luns;
> int i, j;
>
> - nr_chnls = nr_luns / dev->geo.luns_per_chnl;
> nr_chnls = (nr_chnls_mod == 0) ? nr_chnls : nr_chnls + 1;
>
> dev_map = kmalloc(sizeof(struct nvm_dev_map), GFP_KERNEL);
> --
> 2.7.4

We wanted to make sure that nr_chnls was really, really set :)

Reviewed-by: Javier González <[email protected]>


Attachments:
signature.asc (801.00 B)
Message signed with OpenPGP

2017-09-21 11:14:27

by Matias Bjørling

[permalink] [raw]
Subject: Re: [PATCH] lightnvm: remove already calculated nr_chnls

On 09/18/2017 12:56 PM, Matias Bjørling wrote:
>
>
> Den 18. sep. 2017 09.56 skrev "Javier González" <[email protected]
> <mailto:[email protected]>>:
>
> > On 17 Sep 2017, at 23.04, Rakesh Pandit <[email protected]
> <mailto:[email protected]>> wrote:
> >
> > Remove repeated calculation for number of channels while creating a
> > target device.
> >
> > Signed-off-by: Rakesh Pandit <[email protected]
> <mailto:[email protected]>>
> > ---
> >
> > This is also a trivial change I found while investigating/working on
> > other issue.
> >
> > drivers/lightnvm/core.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> > index 1b8338d..01536b8 100644
> > --- a/drivers/lightnvm/core.c
> > +++ b/drivers/lightnvm/core.c
> > @@ -139,7 +139,6 @@ static struct nvm_tgt_dev
> *nvm_create_tgt_dev(struct nvm_dev *dev,
> > int prev_nr_luns;
> > int i, j;
> >
> > - nr_chnls = nr_luns / dev->geo.luns_per_chnl;
> > nr_chnls = (nr_chnls_mod == 0) ? nr_chnls : nr_chnls + 1;
> >
> > dev_map = kmalloc(sizeof(struct nvm_dev_map), GFP_KERNEL);
> > --
> > 2.7.4
>
> We wanted to make sure that nr_chnls was really, really set :)
>
> Reviewed-by: Javier González <[email protected]
> <mailto:[email protected]>>
>
> What the hell... must have been a patch or merge that went wrong.

Thanks Rakesh. I pulled it in for 4.15.