locking/mutex: Remove repeated declaration
diff mbox series

Message ID 1616461774-18644-1-git-send-email-zhangshaokun@hisilicon.com
State New, archived
Headers show
Series
  • locking/mutex: Remove repeated declaration
Related show

Commit Message

Shaokun Zhang March 23, 2021, 1:09 a.m. UTC
Commit 0cd39f4600ed ("locking/seqlock, headers: Untangle the spaghetti monster")
introduces 'struct ww_acquire_ctx' again, remove the repeated declaration.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will@kernel.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
 include/linux/mutex.h | 2 --
 1 file changed, 2 deletions(-)

Comments

Waiman Long March 23, 2021, 1:39 a.m. UTC | #1
On 3/22/21 9:09 PM, Shaokun Zhang wrote:
> Commit 0cd39f4600ed ("locking/seqlock, headers: Untangle the spaghetti monster")
> introduces 'struct ww_acquire_ctx' again, remove the repeated declaration.
>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Waiman Long <longman@redhat.com>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> ---
>   include/linux/mutex.h | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/include/linux/mutex.h b/include/linux/mutex.h
> index 0cd631a19727..d80c0e22c822 100644
> --- a/include/linux/mutex.h
> +++ b/include/linux/mutex.h
> @@ -20,8 +20,6 @@
>   #include <linux/osq_lock.h>
>   #include <linux/debug_locks.h>
>   
> -struct ww_acquire_ctx;
> -
>   /*
>    * Simple, straightforward mutexes with strict semantics:
>    *

Yes, it is duplicated.

Acked-by: Waiman Long <longman@redhat.com>
Ingo Molnar March 23, 2021, 11:23 a.m. UTC | #2
* Shaokun Zhang <zhangshaokun@hisilicon.com> wrote:

> Commit 0cd39f4600ed ("locking/seqlock, headers: Untangle the spaghetti monster")
> introduces 'struct ww_acquire_ctx' again, remove the repeated declaration.
> 
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Waiman Long <longman@redhat.com>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> ---
>  include/linux/mutex.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/linux/mutex.h b/include/linux/mutex.h
> index 0cd631a19727..d80c0e22c822 100644
> --- a/include/linux/mutex.h
> +++ b/include/linux/mutex.h
> @@ -20,8 +20,6 @@
>  #include <linux/osq_lock.h>
>  #include <linux/debug_locks.h>
>  
> -struct ww_acquire_ctx;
> -
>  /*
>   * Simple, straightforward mutexes with strict semantics:
>   *

Please also group the pre-declarations together, that's the canonical 
pattern we use in headers.

I.e. have something like this at the top:

  struct ww_class;
  struct ww_acquire_ctx;

Thanks,

	Ingo
Shaokun Zhang March 24, 2021, 2:49 a.m. UTC | #3
Hi Ingo,

On 2021/3/23 19:23, Ingo Molnar wrote:
> 
> * Shaokun Zhang <zhangshaokun@hisilicon.com> wrote:
> 
>> Commit 0cd39f4600ed ("locking/seqlock, headers: Untangle the spaghetti monster")
>> introduces 'struct ww_acquire_ctx' again, remove the repeated declaration.
>>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: Waiman Long <longman@redhat.com>
>> Cc: Boqun Feng <boqun.feng@gmail.com>
>> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
>> ---
>>  include/linux/mutex.h | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/include/linux/mutex.h b/include/linux/mutex.h
>> index 0cd631a19727..d80c0e22c822 100644
>> --- a/include/linux/mutex.h
>> +++ b/include/linux/mutex.h
>> @@ -20,8 +20,6 @@
>>  #include <linux/osq_lock.h>
>>  #include <linux/debug_locks.h>
>>  
>> -struct ww_acquire_ctx;
>> -
>>  /*
>>   * Simple, straightforward mutexes with strict semantics:
>>   *
> 
> Please also group the pre-declarations together, that's the canonical 
> pattern we use in headers.

Ok,

> 
> I.e. have something like this at the top:
> 

Got it, I will do it in next version.

Thanks,
Shaokun

>   struct ww_class;
>   struct ww_acquire_ctx;
> 
> Thanks,
> 
> 	Ingo
> .
>

Patch
diff mbox series

diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 0cd631a19727..d80c0e22c822 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -20,8 +20,6 @@ 
 #include <linux/osq_lock.h>
 #include <linux/debug_locks.h>
 
-struct ww_acquire_ctx;
-
 /*
  * Simple, straightforward mutexes with strict semantics:
  *