[PATCH -next] block: use DEFINE_MUTEX() for mutex lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Ye Bin <yebin10@xxxxxxxxxx>
---
 drivers/block/pktcdvd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index fc4b0f1aa86d..699ed8bbdbdf 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -96,7 +96,7 @@ static struct proc_dir_entry *pkt_proc;
 static int pktdev_major;
 static int write_congestion_on  = PKT_WRITE_CONGESTION_ON;
 static int write_congestion_off = PKT_WRITE_CONGESTION_OFF;
-static struct mutex ctl_mutex;	/* Serialize open/close/setup/teardown */
+static DEFINE_MUTEX(ctl_mutex);	/* Serialize open/close/setup/teardown */
 static mempool_t psd_pool;
 static struct bio_set pkt_bio_set;
 
@@ -2858,8 +2858,6 @@ static int __init pkt_init(void)
 {
 	int ret;
 
-	mutex_init(&ctl_mutex);
-
 	ret = mempool_init_kmalloc_pool(&psd_pool, PSD_POOL_SIZE,
 				    sizeof(struct packet_stacked_data));
 	if (ret)




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux