lkml.org 
[lkml]   [2021]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 03/20] dlb: add resource and device initialization
On Mon, Jan 04, 2021 at 08:58:22PM -0600, Mike Ximing Chen wrote:
> Introduce dlb_bitmap_* functions, a thin convenience layer wrapping the
> Linux bitmap interfaces, used by the bitmaps in the dlb hardware types.

No, you created custom #defines:

> --- a/drivers/misc/dlb/dlb_hw_types.h
> +++ b/drivers/misc/dlb/dlb_hw_types.h
> @@ -5,6 +5,15 @@
> #define __DLB_HW_TYPES_H
>
> #include <linux/io.h>
> +#include <linux/types.h>
> +
> +#include "dlb_bitmap.h"
> +
> +#define BITS_SET(x, val, mask) (x = ((x) & ~(mask)) \
> + | (((val) << (mask##_LOC)) & (mask)))
> +#define BITS_CLR(x, mask) ((x) &= ~(mask))
> +#define BIT_SET(x, mask) ((x) |= (mask))
> +#define BITS_GET(x, mask) (((x) & (mask)) >> (mask##_LOC))

We have functions for this, use them, don't create custom macros for
them. Use the Linux functions please.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-01-07 20:40    [W:0.345 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site