[openwrt/openwrt] kernel: ltq-ptm: add patch fixing compilation warning

LEDE Commits lede-commits at lists.infradead.org
Thu May 11 18:25:23 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/debb8be363aa0c31941fc21150b9ec65a91d66d3

commit debb8be363aa0c31941fc21150b9ec65a91d66d3
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed May 10 17:18:51 2023 +0200

    kernel: ltq-ptm: add patch fixing compilation warning
    
    Add patch fixing compilation warning for some debugfs entry defined but
    unused.
    Fix compilation warning:
    /__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:969:12: error: 'proc_read_genconf' defined but not used [-Werror=unused-function]
      969 | static int proc_read_genconf(char *page, char **start, off_t off, int count, int *eof, void *data)
          |            ^~~~~~~~~~~~~~~~~
    /__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:942:12: error: 'proc_write_wanmib' defined but not used [-Werror=unused-function]
      942 | static int proc_write_wanmib(struct file *file, const char *buf, unsigned long count, void *data)
          |            ^~~~~~~~~~~~~~~~~
    /__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:910:12: error: 'proc_read_wanmib' defined but not used [-Werror=unused-function]
      910 | static int proc_read_wanmib(char *page, char **start, off_t off, int count, int *eof, void *data)
          |            ^~~~~~~~~~~~~~~~
    /__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:892:12: error: 'proc_read_version' defined but not used [-Werror=unused-function]
      892 | static int proc_read_version(char *buf, char **start, off_t offset, int count, int *eof, void *data)
          |            ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    
    /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:1164:19: error: 'stricmp' defined but not used [-Werror=unused-function]
     1164 | static INLINE int stricmp(const char *p1, const char *p2)
          |                   ^~~~~~~
    cc1: all warnings being treated as errors
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../100-fix-compilation-warning-debugfs.patch      | 33 +++++++++++++++++++
 .../101-fix-more-compilation-warning-debugfs.patch | 38 ++++++++++++++++++++++
 2 files changed, 71 insertions(+)

diff --git a/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch b/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch
new file mode 100644
index 0000000000..283982fdef
--- /dev/null
+++ b/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch
@@ -0,0 +1,33 @@
+--- a/ifxmips_ptm_adsl.c
++++ b/ifxmips_ptm_adsl.c
+@@ -175,9 +175,11 @@ static INLINE void mailbox_signal(unsign
+  */
+ static INLINE void proc_file_create(void);
+ static INLINE void proc_file_delete(void);
++#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+ static int proc_read_version(char *, char **, off_t, int, int *, void *);
+ static int proc_read_wanmib(char *, char **, off_t, int, int *, void *);
+ static int proc_write_wanmib(struct file *, const char *, unsigned long, void *);
++#endif
+ #if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC
+   static int proc_read_genconf(char *, char **, off_t, int, int *, void *);
+ #endif
+@@ -889,6 +891,7 @@ static INLINE void proc_file_delete(void
+     remove_proc_entry("driver/ifx_ptm", NULL);
+ }
+ 
++#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+ static int proc_read_version(char *buf, char **start, off_t offset, int count, int *eof, void *data)
+ {
+     int len = 0;
+@@ -963,8 +966,9 @@ static int proc_write_wanmib(struct file
+ 
+     return count;
+ }
++#endif
+ 
+-#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC
++#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC && defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+ 
+ static int proc_read_genconf(char *page, char **start, off_t off, int count, int *eof, void *data)
+ {
diff --git a/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch b/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch
new file mode 100644
index 0000000000..f854662a07
--- /dev/null
+++ b/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch
@@ -0,0 +1,38 @@
+--- a/ifxmips_ptm_adsl.c
++++ b/ifxmips_ptm_adsl.c
+@@ -180,7 +180,7 @@ static int proc_read_version(char *, char **, off_t, int, int *, void *);
+ static int proc_read_wanmib(char *, char **, off_t, int, int *, void *);
+ static int proc_write_wanmib(struct file *, const char *, unsigned long, void *);
+ #endif
+-#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC
++#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC && defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+   static int proc_read_genconf(char *, char **, off_t, int, int *, void *);
+ #endif
+ #if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+@@ -191,8 +191,8 @@ static int proc_write_wanmib(struct file *, const char *, unsigned long, void *)
+ /*
+  *  Proc Help Functions
+  */
+-static INLINE int stricmp(const char *, const char *);
+ #if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
++  static INLINE int stricmp(const char *, const char *);
+   static INLINE int strincmp(const char *, const char *, int);
+ #endif
+ static INLINE int ifx_ptm_version(char *);
+@@ -1159,8 +1159,6 @@ static int proc_write_dbg(struct file *file, const char *buf, unsigned long coun
+     return count;
+ }
+ 
+-#endif  //  defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+-
+ static INLINE int stricmp(const char *p1, const char *p2)
+ {
+     int c1, c2;
+@@ -1178,7 +1176,6 @@ static INLINE int stricmp(const char *p1, const char *p2)
+     return *p1 - *p2;
+ }
+ 
+-#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
+ static INLINE int strincmp(const char *p1, const char *p2, int n)
+ {
+     int c1 = 0, c2;




More information about the lede-commits mailing list