[PATCH 4/7] staging: most: Use spinlock_t instead of struct spinlock

Sebastian Andrzej Siewior bigeasy at linutronix.de
Sat Jul 6 21:35:12 UTC 2019


On 2019-07-06 12:02:53 [+0200], Greg Kroah-Hartman wrote:
> On Thu, Jul 04, 2019 at 05:38:00PM +0200, Sebastian Andrzej Siewior wrote:
> > For spinlocks the type spinlock_t should be used instead of "struct
> > spinlock".
> 
> Why?
> 
> > Use spinlock_t for spinlock's definition.
> 
> Why?  I agree it makes the code smaller, but why is this required?

I remember PeterZ pointing out to stick to the typedef and it is
probably better to stick with the typdef since we have it. It was like
that since it was first introduced (2.1.25 for i386).
We have a checkpatch warning for that [0]. 

This series has only 7 patches (excluding the powerpc bits) so almost
everyone else is using just the typdef.

[0] 88982fea52d01 ("checkpatch: warn when declaring "struct spinlock foo;"")
    from Dec 2012

> thanks,
> 
> greg k-h

Sebastian


More information about the devel mailing list