public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt
@ 2012-06-09 14:03 Josh Hunt
  2012-06-09 14:03 ` [PATCH 2/2] scsi: properly initialize atomic_t scsi_host_next_hn Josh Hunt
  2012-06-26  4:37 ` [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt Josh Hunt
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Hunt @ 2012-06-09 14:03 UTC (permalink / raw)
  To: James E.J. Bottomley, linux-scsi; +Cc: linux-kernel, Josh Hunt

Initialize atomic_t ioerr_cnt as per the guidelines defined in Documentation/atomic_ops.txt

Reported-by: Debabrata Banerjee <dbanerje@akamai.com>
Signed-off-by: Josh Hunt <johunt@akamai.com>
---
 drivers/scsi/sd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6f0a4c6..8b85703 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2702,6 +2702,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)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] scsi: properly initialize atomic_t scsi_host_next_hn
  2012-06-09 14:03 [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt Josh Hunt
@ 2012-06-09 14:03 ` Josh Hunt
  2012-06-26  4:37 ` [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt Josh Hunt
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Hunt @ 2012-06-09 14:03 UTC (permalink / raw)
  To: James E.J. Bottomley, linux-scsi; +Cc: linux-kernel, Josh Hunt

Initialize atomic_t scsi_host_next_hn as per the guidelines defined in Documentation/atomic_ops.txt

Signed-off-by: Josh Hunt <johunt@akamai.com>
---
 drivers/scsi/hosts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index a3a056a..2b6a03d 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -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)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt
  2012-06-09 14:03 [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt Josh Hunt
  2012-06-09 14:03 ` [PATCH 2/2] scsi: properly initialize atomic_t scsi_host_next_hn Josh Hunt
@ 2012-06-26  4:37 ` Josh Hunt
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Hunt @ 2012-06-26  4:37 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Josh Hunt, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org

On 06/09/2012 09:03 AM, Josh Hunt wrote:
> Initialize atomic_t ioerr_cnt as per the guidelines defined in Documentation/atomic_ops.txt
> 
> Reported-by: Debabrata Banerjee <dbanerje@akamai.com>
> Signed-off-by: Josh Hunt <johunt@akamai.com>
> ---
>  drivers/scsi/sd.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 6f0a4c6..8b85703 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2702,6 +2702,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)

Ping?

I know these are trivial, but they seem to be correct. If not, I'd be
interested to understand why.

Thanks
Josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-26  4:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09 14:03 [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt Josh Hunt
2012-06-09 14:03 ` [PATCH 2/2] scsi: properly initialize atomic_t scsi_host_next_hn Josh Hunt
2012-06-26  4:37 ` [PATCH 1/2] scsi: propery initialize atomic_t ioerr_cnt Josh Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox