public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: don't include '<linux/rwlock_types.h>' directly
@ 2024-12-17  7:05 Wolfram Sang
  2024-12-17  7:14 ` Qu Wenruo
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2024-12-17  7:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wolfram Sang, Chris Mason, Josef Bacik, David Sterba, linux-btrfs

The header clearly states that it does not want to be included directly,
only via '<linux/spinlock_types.h>'. Replace the include accordingly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 fs/btrfs/fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
index 79a1a3d6f04d..78e558652908 100644
--- a/fs/btrfs/fs.h
+++ b/fs/btrfs/fs.h
@@ -14,7 +14,7 @@
 #include <linux/lockdep.h>
 #include <linux/spinlock.h>
 #include <linux/mutex.h>
-#include <linux/rwlock_types.h>
+#include <linux/spinlock_types.h>
 #include <linux/rwsem.h>
 #include <linux/semaphore.h>
 #include <linux/list.h>
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: don't include '<linux/rwlock_types.h>' directly
  2024-12-17  7:05 [PATCH] btrfs: don't include '<linux/rwlock_types.h>' directly Wolfram Sang
@ 2024-12-17  7:14 ` Qu Wenruo
  2024-12-19 11:27   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2024-12-17  7:14 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs



在 2024/12/17 17:35, Wolfram Sang 写道:
> The header clearly states that it does not want to be included directly,
> only via '<linux/spinlock_types.h>'. Replace the include accordingly.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>   fs/btrfs/fs.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
> index 79a1a3d6f04d..78e558652908 100644
> --- a/fs/btrfs/fs.h
> +++ b/fs/btrfs/fs.h
> @@ -14,7 +14,7 @@
>   #include <linux/lockdep.h>
>   #include <linux/spinlock.h>
>   #include <linux/mutex.h>
> -#include <linux/rwlock_types.h>
> +#include <linux/spinlock_types.h>

I think we can just remove the *_type.h include header completely.

For non-RT build, spinlock.h will include linux/rwlock.h, and
spinlock_types.h unconditionally.

Thanks,
Qu
>   #include <linux/rwsem.h>
>   #include <linux/semaphore.h>
>   #include <linux/list.h>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: don't include '<linux/rwlock_types.h>' directly
  2024-12-17  7:14 ` Qu Wenruo
@ 2024-12-19 11:27   ` Wolfram Sang
  2024-12-23 19:18     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2024-12-19 11:27 UTC (permalink / raw)
  To: Qu Wenruo
  Cc: linux-kernel, Chris Mason, Josef Bacik, David Sterba, linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Hi,

> > -#include <linux/rwlock_types.h>
> > +#include <linux/spinlock_types.h>
> 
> I think we can just remove the *_type.h include header completely.

I agree, spinlock.h is enough.

> For non-RT build, spinlock.h will include linux/rwlock.h, and
> spinlock_types.h unconditionally.

Yet, isn't it always included unconditionally?

spinlock.h -> spinlock_types.h -> rwlock_types.h

I don't see any conditionals there.

Thanks for the review and happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: don't include '<linux/rwlock_types.h>' directly
  2024-12-19 11:27   ` Wolfram Sang
@ 2024-12-23 19:18     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2024-12-23 19:18 UTC (permalink / raw)
  To: Wolfram Sang, Qu Wenruo, linux-kernel, Chris Mason, Josef Bacik,
	David Sterba, linux-btrfs

On Thu, Dec 19, 2024 at 12:27:39PM +0100, Wolfram Sang wrote:
> Hi,
> 
> > > -#include <linux/rwlock_types.h>
> > > +#include <linux/spinlock_types.h>
> > 
> > I think we can just remove the *_type.h include header completely.
> 
> I agree, spinlock.h is enough.

I've updated the fix to drop rwlock_types.h as spinlock.h is already
there. Added to for-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-23 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17  7:05 [PATCH] btrfs: don't include '<linux/rwlock_types.h>' directly Wolfram Sang
2024-12-17  7:14 ` Qu Wenruo
2024-12-19 11:27   ` Wolfram Sang
2024-12-23 19:18     ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox