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

Andy Shevchenko posted 2 patches 2 years ago
[PATCH v1 2/2] bitmap-str: Add missing header(s)
Posted by Andy Shevchenko 2 years ago
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.43.0.rc1.1.gbec44491f096
Re: [PATCH v1 2/2] bitmap-str: Add missing header(s)
Posted by Yury Norov 2 years ago
On Fri, Dec 15, 2023 at 08:41:09PM +0200, Andy Shevchenko wrote:
> 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>

There's no sense in including this header without bitmap.h, and the
latter includes linux/types.h, so no need to include it here again.

If you want to make it more rigorous, you can do like this:

        #ifndef __LINUX_BITMAP_H
        #error "Don't include separately from linux/bitmap.h"
        #endif

>  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.43.0.rc1.1.gbec44491f096