2024-01-23 15:36:08

by Tudor Ambarus

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

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 <[email protected]>
---
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 <[email protected]>

+#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
--
2.43.0.429.g432eaa2c6b-goog



2024-01-23 22:29:38

by Andi Shyti

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

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 <[email protected]>
> ---
> 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 <[email protected]>
>
> +#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
>

2024-01-23 22:54:30

by Mark Brown

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

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.


Attachments:
(No filename) (469.00 B)
signature.asc (499.00 B)
Download all attachments