[openwrt/openwrt] mtd: fix imagetag compilation

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 17 07:44:33 GMT 2021


noltari pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b3f41971393f21803db5f940b3756b51c53ae5eb

commit b3f41971393f21803db5f940b3756b51c53ae5eb
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Wed Mar 17 08:41:44 2021 +0100

    mtd: fix imagetag compilation
    
    Commit b5b0796a1322 added an uint32_t to mtd.h without including stdint, which
    results in a compilation error for those files not including stdint.h.
    
    In file included from imagetag.c:36:
    mtd.h:15:8: error: unknown type name 'uint32_t'
     extern uint32_t opt_trxmagic;
            ^~~~~~~~
    imagetag.c: In function 'trx_fixup':
    imagetag.c:180:10: warning: unused variable 'res' [-Wunused-variable]
      ssize_t res;
              ^~~
    imagetag.c:177:14: warning: unused variable 'scan' [-Wunused-variable]
      void *ptr, *scan;
                  ^~~~
    imagetag.c: In function 'trx_check':
    imagetag.c:246:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         struct bcm_tag *tag = (const struct bcm_tag *) buf;
                               ^
    make[3]: *** [<builtin>: imagetag.o] Error 1
    
    Fixes: b5b0796a1322 ("mtd: add option for TRX magic to fixtrx")
    Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 package/system/mtd/src/mtd.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/system/mtd/src/mtd.h b/package/system/mtd/src/mtd.h
index d2facc8e3b..5d56113b1c 100644
--- a/package/system/mtd/src/mtd.h
+++ b/package/system/mtd/src/mtd.h
@@ -2,6 +2,7 @@
 #define __mtd_h
 
 #include <stdbool.h>
+#include <stdint.h>
 
 #if defined(target_bcm47xx) || defined(target_bcm53xx)
 #define target_brcm 1



More information about the lede-commits mailing list