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

Message ID 20231215184218.2005611-3-andriy.shevchenko@linux.intel.com
State New
Headers
Series bitmap-str: A couple of fixes |

Commit Message

Andy Shevchenko Dec. 15, 2023, 6:41 p.m. UTC
  Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/bitmap-str.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Yury Norov Dec. 15, 2023, 7:05 p.m. UTC | #1
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
  

Patch

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,