aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-05-09 23:32:16 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-05-12 03:15:44 +0200
commit220739aa0d2fd6e50a4ac74e8ef71ff9f3bfb116 (patch)
treebee0a39e7d0ea94942450e9c7121b0803f552a36 /package
parentf3fc9ac1aa99165b4b9b88db6c2274c8e90b4c18 (diff)
downloadupstream-220739aa0d2fd6e50a4ac74e8ef71ff9f3bfb116.tar.gz
upstream-220739aa0d2fd6e50a4ac74e8ef71ff9f3bfb116.tar.bz2
upstream-220739aa0d2fd6e50a4ac74e8ef71ff9f3bfb116.zip
kernel: lantiq: vrx518_tc: add patch fix compilation warning for atm_tc
Add patch fixing compilation warning for atm_tc module. Fix compilation warning: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/vrx518_tc_drv-ugw_8.5.2.10/dcdp/atm_tc.c: In function 'print_datetime': /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/vrx518_tc_drv-ugw_8.5.2.10/dcdp/atm_tc.c:768:32: error: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] 768 | snprintf(buffer, sizeof(buffer), "%s.%06d", tmbuf, (int)datetime->tv_nsec / 1000); | ^ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch
new file mode 100644
index 0000000000..bf2d82e2b5
--- /dev/null
+++ b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch
@@ -0,0 +1,31 @@
+--- a/dcdp/atm_tc.c
++++ b/dcdp/atm_tc.c
+@@ -746,7 +746,8 @@ static void atm_aca_init(struct atm_priv
+ ACA_TXOUT_EN | ACA_RXIN_EN | ACA_RXOUT_EN, 1);
+ }
+
+-static int print_datetime(char *buffer, const struct timespec64 *datetime)
++static int print_datetime(char *buffer, int buffer_size,
++ const struct timespec64 *datetime)
+ {
+ struct tm nowtm;
+ char tmbuf[64];
+@@ -765,7 +766,8 @@ static int print_datetime(char *buffer,
+ nowtm.tm_hour,
+ nowtm.tm_min,
+ nowtm.tm_sec);
+- snprintf(buffer, sizeof(buffer), "%s.%06d", tmbuf, (int)datetime->tv_nsec / 1000);
++ snprintf(buffer, sizeof(tmbuf)+buffer_size, "%s.%06d",
++ tmbuf, (int)datetime->tv_nsec / 1000);
+
+ return 0;
+ }
+@@ -967,7 +969,7 @@ void show_atm_pvc(struct seq_file *seq,
+ char buf[64];
+
+ seq_printf(seq, "\tNet device: %s\n", pvc->dev->name);
+- print_datetime(buf, &(pvc->access_time));
++ print_datetime(buf, sizeof(buf), &(pvc->access_time));
+ seq_printf(seq, "\tLast user cell: %s\n", buf);
+ seq_printf(seq, "\tPort: %d\n", pvc->port);
+ seq_printf(seq, "\tSoftware TX Queue: %u\n", pvc->sw_txq_tbl);