From 3957d2fe12c177f04e13434286e70c051183f2dd Mon Sep 17 00:00:00 2001 From: Varsha Date: Tue, 27 Mar 2018 21:52:31 +0530 Subject: [PATCH 1/3] Report for unused parameter warning --- Report/Report 1 | 180 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 Report/Report 1 diff --git a/Report/Report 1 b/Report/Report 1 new file mode 100644 index 0000000..13e3e43 --- /dev/null +++ b/Report/Report 1 @@ -0,0 +1,180 @@ +Warning Analysis Report + +General + +Warning Type: -Wunused-parameter +Warning Explanation: +In file included from ./include/linux/compiler.h:246: +./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter] +static inline void kasan_check_read(const volatile void *p, unsigned int size) + ^ +./include/linux/kasan-checks.h:9:74: warning: unused parameter 'size' [-Wunused-parameter] +static inline void kasan_check_read(const volatile void *p, unsigned int size) + ^ +./include/linux/kasan-checks.h:11:59: warning: unused parameter 'p' [-Wunused-parameter] +static inline void kasan_check_write(const volatile void *p, unsigned int size) + ^ +./include/linux/kasan-checks.h:11:75: warning: unused parameter 'size' [-Wunused-parameter] +static inline void kasan_check_write(const volatile void *p, unsigned int size) + +History + +Introduced in version: v4.7-rc1 +Date: 2016-05-20 +Author: Andrey Ryabinin +Patch: +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=64f8ebaf115bcddc4aaa902f981c57ba6506bc42 + +Recent Change in +Date: 2017-06-22 +Author: Dmitry Vyukov +Patch: https://patchwork.kernel.org/patch/9768477/ + +Warning Assessment + +File Location: include/linux/kasan-checks.h + +#ifdef CONFIG_KASAN +void kasan_check_read(const volatile void *p, unsigned int size); +void kasan_check_write(const volatile void *p, unsigned int size); +#else +static inline void kasan_check_read(const volatile void *p, unsigned int size) +{ } +static inline void kasan_check_write(const volatile void *p, unsigned int size) +{ } +#endif + +Conclusion + +Warning is true but the functions kasan_check_{read, write} were +purposefully made empty. So, ignore this warning. + +Observations + +I checked few other warnings of the same type. If the file is located in +include directory, then most of them needs to be ignored due to one of +the following reasons: + +1) If some macro is not defined then empty function with parameter is used. + The function is made purposefully empty as there are non empty functions + used when the macro is defined. + +Example Warnings: + +In file included from ./include/linux/kernel.h:14: +./include/linux/printk.h:519:53: warning: unused parameter 'prefix_str' [-Wunused-parameter] +static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, + ^ +./include/linux/printk.h:519:69: warning: unused parameter 'prefix_type' [-Wunused-parameter] +static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, + ^ +./include/linux/printk.h:520:10: warning: unused parameter 'rowsize' [-Wunused-parameter] + int rowsize, int groupsize, + ^ +./include/linux/printk.h:520:23: warning: unused parameter 'groupsize' [-Wunused-parameter] + int rowsize, int groupsize, + ^ +./include/linux/printk.h:521:18: warning: unused parameter 'buf' [-Wunused-parameter] + const void *buf, size_t len, bool ascii) + ^ +./include/linux/printk.h:521:30: warning: unused parameter 'len' [-Wunused-parameter] + const void *buf, size_t len, bool ascii) + ^ +./include/linux/printk.h:521:40: warning: unused parameter 'ascii' [-Wunused-parameter] + const void *buf, size_t len, bool ascii) + ^ +https://github.com/torvalds/linux/commit/cdf17449af1d9b596742c260134edd6c1fac2792 +---------------------------------------------------------------------------------------------------- +./include/linux/kernel.h:230:49: warning: unused parameter 'file' [-Wunused-parameter] + static inline void ___might_sleep(const char *file, int line, + ^ +./include/linux/kernel.h:230:59: warning: unused parameter 'line' [-Wunused-parameter] + static inline void ___might_sleep(const char *file, int line, + ^ +./include/linux/kernel.h:231:12: warning: unused parameter 'preempt_offset' [-Wunused-parameter] + int preempt_offset) { } + ^ +./include/linux/kernel.h:232:48: warning: unused parameter 'file' [-Wunused-parameter] + static inline void __might_sleep(const char *file, int line, + ^ +./include/linux/kernel.h:232:58: warning: unused parameter 'line' [-Wunused-parameter] + static inline void __might_sleep(const char *file, int line, + ^ +./include/linux/kernel.h:233:12: warning: unused parameter 'preempt_offset' [-Wunused-parameter] + int preempt_offset) { } + ^ +-------------------------------------------------------------------------------------------------------- + +In file included from ./arch/x86/include/asm/string_64.h:6: +./include/linux/jump_label.h:233:50: warning: unused parameter 'start' [-Wunused-parameter] +static inline int jump_label_text_reserved(void *start, void *end) + ^ +./include/linux/jump_label.h:233:63: warning: unused parameter 'end' [-Wunused-parameter] +static inline int jump_label_text_reserved(void *start, void *end) + ^ + +static inline int jump_label_text_reserved(void *start, void *end) +{ + return 0; +} + +In file included from ./arch/x86/include/asm/string_64.h:6: +./include/linux/jump_label.h:241:56: warning: unused parameter 'mod' [-Wunused-parameter] +static inline int jump_label_apply_nops(struct module *mod) + ^ +https://github.com/torvalds/linux/commit/d430d3d7e646eb1eac2bb4aa244a644312e67c76 +https://github.com/torvalds/linux/commit/4c3ef6d79328c0e23ade60cbfc8d496123a6855c + +2) Empty functions to annotate something. This too is purposefully added. + +Example Warnings: + +In file included from ./include/linux/spinlock_types.h:18: +./include/linux/lockdep.h:475:49: warning: unused parameter 'force' [-Wunused-parameter] +static inline void lockdep_invariant_state(bool force) {} + ^ +https://github.com/torvalds/linux/commit/f52be5708076b75a045ac52c6fef3fffb8300525 + +In file included from ./include/linux/spinlock_types.h:18: +./include/linux/lockdep.h:476:58: warning: unused parameter 'task' [-Wunused-parameter] +static inline void lockdep_init_task(struct task_struct *task) {} + ^ +In file included from ./include/linux/spinlock_types.h:18: +./include/linux/lockdep.h:477:58: warning: unused parameter 'task' [-Wunused-parameter] +static inline void lockdep_free_task(struct task_struct *task) {} + ^ +https://github.com/torvalds/linux/commit/b09be676e0ff25bd6d2e7637e26d349f9109ad75 + +In file included from ./include/linux/spinlock_types.h:18: +./include/linux/lockdep.h:622:36: warning: unused parameter 'file' [-Wunused-parameter] +lockdep_rcu_suspicious(const char *file, const int line, const char *s) + ^ +./include/linux/lockdep.h:622:52: warning: unused parameter 'line' [-Wunused-parameter] +lockdep_rcu_suspicious(const char *file, const int line, const char *s) + ^ +./include/linux/lockdep.h:622:70: warning: unused parameter 's' [-Wunused-parameter] +lockdep_rcu_suspicious(const char *file, const int line, const char *s) + +https://github.com/torvalds/linux/commit/d24209bb689e2c7f7418faec9b4a948e922d24da + +3) Empty function will be updated in future. + +Example Warning: +In file included from ./arch/x86/include/asm/processor.h:19: +./arch/x86/include/asm/pgtable_types.h:361:43: warning: unused parameter 'p4d' [-Wunused-parameter] +static inline p4dval_t p4d_pfn_mask(p4d_t p4d) + ^ +https://lwn.net/Articles/708526/ +https://github.com/torvalds/linux/commit/fe1e8c3e9634071ac608172e29bf997596d17c7c + +There can be warnings of which are true and needs to be fixed but I did +not find any till now. + +Also, there are warnings which are false positive, the parameters are +used but clang did not understand their usage. + +Example Warning: +In file included from ./include/linux/compiler.h:246: +./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter] +static inline void kasan_check_read(const volatile void *p, unsigned int size) + ^ From e978cb49c7cad955ac746117c2921da2750a9cbe Mon Sep 17 00:00:00 2001 From: Varsha Date: Sat, 31 Mar 2018 09:17:56 +0530 Subject: [PATCH 2/3] Update and rename Report 1 to Report_0001.md Changed the file type to markdown. --- Report/Report 1 | 180 ------------------------------------------ Report/Report_0001.md | 171 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 180 deletions(-) delete mode 100644 Report/Report 1 create mode 100644 Report/Report_0001.md diff --git a/Report/Report 1 b/Report/Report 1 deleted file mode 100644 index 13e3e43..0000000 --- a/Report/Report 1 +++ /dev/null @@ -1,180 +0,0 @@ -Warning Analysis Report - -General - -Warning Type: -Wunused-parameter -Warning Explanation: -In file included from ./include/linux/compiler.h:246: -./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter] -static inline void kasan_check_read(const volatile void *p, unsigned int size) - ^ -./include/linux/kasan-checks.h:9:74: warning: unused parameter 'size' [-Wunused-parameter] -static inline void kasan_check_read(const volatile void *p, unsigned int size) - ^ -./include/linux/kasan-checks.h:11:59: warning: unused parameter 'p' [-Wunused-parameter] -static inline void kasan_check_write(const volatile void *p, unsigned int size) - ^ -./include/linux/kasan-checks.h:11:75: warning: unused parameter 'size' [-Wunused-parameter] -static inline void kasan_check_write(const volatile void *p, unsigned int size) - -History - -Introduced in version: v4.7-rc1 -Date: 2016-05-20 -Author: Andrey Ryabinin -Patch: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=64f8ebaf115bcddc4aaa902f981c57ba6506bc42 - -Recent Change in -Date: 2017-06-22 -Author: Dmitry Vyukov -Patch: https://patchwork.kernel.org/patch/9768477/ - -Warning Assessment - -File Location: include/linux/kasan-checks.h - -#ifdef CONFIG_KASAN -void kasan_check_read(const volatile void *p, unsigned int size); -void kasan_check_write(const volatile void *p, unsigned int size); -#else -static inline void kasan_check_read(const volatile void *p, unsigned int size) -{ } -static inline void kasan_check_write(const volatile void *p, unsigned int size) -{ } -#endif - -Conclusion - -Warning is true but the functions kasan_check_{read, write} were -purposefully made empty. So, ignore this warning. - -Observations - -I checked few other warnings of the same type. If the file is located in -include directory, then most of them needs to be ignored due to one of -the following reasons: - -1) If some macro is not defined then empty function with parameter is used. - The function is made purposefully empty as there are non empty functions - used when the macro is defined. - -Example Warnings: - -In file included from ./include/linux/kernel.h:14: -./include/linux/printk.h:519:53: warning: unused parameter 'prefix_str' [-Wunused-parameter] -static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, - ^ -./include/linux/printk.h:519:69: warning: unused parameter 'prefix_type' [-Wunused-parameter] -static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, - ^ -./include/linux/printk.h:520:10: warning: unused parameter 'rowsize' [-Wunused-parameter] - int rowsize, int groupsize, - ^ -./include/linux/printk.h:520:23: warning: unused parameter 'groupsize' [-Wunused-parameter] - int rowsize, int groupsize, - ^ -./include/linux/printk.h:521:18: warning: unused parameter 'buf' [-Wunused-parameter] - const void *buf, size_t len, bool ascii) - ^ -./include/linux/printk.h:521:30: warning: unused parameter 'len' [-Wunused-parameter] - const void *buf, size_t len, bool ascii) - ^ -./include/linux/printk.h:521:40: warning: unused parameter 'ascii' [-Wunused-parameter] - const void *buf, size_t len, bool ascii) - ^ -https://github.com/torvalds/linux/commit/cdf17449af1d9b596742c260134edd6c1fac2792 ----------------------------------------------------------------------------------------------------- -./include/linux/kernel.h:230:49: warning: unused parameter 'file' [-Wunused-parameter] - static inline void ___might_sleep(const char *file, int line, - ^ -./include/linux/kernel.h:230:59: warning: unused parameter 'line' [-Wunused-parameter] - static inline void ___might_sleep(const char *file, int line, - ^ -./include/linux/kernel.h:231:12: warning: unused parameter 'preempt_offset' [-Wunused-parameter] - int preempt_offset) { } - ^ -./include/linux/kernel.h:232:48: warning: unused parameter 'file' [-Wunused-parameter] - static inline void __might_sleep(const char *file, int line, - ^ -./include/linux/kernel.h:232:58: warning: unused parameter 'line' [-Wunused-parameter] - static inline void __might_sleep(const char *file, int line, - ^ -./include/linux/kernel.h:233:12: warning: unused parameter 'preempt_offset' [-Wunused-parameter] - int preempt_offset) { } - ^ --------------------------------------------------------------------------------------------------------- - -In file included from ./arch/x86/include/asm/string_64.h:6: -./include/linux/jump_label.h:233:50: warning: unused parameter 'start' [-Wunused-parameter] -static inline int jump_label_text_reserved(void *start, void *end) - ^ -./include/linux/jump_label.h:233:63: warning: unused parameter 'end' [-Wunused-parameter] -static inline int jump_label_text_reserved(void *start, void *end) - ^ - -static inline int jump_label_text_reserved(void *start, void *end) -{ - return 0; -} - -In file included from ./arch/x86/include/asm/string_64.h:6: -./include/linux/jump_label.h:241:56: warning: unused parameter 'mod' [-Wunused-parameter] -static inline int jump_label_apply_nops(struct module *mod) - ^ -https://github.com/torvalds/linux/commit/d430d3d7e646eb1eac2bb4aa244a644312e67c76 -https://github.com/torvalds/linux/commit/4c3ef6d79328c0e23ade60cbfc8d496123a6855c - -2) Empty functions to annotate something. This too is purposefully added. - -Example Warnings: - -In file included from ./include/linux/spinlock_types.h:18: -./include/linux/lockdep.h:475:49: warning: unused parameter 'force' [-Wunused-parameter] -static inline void lockdep_invariant_state(bool force) {} - ^ -https://github.com/torvalds/linux/commit/f52be5708076b75a045ac52c6fef3fffb8300525 - -In file included from ./include/linux/spinlock_types.h:18: -./include/linux/lockdep.h:476:58: warning: unused parameter 'task' [-Wunused-parameter] -static inline void lockdep_init_task(struct task_struct *task) {} - ^ -In file included from ./include/linux/spinlock_types.h:18: -./include/linux/lockdep.h:477:58: warning: unused parameter 'task' [-Wunused-parameter] -static inline void lockdep_free_task(struct task_struct *task) {} - ^ -https://github.com/torvalds/linux/commit/b09be676e0ff25bd6d2e7637e26d349f9109ad75 - -In file included from ./include/linux/spinlock_types.h:18: -./include/linux/lockdep.h:622:36: warning: unused parameter 'file' [-Wunused-parameter] -lockdep_rcu_suspicious(const char *file, const int line, const char *s) - ^ -./include/linux/lockdep.h:622:52: warning: unused parameter 'line' [-Wunused-parameter] -lockdep_rcu_suspicious(const char *file, const int line, const char *s) - ^ -./include/linux/lockdep.h:622:70: warning: unused parameter 's' [-Wunused-parameter] -lockdep_rcu_suspicious(const char *file, const int line, const char *s) - -https://github.com/torvalds/linux/commit/d24209bb689e2c7f7418faec9b4a948e922d24da - -3) Empty function will be updated in future. - -Example Warning: -In file included from ./arch/x86/include/asm/processor.h:19: -./arch/x86/include/asm/pgtable_types.h:361:43: warning: unused parameter 'p4d' [-Wunused-parameter] -static inline p4dval_t p4d_pfn_mask(p4d_t p4d) - ^ -https://lwn.net/Articles/708526/ -https://github.com/torvalds/linux/commit/fe1e8c3e9634071ac608172e29bf997596d17c7c - -There can be warnings of which are true and needs to be fixed but I did -not find any till now. - -Also, there are warnings which are false positive, the parameters are -used but clang did not understand their usage. - -Example Warning: -In file included from ./include/linux/compiler.h:246: -./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter] -static inline void kasan_check_read(const volatile void *p, unsigned int size) - ^ diff --git a/Report/Report_0001.md b/Report/Report_0001.md new file mode 100644 index 0000000..04e5fce --- /dev/null +++ b/Report/Report_0001.md @@ -0,0 +1,171 @@ +# Warning Analysis Report + +### General + +**_Warning Type:_** -Wunused-parameter
+**_Warning Explanation:_** + +> In file included from ./include/linux/compiler.h:246:
+ ./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter]
+ static inline void kasan_check_read(const volatile void *p, unsigned int size)
+ ./include/linux/kasan-checks.h:9:74: warning: unused parameter 'size' [-Wunused-parameter]
+ static inline void kasan_check_read(const volatile void *p, unsigned int size)
+ ./include/linux/kasan-checks.h:11:59: warning: unused parameter 'p' [-Wunused-parameter]
+ static inline void kasan_check_write(const volatile void *p, unsigned int size)
+ ./include/linux/kasan-checks.h:11:75: warning: unused parameter 'size' [-Wunused-parameter]
+ static inline void kasan_check_write(const volatile void *p, unsigned int size)
+ +### History + +**_Introduced in version:_** v4.7-rc1
+**_Date:_** 2016-05-20
+**_Author:_** Andrey Ryabinin
+**_Patch:_** +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=64f8ebaf115bcddc4aaa902f981c57ba6506bc42 + +#### Recent Changes + +**_Date:_** 2017-06-22
+**_Author:_** Dmitry Vyukov
+**_Patch:_** https://patchwork.kernel.org/patch/9768477/ + +### Warning Assessment + +**_File Location:_** include/linux/kasan-checks.h + +``` +#ifdef CONFIG_KASAN +void kasan_check_read(const volatile void *p, unsigned int size); +void kasan_check_write(const volatile void *p, unsigned int size); +#else +static inline void kasan_check_read(const volatile void *p, unsigned int size) +{ } +static inline void kasan_check_write(const volatile void *p, unsigned int size) +{ } +#endif +``` + +### Conclusion + +Warning is true but the functions kasan_check_{read, write} were +purposefully made empty. So, ignore this warning. + +### Observations + +I checked few other warnings of the same type. If the file is located in +include directory, then most of them needs to be ignored due to one of +the following reasons: + +1. If some macro is not defined then empty function with parameter is used.
+ The function is made purposefully empty as there are non empty functions
+ used when the macro is defined. + +Example Warnings: + +> In file included from ./include/linux/kernel.h:14:
+ ./include/linux/printk.h:519:53: warning: unused parameter 'prefix_str' [-Wunused-parameter]
+ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
+ ./include/linux/printk.h:519:69: warning: unused parameter 'prefix_type' [-Wunused-parameter]
+ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
+ ./include/linux/printk.h:520:10: warning: unused parameter 'rowsize' [-Wunused-parameter]
+ int rowsize, int groupsize,
+ ./include/linux/printk.h:520:23: warning: unused parameter 'groupsize' [-Wunused-parameter]
+ int rowsize, int groupsize,
+ ./include/linux/printk.h:521:18: warning: unused parameter 'buf' [-Wunused-parameter]
+ const void *buf, size_t len, bool ascii)
+ ./include/linux/printk.h:521:30: warning: unused parameter 'len' [-Wunused-parameter]
+ const void *buf, size_t len, bool ascii)
+ ./include/linux/printk.h:521:40: warning: unused parameter 'ascii' [-Wunused-parameter]
+ const void *buf, size_t len, bool ascii) + +Patch which introduced the above lines
+https://github.com/torvalds/linux/commit/cdf17449af1d9b596742c260134edd6c1fac2792 + +> ./include/linux/kernel.h:230:49: warning: unused parameter 'file' [-Wunused-parameter]
+ static inline void ___might_sleep(const char *file, int line,
+ ./include/linux/kernel.h:230:59: warning: unused parameter 'line' [-Wunused-parameter]
+ static inline void ___might_sleep(const char *file, int line,
+./include/linux/kernel.h:231:12: warning: unused parameter 'preempt_offset' [-Wunused-parameter]
+ int preempt_offset) { }
+./include/linux/kernel.h:232:48: warning: unused parameter 'file' [-Wunused-parameter]
+ static inline void __might_sleep(const char *file, int line,
+ ./include/linux/kernel.h:232:58: warning: unused parameter 'line' [-Wunused-parameter]
+ static inline void __might_sleep(const char *file, int line,
+ ./include/linux/kernel.h:233:12: warning: unused parameter 'preempt_offset' [-Wunused-parameter]
+ int preempt_offset) { }
+ +> In file included from ./arch/x86/include/asm/string_64.h:6:
+./include/linux/jump_label.h:233:50: warning: unused parameter 'start' [-Wunused-parameter]
+static inline int jump_label_text_reserved(void *start, void *end)
+./include/linux/jump_label.h:233:63: warning: unused parameter 'end' [-Wunused-parameter]
+static inline int jump_label_text_reserved(void *start, void *end)
+ +``` +static inline int jump_label_text_reserved(void *start, void *end) +{ + return 0; +} +``` + +> In file included from ./arch/x86/include/asm/string_64.h:6:
+./include/linux/jump_label.h:241:56: warning: unused parameter 'mod' [-Wunused-parameter]
+static inline int jump_label_apply_nops(struct module *mod) + +Patches which introduced the above lines
+https://github.com/torvalds/linux/commit/d430d3d7e646eb1eac2bb4aa244a644312e67c76
+https://github.com/torvalds/linux/commit/4c3ef6d79328c0e23ade60cbfc8d496123a6855c + +2. Empty functions to annotate something. This too is purposefully added. + +Example Warnings: + +> In file included from ./include/linux/spinlock_types.h:18:
+./include/linux/lockdep.h:475:49: warning: unused parameter 'force' [-Wunused-parameter]
+static inline void lockdep_invariant_state(bool force) {}
+ +Patch: https://github.com/torvalds/linux/commit/f52be5708076b75a045ac52c6fef3fffb8300525 + +> In file included from ./include/linux/spinlock_types.h:18:
+./include/linux/lockdep.h:476:58: warning: unused parameter 'task' [-Wunused-parameter]
+static inline void lockdep_init_task(struct task_struct *task) {}
+> +> In file included from ./include/linux/spinlock_types.h:18:
+./include/linux/lockdep.h:477:58: warning: unused parameter 'task' [-Wunused-parameter]
+static inline void lockdep_free_task(struct task_struct *task) {}
+ +Patch: https://github.com/torvalds/linux/commit/b09be676e0ff25bd6d2e7637e26d349f9109ad75 + +> In file included from ./include/linux/spinlock_types.h:18:
+./include/linux/lockdep.h:622:36: warning: unused parameter 'file' [-Wunused-parameter]
+lockdep_rcu_suspicious(const char *file, const int line, const char *s)
+./include/linux/lockdep.h:622:52: warning: unused parameter 'line' [-Wunused-parameter]
+lockdep_rcu_suspicious(const char *file, const int line, const char *s)
+./include/linux/lockdep.h:622:70: warning: unused parameter 's' [-Wunused-parameter]
+lockdep_rcu_suspicious(const char *file, const int line, const char *s)
+ +Patch: https://github.com/torvalds/linux/commit/d24209bb689e2c7f7418faec9b4a948e922d24da + +3. Empty function will be updated in future. + +Example Warning: + +> In file included from ./arch/x86/include/asm/processor.h:19:
+./arch/x86/include/asm/pgtable_types.h:361:43: warning: unused parameter 'p4d' [-Wunused-parameter]
+static inline p4dval_t p4d_pfn_mask(p4d_t p4d) + +References
+https://lwn.net/Articles/708526/
+https://github.com/torvalds/linux/commit/fe1e8c3e9634071ac608172e29bf997596d17c7c
+ +There can be warnings of which are true and needs to be fixed but I did
+not find any till now.
+ +Also, there are warnings which are false positive, the parameters are
+used but clang did not understand their usage.
+ +Example Warning: + +> In file included from ./include/linux/compiler.h:246:
+./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter]
+static inline void kasan_check_read(const volatile void *p, unsigned int size)
+ From f085dfd469344bdf1a5ed3e6ed00797ee2e5972f Mon Sep 17 00:00:00 2001 From: Varsha Date: Sat, 31 Mar 2018 13:41:33 +0530 Subject: [PATCH 3/3] Legacy code warnings I checked few other warnings, but they are mostly on legacy code. --- Report/Report_0001.md | 44 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/Report/Report_0001.md b/Report/Report_0001.md index 04e5fce..ced4ace 100644 --- a/Report/Report_0001.md +++ b/Report/Report_0001.md @@ -168,4 +168,46 @@ Example Warning: > In file included from ./include/linux/compiler.h:246:
./include/linux/kasan-checks.h:9:58: warning: unused parameter 'p' [-Wunused-parameter]
static inline void kasan_check_read(const volatile void *p, unsigned int size)
- + +There is one more category of **legacy code**, the warning in this code needs to be
+ignored.
+ +Example Warning: +``` +In file included from scripts/kconfig/conf.c:19: +scripts/kconfig/lkc.h:158:56: warning: unused parameter 'ch' [-Wunused-parameter] +static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval) + ^ +1 warning generated. + HOSTCC scripts/kconfig/zconf.tab.o +In file included from scripts/kconfig/zconf.tab.c:79: +scripts/kconfig/lkc.h:158:56: warning: unused parameter 'ch' [-Wunused-parameter] +static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval) +``` + +Patch: https://github.com/torvalds/linux/commit/1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 + +``` +In file included from scripts/kconfig/zconf.tab.c:2486: +scripts/kconfig/expr.c:1282:63: warning: unused parameter 'sym' [-Wunused-parameter] +static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) + ^ + +scripts/kconfig/expr.c:1282:static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) +scripts/kconfig/expr.c:1289: expr_print(e, expr_print_file_helper, out, E_NONE); +``` + +Patch: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab45d190fd4acf0b0e5d307294ce24a90a69cc23 + +Another category where knowingly the parameter is not used. + +Example Warning: + +``` +scripts/mod/file2alias.c:909:40: warning: unused parameter 'filename' [-Wunused-parameter] +static int do_virtio_entry(const char *filename, void *symval, + ^ +``` + +Patch: https://lists.linuxfoundation.org/pipermail/virtualization/2007-September/008955.html +