bitmap-str: A couple of cleanups
v2 cover bitmap-str: A couple of cleanups
A couple of simple cleanups to the bitmap-str.h.
In v2:
- filled the commit messages (Yury)
Andy Shevchenko (2):
bitmap-str: Get rid of 'extern' for function prototypes
bitmap-str: Add missing header(s)
include/linux/bitmap-str.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
2.47.2
PATCH v2 1/2 bitmap-str: Get rid of 'extern' for function prototypes
The bitmap-str.h uses mixed style for function prototypes. Drop the 'extern' as it easier to read and makes style aligned with a new code in the kernel.
--- include/linux/bitmap-str.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/bitmap-str.h +4 -4
@@ -4,10 +4,10 @@int bitmap_parse_user (const char __user *ubuf,unsigned int ulen,unsigned long *dst,int nbits);int bitmap_print_to_pagebuf (bool list,char *buf,const unsigned long *maskp,int nmaskbits); -extern int bitmap_print_bitmask_to_buf (char *buf,const unsigned long *maskp, -int nmaskbits,loff_t off,size_t count); -extern int bitmap_print_list_to_buf (char *buf,const unsigned long *maskp, -int nmaskbits,loff_t off,size_t count); +int bitmap_print_bitmask_to_buf (char *buf,const unsigned long *maskp,int nmaskbits, +loff_t off,size_t count); +int bitmap_print_list_to_buf (char *buf,const unsigned long *maskp,int nmaskbits, +loff_t off,size_t count);int bitmap_parse (const char *buf,unsigned int buflen,unsigned long *dst,int nbits);int bitmap_parselist (const char *buf,unsigned long *maskp,int nmaskbits); int bitmap_parselist_user(const char __user *ubuf, unsigned int ulen,
Signature · 1 line
2.47.2
PATCH v2 2/2 bitmap-str: Add missing header(s)
In reply to Andy Shevchenkobitmap-str.h is not self-contained, it uses something that is provided elsewhere, add missing header(s).
--- include/linux/bitmap-str.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/bitmap-str.h +2 -0
@@ -2,6 +2,8 @@#ifndef __LINUX_BITMAP_STR_H#define __LINUX_BITMAP_STR_H +#include <linux/types.h> +int bitmap_parse_user (const char __user *ubuf,unsigned int ulen,unsigned long *dst,int nbits);int bitmap_print_to_pagebuf (bool list,char *buf,const unsigned long *maskp,int nmaskbits); int bitmap_print_bitmask_to_buf(char *buf, const unsigned long *maskp, int nmaskbits,
Signature · 1 line
2.47.2
Yury Norov
maintainerRe: [PATCH v2 2/2] bitmap-str: Add missing header(s)
Quoted 2 lines · Andy Shevchenko
bitmap-str.his not self-contained, it uses something that is provided elsewhere, add missing header(s).
Can you be more specific? Is 'something' means the __user? If so, it's provided in linux/compiler_types.h.
Can you add the compiler error you're trying to fix, or how did you caught it?
Thanks,
Yury
Quoted 20 lines
Signed-off-by Andy Shevchenko <[email protected]>--- include/linux/bitmap-str.h | 2 ++ 1 file changed, 2 insertions(+)include/linux/bitmap-str.h +2
-0@@ -2,6 +2,8 @@#ifndef __LINUX_BITMAP_STR_H#define __LINUX_BITMAP_STR_H +#include <linux/types.h> +int bitmap_parse_user (const char __user *ubuf,unsigned int ulen,unsigned long *dst,int nbits);int bitmap_print_to_pagebuf (bool list,char *buf,const unsigned long *maskp,int nmaskbits); int bitmap_print_bitmask_to_buf(char *buf, const unsigned long *maskp, int nmaskbits,Signature · 1 line
2.47.2
Re: [PATCH v2 2/2] bitmap-str: Add missing header(s)
Quoted 6 lines · Yury Norov
Quoted 2 lines · Andy Shevchenko
bitmap-str.his not self-contained, it uses something that is provided elsewhere, add missing header(s).Can you be more specific? Is 'something' means the
__user? If so, it's provided inlinux/compiler_types.h.
bool, __user is defined in compiler_*.h which is guaranteed to be included by types.h
Quoted 2 lines
Can you add the compiler error you're trying to fix, or how did you caught it?
It's by reading the code.
Signature · 2 lines
With Best Regards, Andy Shevchenko