public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio_balloon: Use outer variable 'page'
@ 2024-11-20  5:49 zhangjiao2
  2024-11-20  8:54 ` David Hildenbrand
  2024-11-20 10:02 ` Gavin Shan
  0 siblings, 2 replies; 3+ messages in thread
From: zhangjiao2 @ 2024-11-20  5:49 UTC (permalink / raw)
  To: mst; +Cc: david, jasowang, virtualization, linux-kernel, zhang jiao

From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

There is no need to define a local variable 'page',
just use outer variable 'page'.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
 drivers/virtio/virtio_balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index b36d2803674e..89da052f4f68 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -251,7 +251,7 @@ static unsigned int fill_balloon(struct virtio_balloon *vb, size_t num)
 
 	for (num_pfns = 0; num_pfns < num;
 	     num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
-		struct page *page = balloon_page_alloc();
+		page = balloon_page_alloc();
 
 		if (!page) {
 			dev_info_ratelimited(&vb->vdev->dev,
-- 
2.33.0




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

* Re: [PATCH] virtio_balloon: Use outer variable 'page'
  2024-11-20  5:49 [PATCH] virtio_balloon: Use outer variable 'page' zhangjiao2
@ 2024-11-20  8:54 ` David Hildenbrand
  2024-11-20 10:02 ` Gavin Shan
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2024-11-20  8:54 UTC (permalink / raw)
  To: zhangjiao2, mst; +Cc: jasowang, virtualization, linux-kernel

On 20.11.24 06:49, zhangjiao2 wrote:
> From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> 
> There is no need to define a local variable 'page',
> just use outer variable 'page'.
> 
> Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> ---
>   drivers/virtio/virtio_balloon.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index b36d2803674e..89da052f4f68 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -251,7 +251,7 @@ static unsigned int fill_balloon(struct virtio_balloon *vb, size_t num)
>   
>   	for (num_pfns = 0; num_pfns < num;
>   	     num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
> -		struct page *page = balloon_page_alloc();
> +		page = balloon_page_alloc();
>   
>   		if (!page) {
>   			dev_info_ratelimited(&vb->vdev->dev,

Looks reasonable

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb


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

* Re: [PATCH] virtio_balloon: Use outer variable 'page'
  2024-11-20  5:49 [PATCH] virtio_balloon: Use outer variable 'page' zhangjiao2
  2024-11-20  8:54 ` David Hildenbrand
@ 2024-11-20 10:02 ` Gavin Shan
  1 sibling, 0 replies; 3+ messages in thread
From: Gavin Shan @ 2024-11-20 10:02 UTC (permalink / raw)
  To: zhangjiao2, mst; +Cc: david, jasowang, virtualization, linux-kernel


On 11/20/24 3:49 PM, zhangjiao2 wrote:
> From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> 
> There is no need to define a local variable 'page',
> just use outer variable 'page'.
> 
> Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> ---
>   drivers/virtio/virtio_balloon.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Gavin Shan <gshan@redhat.com>


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

end of thread, other threads:[~2024-11-20 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-20  5:49 [PATCH] virtio_balloon: Use outer variable 'page' zhangjiao2
2024-11-20  8:54 ` David Hildenbrand
2024-11-20 10:02 ` Gavin Shan

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