All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-pci: remove an unnecessary initialization in HMB code
@ 2017-12-04 20:23 Minwoo Im
  2017-12-04 20:26 ` Christoph Hellwig
  2017-12-04 20:26 ` Minwoo Im
  0 siblings, 2 replies; 4+ messages in thread
From: Minwoo Im @ 2017-12-04 20:23 UTC (permalink / raw)


The local variable __size__ will be set a bit later in a for-loop.
Remove the explicit initialization at the beginning of this function.

Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 drivers/nvme/host/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index f5800c3..35331fa 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1770,7 +1770,7 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
 	dma_addr_t descs_dma;
 	int i = 0;
 	void **bufs;
-	u64 size = 0, tmp;
+	u64 size, tmp;
 
 	tmp = (preferred + chunk_size - 1);
 	do_div(tmp, chunk_size);
@@ -1853,7 +1853,7 @@ static int nvme_setup_host_mem(struct nvme_dev *dev)
 	u64 preferred = (u64)dev->ctrl.hmpre * 4096;
 	u64 min = (u64)dev->ctrl.hmmin * 4096;
 	u32 enable_bits = NVME_HOST_MEM_ENABLE;
-	int ret = 0;
+	int ret;
 
 	preferred = min(preferred, max);
 	if (min > max) {
-- 
2.7.4

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

* [PATCH] nvme-pci: remove an unnecessary initialization in HMB code
  2017-12-04 20:23 [PATCH] nvme-pci: remove an unnecessary initialization in HMB code Minwoo Im
@ 2017-12-04 20:26 ` Christoph Hellwig
  2017-12-04 20:26 ` Minwoo Im
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2017-12-04 20:26 UTC (permalink / raw)


On Tue, Dec 05, 2017@05:23:54AM +0900, Minwoo Im wrote:
> The local variable __size__ will be set a bit later in a for-loop.
> Remove the explicit initialization at the beginning of this function.

Thanks,

applied to nvme-4.16.

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

* [PATCH] nvme-pci: remove an unnecessary initialization in HMB code
  2017-12-04 20:23 [PATCH] nvme-pci: remove an unnecessary initialization in HMB code Minwoo Im
  2017-12-04 20:26 ` Christoph Hellwig
@ 2017-12-04 20:26 ` Minwoo Im
  2017-12-04 20:31   ` Minwoo Im
  1 sibling, 1 reply; 4+ messages in thread
From: Minwoo Im @ 2017-12-04 20:26 UTC (permalink / raw)


On Tue, Dec 5, 2017@5:23 AM, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
> The local variable __size__ will be set a bit later in a for-loop.
> Remove the explicit initialization at the beginning of this function.
>
> Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
> ---
>  drivers/nvme/host/pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index f5800c3..35331fa 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1770,7 +1770,7 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
>         dma_addr_t descs_dma;
>         int i = 0;
>         void **bufs;
> -       u64 size = 0, tmp;
> +       u64 size, tmp;
>
>         tmp = (preferred + chunk_size - 1);
>         do_div(tmp, chunk_size);
> @@ -1853,7 +1853,7 @@ static int nvme_setup_host_mem(struct nvme_dev *dev)
>         u64 preferred = (u64)dev->ctrl.hmpre * 4096;
>         u64 min = (u64)dev->ctrl.hmmin * 4096;
>         u32 enable_bits = NVME_HOST_MEM_ENABLE;
> -       int ret = 0;
> +       int ret;
>
>         preferred = min(preferred, max);
>         if (min > max) {
> --
> 2.7.4
>

Please ignore this mail. Sorry for making confusions.


Thanks,

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

* [PATCH] nvme-pci: remove an unnecessary initialization in HMB code
  2017-12-04 20:26 ` Minwoo Im
@ 2017-12-04 20:31   ` Minwoo Im
  0 siblings, 0 replies; 4+ messages in thread
From: Minwoo Im @ 2017-12-04 20:31 UTC (permalink / raw)


On Tue, Dec 5, 2017@5:26 AM, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
> On Tue, Dec 5, 2017@5:23 AM, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
>> The local variable __size__ will be set a bit later in a for-loop.
>> Remove the explicit initialization at the beginning of this function.
>>
>> Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
>> ---
>>  drivers/nvme/host/pci.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
>> index f5800c3..35331fa 100644
>> --- a/drivers/nvme/host/pci.c
>> +++ b/drivers/nvme/host/pci.c
>> @@ -1770,7 +1770,7 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
>>         dma_addr_t descs_dma;
>>         int i = 0;
>>         void **bufs;
>> -       u64 size = 0, tmp;
>> +       u64 size, tmp;
>>
>>         tmp = (preferred + chunk_size - 1);
>>         do_div(tmp, chunk_size);
>> @@ -1853,7 +1853,7 @@ static int nvme_setup_host_mem(struct nvme_dev *dev)
>>         u64 preferred = (u64)dev->ctrl.hmpre * 4096;
>>         u64 min = (u64)dev->ctrl.hmmin * 4096;
>>         u32 enable_bits = NVME_HOST_MEM_ENABLE;
>> -       int ret = 0;
>> +       int ret;
>>
>>         preferred = min(preferred, max);
>>         if (min > max) {
>> --
>> 2.7.4
>>
>
> Please ignore this mail. Sorry for making confusions.
>
>
> Thanks,

Hi Christoph,

I think you have alraedy picked it up.
I'll not make any improper patch(format, description, etc) from now on.

Thanks to you for picking it up.

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

end of thread, other threads:[~2017-12-04 20:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-04 20:23 [PATCH] nvme-pci: remove an unnecessary initialization in HMB code Minwoo Im
2017-12-04 20:26 ` Christoph Hellwig
2017-12-04 20:26 ` Minwoo Im
2017-12-04 20:31   ` Minwoo Im

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.