All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] virtio: Remove unnecessary variable assignments
@ 2022-06-20  9:32 Bo Liu (刘波)-浪潮信息
  2022-06-20  9:37   ` Stefano Garzarella
  0 siblings, 1 reply; 8+ messages in thread
From: Bo Liu (刘波)-浪潮信息 @ 2022-06-20  9:32 UTC (permalink / raw)
  To: sgarzare; +Cc: mst, jasowang, virtualization, linux-kernel

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

Hi

>On Fri, Jun 17, 2022 at 01:59:52AM -0400, Bo Liu wrote:
>>In function vp_modern_probe(), "mdev->pci_dev" is assigned to variable
>>"pci_dev", variable "pci_dev" and "mdev->pci_dev" have the same value.
>>There is no need to assign variable "pci_dev" to "mdev->pci_dev". So
>>remove it.
>>
>
>I suggest rephrasing the description a bit.
>Maybe into something like this:
>
>     In function vp_modern_probe(), "pci_dev" is initialized with the
>     value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
>     is unnecessary since they store the same value.
>
>Anyway, the patch LGTM:
>
>Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
The new patch is:

In function vp_modern_probe(), "pci_dev" is initialized with the
value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
is unnecessary since they store the same value.

Signed-off-by: Bo Liu <liubo03@inspur.com>
---
 drivers/virtio/virtio_pci_modern_dev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/virtio/virtio_pci_modern_dev.c
b/drivers/virtio/virtio_pci_modern_dev.c
index b790f30b2b56..fa2a9445bb18 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -220,8 +220,6 @@ int vp_modern_probe(struct virtio_pci_modern_device
*mdev)
 
 	check_offsets();
 
-	mdev->pci_dev = pci_dev;
-
 	/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
 	if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
 		return -ENODEV;
--
2.27.0

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3777 bytes --]

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

* Re: [PATCH] virtio: Remove unnecessary variable assignments
  2022-06-20  9:32 [PATCH] virtio: Remove unnecessary variable assignments Bo Liu (刘波)-浪潮信息
@ 2022-06-20  9:37   ` Stefano Garzarella
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Garzarella @ 2022-06-20  9:37 UTC (permalink / raw)
  To: Bo Liu (刘波)-浪潮信息
  Cc: mst, jasowang, virtualization, linux-kernel

Hi Bo,

On Mon, Jun 20, 2022 at 09:32:28AM +0000, Bo Liu (刘波)-浪潮信息 wrote:
>Hi
>
>>On Fri, Jun 17, 2022 at 01:59:52AM -0400, Bo Liu wrote:
>>>In function vp_modern_probe(), "mdev->pci_dev" is assigned to 
>>>variable
>>>"pci_dev", variable "pci_dev" and "mdev->pci_dev" have the same 
>>>value.
>>>There is no need to assign variable "pci_dev" to "mdev->pci_dev". So
>>>remove it.
>>>
>>
>>I suggest rephrasing the description a bit.
>>Maybe into something like this:
>>
>>     In function vp_modern_probe(), "pci_dev" is initialized with the
>>     value of "mdev->pci_dev", so assigning "pci_dev" to 
>>     "mdev->pci_dev"
>>     is unnecessary since they store the same value.
>>
>>Anyway, the patch LGTM:
>>
>>Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>>
>The new patch is:
>
>In function vp_modern_probe(), "pci_dev" is initialized with the
>value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
>is unnecessary since they store the same value.
>
>Signed-off-by: Bo Liu <liubo03@inspur.com>
>---
> drivers/virtio/virtio_pci_modern_dev.c | 2 --
> 1 file changed, 2 deletions(-)

It looks good, but I think it is better to send a proper v2.

You can also add my R-b just before your S-o-b

Thanks,
Stefano


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

* Re: [PATCH] virtio: Remove unnecessary variable assignments
@ 2022-06-20  9:37   ` Stefano Garzarella
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Garzarella @ 2022-06-20  9:37 UTC (permalink / raw)
  To: Bo Liu (刘波)-浪潮信息
  Cc: virtualization, linux-kernel, mst

Hi Bo,

On Mon, Jun 20, 2022 at 09:32:28AM +0000, Bo Liu (刘波)-浪潮信息 wrote:
>Hi
>
>>On Fri, Jun 17, 2022 at 01:59:52AM -0400, Bo Liu wrote:
>>>In function vp_modern_probe(), "mdev->pci_dev" is assigned to 
>>>variable
>>>"pci_dev", variable "pci_dev" and "mdev->pci_dev" have the same 
>>>value.
>>>There is no need to assign variable "pci_dev" to "mdev->pci_dev". So
>>>remove it.
>>>
>>
>>I suggest rephrasing the description a bit.
>>Maybe into something like this:
>>
>>     In function vp_modern_probe(), "pci_dev" is initialized with the
>>     value of "mdev->pci_dev", so assigning "pci_dev" to 
>>     "mdev->pci_dev"
>>     is unnecessary since they store the same value.
>>
>>Anyway, the patch LGTM:
>>
>>Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>>
>The new patch is:
>
>In function vp_modern_probe(), "pci_dev" is initialized with the
>value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
>is unnecessary since they store the same value.
>
>Signed-off-by: Bo Liu <liubo03@inspur.com>
>---
> drivers/virtio/virtio_pci_modern_dev.c | 2 --
> 1 file changed, 2 deletions(-)

It looks good, but I think it is better to send a proper v2.

You can also add my R-b just before your S-o-b

Thanks,
Stefano

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* 答复: [PATCH] virtio: Remove unnecessary variable assignments
  2022-06-20  9:37   ` Stefano Garzarella
  (?)
@ 2022-06-20 10:25   ` Bo Liu (刘波)-浪潮信息
  -1 siblings, 0 replies; 8+ messages in thread
From: Bo Liu (刘波)-浪潮信息 @ 2022-06-20 10:25 UTC (permalink / raw)
  To: sgarzare; +Cc: mst, jasowang, virtualization, linux-kernel

[-- Attachment #1: smime.p7m --]
[-- Type: application/pkcs7-mime, Size: 6118 bytes --]

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

* Re: [PATCH] virtio: Remove unnecessary variable assignments
@ 2022-06-20 10:37 Bo Liu (刘波)-浪潮信息
  0 siblings, 0 replies; 8+ messages in thread
From: Bo Liu (刘波)-浪潮信息 @ 2022-06-20 10:37 UTC (permalink / raw)
  To: sgarzare; +Cc: mst, jasowang, virtualization, linux-kernel

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

Hi

>Hi Bo,
>
>On Mon, Jun 20, 2022 at 09:32:28AM +0000, Bo Liu (刘波)-浪潮信息 wrote:
>>Hi
>>
>>>On Fri, Jun 17, 2022 at 01:59:52AM -0400, Bo Liu wrote:
>>>>In function vp_modern_probe(), "mdev->pci_dev" is assigned to
>>>>variable "pci_dev", variable "pci_dev" and "mdev->pci_dev" have the
>>>>same value.
>>>>There is no need to assign variable "pci_dev" to "mdev->pci_dev". So
>>>>remove it.
>>>>
>>>
>>>I suggest rephrasing the description a bit.
>>>Maybe into something like this:
>>>
>>>     In function vp_modern_probe(), "pci_dev" is initialized with the
>>>     value of "mdev->pci_dev", so assigning "pci_dev" to
>>>     "mdev->pci_dev"
>>>     is unnecessary since they store the same value.
>>>
>>>Anyway, the patch LGTM:
>>>
>>>Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>>>
>>The new patch is:
>>
>>In function vp_modern_probe(), "pci_dev" is initialized with the value
>>of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
>>is unnecessary since they store the same value.
>>
>>Signed-off-by: Bo Liu <liubo03@inspur.com>
>>---
>> drivers/virtio/virtio_pci_modern_dev.c | 2 --
>> 1 file changed, 2 deletions(-)
>
>It looks good, but I think it is better to send a proper v2.
>
>You can also add my R-b just before your S-o-b
>
>Thanks,
>Stefano


The new patch is:

In function vp_modern_probe(), "pci_dev" is initialized with the
value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
is unnecessary since they store the same value.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
---
 drivers/virtio/virtio_pci_modern_dev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/virtio/virtio_pci_modern_dev.c
b/drivers/virtio/virtio_pci_modern_dev.c
index b790f30b2b56..fa2a9445bb18 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -220,8 +220,6 @@ int vp_modern_probe(struct virtio_pci_modern_device
*mdev)

 	check_offsets();

-	mdev->pci_dev = pci_dev;
-
 	/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
 	if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
 		return -ENODEV;
--
2.27.0

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3777 bytes --]

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

* Re: [PATCH] virtio: Remove unnecessary variable assignments
  2022-06-17  5:59 Bo Liu
@ 2022-06-20  8:49   ` Stefano Garzarella
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Garzarella @ 2022-06-20  8:49 UTC (permalink / raw)
  To: Bo Liu; +Cc: mst, jasowang, virtualization, linux-kernel

On Fri, Jun 17, 2022 at 01:59:52AM -0400, Bo Liu wrote:
>In function vp_modern_probe(), "mdev->pci_dev" is assigned to
>variable "pci_dev", variable "pci_dev" and "mdev->pci_dev" have
>the same value. There is no need to assign variable "pci_dev" to
>"mdev->pci_dev". So remove it.
>

I suggest rephrasing the description a bit.
Maybe into something like this:

     In function vp_modern_probe(), "pci_dev" is initialized with the
     value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
     is unnecessary since they store the same value.

Anyway, the patch LGTM:

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>Signed-off-by: Bo Liu <liubo03@inspur.com>
>---
> drivers/virtio/virtio_pci_modern_dev.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
>index b790f30b2b56..fa2a9445bb18 100644
>--- a/drivers/virtio/virtio_pci_modern_dev.c
>+++ b/drivers/virtio/virtio_pci_modern_dev.c
>@@ -220,8 +220,6 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
>
> 	check_offsets();
>
>-	mdev->pci_dev = pci_dev;
>-
> 	/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
> 	if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
> 		return -ENODEV;
>-- 
>2.27.0
>


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

* Re: [PATCH] virtio: Remove unnecessary variable assignments
@ 2022-06-20  8:49   ` Stefano Garzarella
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Garzarella @ 2022-06-20  8:49 UTC (permalink / raw)
  To: Bo Liu; +Cc: virtualization, linux-kernel, mst

On Fri, Jun 17, 2022 at 01:59:52AM -0400, Bo Liu wrote:
>In function vp_modern_probe(), "mdev->pci_dev" is assigned to
>variable "pci_dev", variable "pci_dev" and "mdev->pci_dev" have
>the same value. There is no need to assign variable "pci_dev" to
>"mdev->pci_dev". So remove it.
>

I suggest rephrasing the description a bit.
Maybe into something like this:

     In function vp_modern_probe(), "pci_dev" is initialized with the
     value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
     is unnecessary since they store the same value.

Anyway, the patch LGTM:

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>Signed-off-by: Bo Liu <liubo03@inspur.com>
>---
> drivers/virtio/virtio_pci_modern_dev.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
>index b790f30b2b56..fa2a9445bb18 100644
>--- a/drivers/virtio/virtio_pci_modern_dev.c
>+++ b/drivers/virtio/virtio_pci_modern_dev.c
>@@ -220,8 +220,6 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
>
> 	check_offsets();
>
>-	mdev->pci_dev = pci_dev;
>-
> 	/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
> 	if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
> 		return -ENODEV;
>-- 
>2.27.0
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* [PATCH] virtio: Remove unnecessary variable assignments
@ 2022-06-17  5:59 Bo Liu
  2022-06-20  8:49   ` Stefano Garzarella
  0 siblings, 1 reply; 8+ messages in thread
From: Bo Liu @ 2022-06-17  5:59 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtualization, linux-kernel, Bo Liu

In function vp_modern_probe(), "mdev->pci_dev" is assigned to
variable "pci_dev", variable "pci_dev" and "mdev->pci_dev" have
the same value. There is no need to assign variable "pci_dev" to
"mdev->pci_dev". So remove it.

Signed-off-by: Bo Liu <liubo03@inspur.com>
---
 drivers/virtio/virtio_pci_modern_dev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
index b790f30b2b56..fa2a9445bb18 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -220,8 +220,6 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
 
 	check_offsets();
 
-	mdev->pci_dev = pci_dev;
-
 	/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
 	if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
 		return -ENODEV;
-- 
2.27.0


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

end of thread, other threads:[~2022-06-20 10:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  9:32 [PATCH] virtio: Remove unnecessary variable assignments Bo Liu (刘波)-浪潮信息
2022-06-20  9:37 ` Stefano Garzarella
2022-06-20  9:37   ` Stefano Garzarella
2022-06-20 10:25   ` 答复: " Bo Liu (刘波)-浪潮信息
  -- strict thread matches above, loose matches on Subject: below --
2022-06-20 10:37 Bo Liu (刘波)-浪潮信息
2022-06-17  5:59 Bo Liu
2022-06-20  8:49 ` Stefano Garzarella
2022-06-20  8:49   ` Stefano Garzarella

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.