0
0
mirror of https://github.com/openwrt/packages.git synced 2025-02-25 16:53:43 +00:00
packages/libs/dmx_usb_module/patches/100-fix-compilation-warning-wrong-cast.patch

38 lines
1.1 KiB
Diff
Raw Normal View History

From eeecf40c3eb3dbdf1981c508080ab3aa61e105e2 Mon Sep 17 00:00:00 2001
From: Erwin Rol <erwin@erwinrol.com>
Date: Fri, 13 Jan 2023 17:57:36 +0100
Subject: [PATCH] Fix format warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix the following warning
warning: format %d expects argument of type int, but argument 4 has type size_t {aka long unsigned int}
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
---
dmx_usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
dmx_usb_module: fix compilation warning Fix compilation warning due to wrong cast. In file included from ./include/linux/kernel.h:19, from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:16: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c: In function 'dmx_usb_write': ./include/linux/kern_levels.h:5:25: error: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ | ^~~~~~ ./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap' 422 | _p_func(_fmt, ##__VA_ARGS__); \ | ^~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:41:45: note: in expansion of macro 'printk' 41 | #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0) | ^~~~~~ ./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH' 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ | ^~~~~~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:41:52: note: in expansion of macro 'KERN_DEBUG' 41 | #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0) | ^~~~~~~~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:409:9: note: in expansion of macro 'dbg' 409 | dbg("%s - minor %d, count = %d", __FUNCTION__, dev->minor, count); | ^~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-14 16:03:20 +02:00
--- a/dmx_usb.c
+++ b/dmx_usb.c
@@ -406,7 +406,7 @@ static ssize_t dmx_usb_write (struct fil
dmx_usb_module: fix compilation warning Fix compilation warning due to wrong cast. In file included from ./include/linux/kernel.h:19, from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:16: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c: In function 'dmx_usb_write': ./include/linux/kern_levels.h:5:25: error: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ | ^~~~~~ ./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap' 422 | _p_func(_fmt, ##__VA_ARGS__); \ | ^~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:41:45: note: in expansion of macro 'printk' 41 | #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0) | ^~~~~~ ./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH' 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ | ^~~~~~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:41:52: note: in expansion of macro 'KERN_DEBUG' 41 | #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0) | ^~~~~~~~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/dmx_usb_module-19.12.1/dmx_usb.c:409:9: note: in expansion of macro 'dbg' 409 | dbg("%s - minor %d, count = %d", __FUNCTION__, dev->minor, count); | ^~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-14 16:03:20 +02:00
dev = (struct dmx_usb_device *)file->private_data;
- dbg("%s - minor %d, count = %d", __FUNCTION__, dev->minor, count);
+ dbg("%s - minor %d, count = %zu", __FUNCTION__, dev->minor, count);
/* lock this object */
down (&dev->sem);
@@ -500,7 +500,7 @@ static long dmx_usb_ioctl (struct file *
return -ENODEV;
}
- dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __FUNCTION__,
+ dbg("%s - minor %d, cmd 0x%.4x, arg %lu", __FUNCTION__,
dev->minor, cmd, arg);
/* fill in your device specific stuff here */