diff mbox series

[PATCH-for-8.1,2/5] block/dmg: Remove duplicated prototype declarations

Message ID 20230320134219.22489-3-philmd@linaro.org
State New
Headers show
Series bulk: Do not declare function prototypes using 'extern' keyword | expand

Commit Message

Philippe Mathieu-Daudé March 20, 2023, 1:42 p.m. UTC
Both dmg_uncompress_bz2 / dmg_uncompress_lzfse are declared
in "dmg.h", included 1 line before.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 block/dmg.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Daniel P. Berrangé March 20, 2023, 1:50 p.m. UTC | #1
On Mon, Mar 20, 2023 at 02:42:16PM +0100, Philippe Mathieu-Daudé wrote:
> Both dmg_uncompress_bz2 / dmg_uncompress_lzfse are declared
> in "dmg.h", included 1 line before.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  block/dmg.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/block/dmg.c b/block/dmg.c
> index e10b9a2ba5..a5d22fb8f9 100644
> --- a/block/dmg.c
> +++ b/block/dmg.c
> @@ -31,12 +31,6 @@
>  #include "qemu/memalign.h"
>  #include "dmg.h"
>  
> -int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
> -                          char *next_out, unsigned int avail_out);
> -
> -int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
> -                            char *next_out, unsigned int avail_out);

These aren't prototypes, they are variables that hold a funtion
pointer. The header has them as 'extern' to avoid the variables
being instantiated more than once if the header is included many
times. This code is correct as-is, and so this change is not
desirable.

> -
>  enum {
>      /* Limit chunk sizes to prevent unreasonable amounts of memory being used
>       * or truncating when converting to 32-bit types
> -- 
> 2.38.1
> 
> 

With regards,
Daniel
diff mbox series

Patch

diff --git a/block/dmg.c b/block/dmg.c
index e10b9a2ba5..a5d22fb8f9 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -31,12 +31,6 @@ 
 #include "qemu/memalign.h"
 #include "dmg.h"
 
-int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
-                          char *next_out, unsigned int avail_out);
-
-int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
-                            char *next_out, unsigned int avail_out);
-
 enum {
     /* Limit chunk sizes to prevent unreasonable amounts of memory being used
      * or truncating when converting to 32-bit types