Re: [PATCH-for-9.0 23/25] hw/misc: Simplify memory_region_init_ram_from_fd() calls

2023-12-03 Thread Gavin Shan

On 11/21/23 07:32, Philippe Mathieu-Daudé wrote:

Mechanical change using the following coccinelle script:

@@
expression mr, owner, arg3, arg4, arg5, arg6, arg7, errp;
@@
-   memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, 
);
 if (
-   errp
+   !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, 
)
 ) {
 ...
 return;
 }

and removing the local Error variable.

Signed-off-by: Philippe Mathieu-Daudé 
---
  hw/misc/ivshmem.c | 8 +++-
  1 file changed, 3 insertions(+), 5 deletions(-)



Reviewed-by: Gavin Shan 





Re: [PATCH-for-9.0 23/25] hw/misc: Simplify memory_region_init_ram_from_fd() calls

2023-11-21 Thread Manos Pitsidianakis

On Mon, 20 Nov 2023 23:32, Philippe Mathieu-Daudé  wrote:

Mechanical change using the following coccinelle script:

@@
expression mr, owner, arg3, arg4, arg5, arg6, arg7, errp;
@@
-   memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, 
);
   if (
-   errp
+   !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, 
)
   ) {
   ...
   return;
   }

and removing the local Error variable.

Signed-off-by: Philippe Mathieu-Daudé 
---



Reviewed-by: Manos Pitsidianakis