[PATCH v2 2/2] bitmap-str: Add missing header(s)

Andy Shevchenko posted 2 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v2 2/2] bitmap-str: Add missing header(s)
Posted by Andy Shevchenko 8 months, 1 week ago
bitmap-str.h is not self-contained, it uses something that is provided
elsewhere, add missing header(s).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/bitmap-str.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/bitmap-str.h b/include/linux/bitmap-str.h
index d758b4809a3a..53d3e1b32d3d 100644
--- a/include/linux/bitmap-str.h
+++ b/include/linux/bitmap-str.h
@@ -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,
-- 
2.47.2
Re: [PATCH v2 2/2] bitmap-str: Add missing header(s)
Posted by Yury Norov 8 months, 1 week ago
On Wed, Apr 16, 2025 at 09:32:11AM +0300, Andy Shevchenko wrote:
> bitmap-str.h is 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
 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  include/linux/bitmap-str.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/bitmap-str.h b/include/linux/bitmap-str.h
> index d758b4809a3a..53d3e1b32d3d 100644
> --- a/include/linux/bitmap-str.h
> +++ b/include/linux/bitmap-str.h
> @@ -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,
> -- 
> 2.47.2
Re: [PATCH v2 2/2] bitmap-str: Add missing header(s)
Posted by Andy Shevchenko 8 months, 1 week ago
On Wed, Apr 16, 2025 at 12:56:08PM -0400, Yury Norov wrote:
> On Wed, Apr 16, 2025 at 09:32:11AM +0300, Andy Shevchenko wrote:
> > bitmap-str.h is 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.

bool, __user is defined in compiler_*.h which is guaranteed to be included by
types.h

> Can you add the compiler error you're trying to fix, or how did you
> caught it?

It's by reading the code.

-- 
With Best Regards,
Andy Shevchenko