diff mbox series

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

Message ID 20240123153421.715951-6-tudor.ambarus@linaro.org (mailing list archive)
State Accepted
Commit 4568fa574fcef3811a8140702979f076ef0f5bc0
Headers show
Series spi: s3c64xx: winter cleanup and gs101 support | expand

Commit Message

Tudor Ambarus Jan. 23, 2024, 3:34 p.m. UTC
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(+)

Comments

Andi Shyti Jan. 23, 2024, 10:28 p.m. UTC | #1
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
>
Mark Brown Jan. 23, 2024, 10:42 p.m. UTC | #2
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.
diff mbox series

Patch

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>