* [PATCH] vduse: Remove include of rwlock.h
@ 2022-08-16 7:48 Sebastian Andrzej Siewior
2022-08-16 8:26 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-08-16 7:48 UTC (permalink / raw)
To: virtualization
Cc: Xie Yongji, Thomas Gleixner, Sebastian Andrzej Siewior,
Michael S. Tsirkin
rwlock.h should not be included directly. Instead linux/splinlock.h
should be included. Including it directly will break the RT build.
Remove the rwlock.h include.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/vdpa/vdpa_user/iova_domain.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/vdpa/vdpa_user/iova_domain.h b/drivers/vdpa/vdpa_user/iova_domain.h
index 4e0e50e7ac153..173e979b84a93 100644
--- a/drivers/vdpa/vdpa_user/iova_domain.h
+++ b/drivers/vdpa/vdpa_user/iova_domain.h
@@ -14,7 +14,6 @@
#include <linux/iova.h>
#include <linux/dma-mapping.h>
#include <linux/vhost_iotlb.h>
-#include <linux/rwlock.h>
#define IOVA_START_PFN 1
--
2.37.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] vduse: Remove include of rwlock.h
2022-08-16 7:48 [PATCH] vduse: Remove include of rwlock.h Sebastian Andrzej Siewior
@ 2022-08-16 8:26 ` Michael S. Tsirkin
2022-08-16 8:33 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-08-16 8:26 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: Xie Yongji, Thomas Gleixner, virtualization
On Tue, Aug 16, 2022 at 09:48:16AM +0200, Sebastian Andrzej Siewior wrote:
> rwlock.h should not be included directly. Instead linux/splinlock.h
> should be included. Including it directly will break the RT build.
>
> Remove the rwlock.h include.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
in fact
#ifndef __LINUX_SPINLOCK_H
# error "please don't include this file directly"
#endif
I wonder how does it build.
> ---
> drivers/vdpa/vdpa_user/iova_domain.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/vdpa/vdpa_user/iova_domain.h b/drivers/vdpa/vdpa_user/iova_domain.h
> index 4e0e50e7ac153..173e979b84a93 100644
> --- a/drivers/vdpa/vdpa_user/iova_domain.h
> +++ b/drivers/vdpa/vdpa_user/iova_domain.h
> @@ -14,7 +14,6 @@
> #include <linux/iova.h>
> #include <linux/dma-mapping.h>
> #include <linux/vhost_iotlb.h>
> -#include <linux/rwlock.h>
>
> #define IOVA_START_PFN 1
>
> --
> 2.37.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vduse: Remove include of rwlock.h
2022-08-16 8:26 ` Michael S. Tsirkin
@ 2022-08-16 8:33 ` Sebastian Andrzej Siewior
2022-08-16 8:39 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-08-16 8:33 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Xie Yongji, Thomas Gleixner, virtualization
On 2022-08-16 04:26:59 [-0400], Michael S. Tsirkin wrote:
> #ifndef __LINUX_SPINLOCK_H
> # error "please don't include this file directly"
> #endif
>
> I wonder how does it build.
spinlock.h is included earlier by other means so this define is
satisfied.
Sebastian
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vduse: Remove include of rwlock.h
2022-08-16 8:33 ` Sebastian Andrzej Siewior
@ 2022-08-16 8:39 ` Michael S. Tsirkin
2022-08-16 10:45 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-08-16 8:39 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: Xie Yongji, Thomas Gleixner, virtualization
On Tue, Aug 16, 2022 at 10:33:57AM +0200, Sebastian Andrzej Siewior wrote:
> On 2022-08-16 04:26:59 [-0400], Michael S. Tsirkin wrote:
> > #ifndef __LINUX_SPINLOCK_H
> > # error "please don't include this file directly"
> > #endif
> >
> > I wonder how does it build.
>
> spinlock.h is included earlier by other means so this define is
> satisfied.
>
> Sebastian
I see. In that case this ifndef is pointless isn't it?
We want something like:
>>>
rwlock: detect use outside of spinlock.h
current ifndef does not really prevent including rwlock.h
directly.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
diff --git a/include/linux/rwlock.h b/include/linux/rwlock.h
index 8f416c5e929e..c0ef596f340b 100644
--- a/include/linux/rwlock.h
+++ b/include/linux/rwlock.h
@@ -1,7 +1,7 @@
#ifndef __LINUX_RWLOCK_H
#define __LINUX_RWLOCK_H
-#ifndef __LINUX_SPINLOCK_H
+#ifndef __LINUX_INSIDE_SPINLOCK_H
# error "please don't include this file directly"
#endif
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 5c0c5174155d..3d456d71d235 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -2,6 +2,8 @@
#ifndef __LINUX_SPINLOCK_H
#define __LINUX_SPINLOCK_H
+#define __LINUX_INSIDE_SPINLOCK_H
+
/*
* include/linux/spinlock.h - generic spinlock/rwlock declarations
*
@@ -492,4 +494,6 @@ int __alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask,
void free_bucket_spinlocks(spinlock_t *locks);
+#undef __LINUX_INSIDE_SPINLOCK_H
+
#endif /* __LINUX_SPINLOCK_H */
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] vduse: Remove include of rwlock.h
2022-08-16 8:39 ` Michael S. Tsirkin
@ 2022-08-16 10:45 ` Sebastian Andrzej Siewior
2022-08-16 11:59 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-08-16 10:45 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Xie Yongji, Thomas Gleixner, virtualization
On 2022-08-16 04:39:29 [-0400], Michael S. Tsirkin wrote:
> rwlock: detect use outside of spinlock.h
>
> current ifndef does not really prevent including rwlock.h
> directly.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Actually, yes, this should do the job and render the checkpatch.pl
patch, I sent earlier, obsolete.
Sebastian
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vduse: Remove include of rwlock.h
2022-08-16 10:45 ` Sebastian Andrzej Siewior
@ 2022-08-16 11:59 ` Michael S. Tsirkin
0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-08-16 11:59 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: Xie Yongji, Thomas Gleixner, virtualization
On Tue, Aug 16, 2022 at 12:45:27PM +0200, Sebastian Andrzej Siewior wrote:
> On 2022-08-16 04:39:29 [-0400], Michael S. Tsirkin wrote:
> > rwlock: detect use outside of spinlock.h
> >
> > current ifndef does not really prevent including rwlock.h
> > directly.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> Actually, yes, this should do the job and render the checkpatch.pl
> patch, I sent earlier, obsolete.
>
> Sebastian
Feel free to include in a series.
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-08-16 11:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 7:48 [PATCH] vduse: Remove include of rwlock.h Sebastian Andrzej Siewior
2022-08-16 8:26 ` Michael S. Tsirkin
2022-08-16 8:33 ` Sebastian Andrzej Siewior
2022-08-16 8:39 ` Michael S. Tsirkin
2022-08-16 10:45 ` Sebastian Andrzej Siewior
2022-08-16 11:59 ` Michael S. Tsirkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.