[SCSI] properly initialize atomic_t
authorJosh Hunt <johunt@akamai.com>
Sat, 9 Jun 2012 14:03:39 +0000 (07:03 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 20 Jul 2012 07:58:36 +0000 (08:58 +0100)
Initialize atomic_t scsi_host_next_hn and ioerr_cntas per the guidelines
defined in Documentation/atomic_ops.txt

Signed-off-by: Josh Hunt <johunt@akamai.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/hosts.c
drivers/scsi/sd.c

index a3a056a..2b6a03d 100644 (file)
@@ -42,7 +42,7 @@
 #include "scsi_logging.h"
 
 
-static atomic_t scsi_host_next_hn    /* host_no for next new host */
+static atomic_t scsi_host_next_hn = ATOMIC_INIT(0);    /* host_no for next new host */
 
 
 static void scsi_host_cls_release(struct device *dev)
index 6f72b80..6e26db1 100644 (file)
@@ -2704,6 +2704,7 @@ static int sd_probe(struct device *dev)
        sdkp->disk = gd;
        sdkp->index = index;
        atomic_set(&sdkp->openers, 0);
+       atomic_set(&sdkp->device->ioerr_cnt, 0);
 
        if (!sdp->request_queue->rq_timeout) {
                if (sdp->type != TYPE_MOD)