diff mbox series

[1/1] lib: rsa: struct udevice build warning

Message ID 20210217115431.27899-1-xypron.glpk@gmx.de
State Accepted
Commit bc18f31e4a3f13e09b6e9d04b282c2579b519ebf
Delegated to: Tom Rini
Headers show
Series [1/1] lib: rsa: struct udevice build warning | expand

Commit Message

Heinrich Schuchardt Feb. 17, 2021, 11:54 a.m. UTC
Avoid build warnings observed with gcc 10.2

In file included from lib/rsa/rsa-keyprop.c:16:
include/u-boot/rsa-mod-exp.h:65:24: warning:
‘struct udevice’ declared inside parameter list will not be visible
outside of this definition or declaration
   65 | int rsa_mod_exp(struct udevice *dev, const uint8_t *sig,
      | uint32_t sig_len,
      |                        ^~~~~~~
include/u-boot/rsa-mod-exp.h:96:24: warning:
‘struct udevice’ declared inside parameter list will not be visible
outside of this definition or declaration
   96 |  int (*mod_exp)(struct udevice *dev, const uint8_t *sig,
      |

by defining struct udevice.

Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 include/u-boot/rsa-mod-exp.h | 2 ++
 1 file changed, 2 insertions(+)

--
2.30.0

Comments

Simon Glass Feb. 19, 2021, 4:52 a.m. UTC | #1
On Wed, 17 Feb 2021 at 04:54, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Avoid build warnings observed with gcc 10.2
>
> In file included from lib/rsa/rsa-keyprop.c:16:
> include/u-boot/rsa-mod-exp.h:65:24: warning:
> ‘struct udevice’ declared inside parameter list will not be visible
> outside of this definition or declaration
>    65 | int rsa_mod_exp(struct udevice *dev, const uint8_t *sig,
>       | uint32_t sig_len,
>       |                        ^~~~~~~
> include/u-boot/rsa-mod-exp.h:96:24: warning:
> ‘struct udevice’ declared inside parameter list will not be visible
> outside of this definition or declaration
>    96 |  int (*mod_exp)(struct udevice *dev, const uint8_t *sig,
>       |
>
> by defining struct udevice.
>
> Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  include/u-boot/rsa-mod-exp.h | 2 ++
>  1 file changed, 2 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Feb. 25, 2021, 1:29 p.m. UTC | #2
On Wed, Feb 17, 2021 at 12:54:31PM +0100, Heinrich Schuchardt wrote:

> Avoid build warnings observed with gcc 10.2
> 
> In file included from lib/rsa/rsa-keyprop.c:16:
> include/u-boot/rsa-mod-exp.h:65:24: warning:
> ‘struct udevice’ declared inside parameter list will not be visible
> outside of this definition or declaration
>    65 | int rsa_mod_exp(struct udevice *dev, const uint8_t *sig,
>       | uint32_t sig_len,
>       |                        ^~~~~~~
> include/u-boot/rsa-mod-exp.h:96:24: warning:
> ‘struct udevice’ declared inside parameter list will not be visible
> outside of this definition or declaration
>    96 |  int (*mod_exp)(struct udevice *dev, const uint8_t *sig,
>       |
> 
> by defining struct udevice.
> 
> Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/include/u-boot/rsa-mod-exp.h b/include/u-boot/rsa-mod-exp.h
index 7b7c2915a9..fc9557c781 100644
--- a/include/u-boot/rsa-mod-exp.h
+++ b/include/u-boot/rsa-mod-exp.h
@@ -9,6 +9,8 @@ 
 #include <errno.h>
 #include <image.h>

+struct udevice;
+
 /**
  * struct key_prop - holder for a public key properties
  *