s390/cio: use DEFINE_SPINLOCK() for spinlock
Subsystems (2)
PATCH 1/2 s390/cio: use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().
--- drivers/s390/cio/css.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/cio/css.c +1 -2
@@ -651,13 +651,12 @@ static void css_sch_todo(struct work_struct *work) }static struct idset *slow_subchannel_set; -static spinlock_t slow_subchannel_lock; +static DEFINE_SPINLOCK (slow_subchannel_lock);static wait_queue_head_t css_eval_wq;static atomic_t css_eval_scheduled;static int __init slow_subchannel_init (void ) { -spin_lock_init (&slow_subchannel_lock);atomic_set (&css_eval_scheduled,0 );init_waitqueue_head (&css_eval_wq); slow_subchannel_set =idset_sch_new ();
Signature · 1 line
2.25.1
PATCH 2/2 s390/cio: use DECLARE_WAIT_QUEUE_HEAD() for wait_queue
wait_queue_head_t can be initialized automatically with DECLARE_WAIT_QUEUE_HEAD() rather than explicitly calling init_waitqueue_head().
--- drivers/s390/cio/css.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/cio/css.c +1 -2
@@ -652,13 +652,12 @@ static void css_sch_todo(struct work_struct *work)static struct idset *slow_subchannel_set;static DEFINE_SPINLOCK (slow_subchannel_lock); -static wait_queue_head_t css_eval_wq; +static DECLARE_WAIT_QUEUE_HEAD (css_eval_wq);static atomic_t css_eval_scheduled;static int __init slow_subchannel_init (void ) {atomic_set (&css_eval_scheduled,0 ); -init_waitqueue_head (&css_eval_wq); slow_subchannel_set =idset_sch_new ();if (!slow_subchannel_set) {CIO_MSG_EVENT (0 ,"could not allocate slow subchannel set\n" );
Signature · 1 line
2.25.1
Re: [PATCH -next 2/2] s390/cio: use DECLARE_WAIT_QUEUE_HEAD() for wait_queue
For both the patches,
I will correct the description, and Heiko/Vasily will pick this up and will be part of the s390-tree patchset.
Quoted 2 lines · Shixin Liu
wait_queue_head_tcan be initialized automatically withDECLARE_WAIT_QUEUE_HEAD()rather than explicitly callinginit_waitqueue_head().
A minor checkpatch WARNING. I will modify this.
Quoted 25 lines
Signed-off-by Shixin Liu <[email protected]>--- drivers/s390/cio/css.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/s390/cio/css.c +1
-2@@ -652,13 +652,12 @@ static void css_sch_todo(struct work_struct *work)static struct idset *slow_subchannel_set;static DEFINE_SPINLOCK (slow_subchannel_lock); -static wait_queue_head_t css_eval_wq; +static DECLARE_WAIT_QUEUE_HEAD (css_eval_wq);static atomic_t css_eval_scheduled;static int __init slow_subchannel_init (void ) {atomic_set (&css_eval_scheduled,0 ); -init_waitqueue_head (&css_eval_wq); slow_subchannel_set =idset_sch_new ();if (!slow_subchannel_set) {CIO_MSG_EVENT (0 ,"could not allocate slow subchannel set\n" );
Thank you.
Quoted 2 lines · Shixin Liu
spinlock can be initialized automatically with
DEFINE_SPINLOCK()rather than explicitly callingspin_lock_init().
static spinlock
Quoted 25 lines
Signed-off-by Shixin Liu <[email protected]>--- drivers/s390/cio/css.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/s390/cio/css.c +1
-2@@ -651,13 +651,12 @@ static void css_sch_todo(struct work_struct *work) }static struct idset *slow_subchannel_set; -static spinlock_t slow_subchannel_lock; +static DEFINE_SPINLOCK (slow_subchannel_lock);static wait_queue_head_t css_eval_wq;static atomic_t css_eval_scheduled;static int __init slow_subchannel_init (void ) { -spin_lock_init (&slow_subchannel_lock);atomic_set (&css_eval_scheduled,0 );init_waitqueue_head (&css_eval_wq); slow_subchannel_set =idset_sch_new ();