[PATCH 05/21] spi: s3c64xx: explicitly include <linux/bits.h>

Tudor Ambarus posted 21 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH 05/21] spi: s3c64xx: explicitly include <linux/bits.h>
Posted by Tudor Ambarus 1 year, 11 months ago
The driver uses GENMASK() but does not include <linux/bits.h>.
Include the missing header, we shall aim to have the drivers self
contained.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/spi/spi-s3c64xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index b350e70fd179..9ce56aa792ed 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -3,6 +3,7 @@
 // Copyright (c) 2009 Samsung Electronics Co., Ltd.
 //      Jaswinder Singh <jassi.brar@samsung.com>
 
+#include <linux/bits.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
-- 
2.43.0.429.g432eaa2c6b-goog
Re: [PATCH 05/21] spi: s3c64xx: explicitly include <linux/bits.h>
Posted by Andi Shyti 1 year, 11 months ago
Hi Tudor,

On Tue, Jan 23, 2024 at 03:34:04PM +0000, Tudor Ambarus wrote:
> The driver uses GENMASK() but does not include <linux/bits.h>.
> Include the missing header, we shall aim to have the drivers self
> contained.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
>  drivers/spi/spi-s3c64xx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index b350e70fd179..9ce56aa792ed 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -3,6 +3,7 @@
>  // Copyright (c) 2009 Samsung Electronics Co., Ltd.
>  //      Jaswinder Singh <jassi.brar@samsung.com>
>  
> +#include <linux/bits.h>

I don't see why this should be included. Are there cases when
not having bits.h produces any compilation error?

Andi

>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> -- 
> 2.43.0.429.g432eaa2c6b-goog
>
Re: [PATCH 05/21] spi: s3c64xx: explicitly include <linux/bits.h>
Posted by Mark Brown 1 year, 11 months ago
On Tue, Jan 23, 2024 at 11:28:31PM +0100, Andi Shyti wrote:
> On Tue, Jan 23, 2024 at 03:34:04PM +0000, Tudor Ambarus wrote:

> > +#include <linux/bits.h>

> I don't see why this should be included. Are there cases when
> not having bits.h produces any compilation error?

It is good practice to directly include all headers used, it avoids
implicit dependencies and spurious breakage if someone rearranges
headers and causes the implicit include to vanish.