Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751842AbdIULO1 (ORCPT ); Thu, 21 Sep 2017 07:14:27 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:49121 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbdIULOZ (ORCPT ); Thu, 21 Sep 2017 07:14:25 -0400 X-Google-Smtp-Source: AOwi7QBQMW4Gx/zMAeUUxbN7+8Xx/UVp436itm3EcpTQvfO7DCdCOITHQ9f7wZF50ZWzjE5IVbt1cg== Subject: Re: [PATCH] lightnvm: remove already calculated nr_chnls To: =?UTF-8?Q?Matias_Bj=c3=b8rling?= , Javier Gonzalez Cc: Rakesh Pandit , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org References: <20170917210412.GA2879@hercules.tuxera.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <8daba9d7-30a3-2c92-764c-a01b6d85572c@lightnvm.io> Date: Thu, 21 Sep 2017 13:14:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1571 Lines: 46 On 09/18/2017 12:56 PM, Matias Bjørling wrote: > > > Den 18. sep. 2017 09.56 skrev "Javier González" >: > > > On 17 Sep 2017, at 23.04, Rakesh Pandit > wrote: > > > > Remove repeated calculation for number of channels while creating a > > target device. > > > > Signed-off-by: Rakesh Pandit > > > --- > > > > 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 > > > What the hell... must have been a patch or merge that went wrong. Thanks Rakesh. I pulled it in for 4.15.