Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154022
b: refs/heads/master
c: 30c9afa
h: refs/heads/master
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Jun 21, 2009
1 parent c5f0599 commit d1514e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 111986593561fc4c94a1fba3f3cd84476fb40b22
refs/heads/master: 30c9afa6cc477f6f21f8a0b36f3b81080941a0c9
8 changes: 6 additions & 2 deletions trunk/drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "scsi_logging.h"


static int scsi_host_next_hn; /* host_no for next new host */
static atomic_t scsi_host_next_hn; /* host_no for next new host */


static void scsi_host_cls_release(struct device *dev)
Expand Down Expand Up @@ -333,7 +333,11 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)

mutex_init(&shost->scan_mutex);

shost->host_no = scsi_host_next_hn++; /* XXX(hch): still racy */
/*
* subtract one because we increment first then return, but we need to
* know what the next host number was before increment
*/
shost->host_no = atomic_inc_return(&scsi_host_next_hn) - 1;
shost->dma_channel = 0xff;

/* These three are default values which can be overridden */
Expand Down

0 comments on commit d1514e6

Please sign in to comment.