aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2007-11-05 14:52:14 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:41 -0500
commit8ee24023ef43c77cdaea1add00e1e45cc4fc3261 (patch)
treed36320fa2a3ff4e8d98ff17a31cbe6b292c1155f
parent5929faf3334f4c69f3bb02be59d7c127e0cefa1f (diff)
[SCSI] libsas: Fix various sparse complaints
Annotate sas_queuecommand with locking details, and clean up a few more sparse warnings about static/non-static declarations. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c6
-rw-r--r--include/scsi/libsas.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 7663841eb4cf..b784089b18d0 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -200,6 +200,10 @@ int sas_queue_up(struct sas_task *task)
200 */ 200 */
201int sas_queuecommand(struct scsi_cmnd *cmd, 201int sas_queuecommand(struct scsi_cmnd *cmd,
202 void (*scsi_done)(struct scsi_cmnd *)) 202 void (*scsi_done)(struct scsi_cmnd *))
203 __releases(host->host_lock)
204 __acquires(dev->sata_dev.ap->lock)
205 __releases(dev->sata_dev.ap->lock)
206 __acquires(host->host_lock)
203{ 207{
204 int res = 0; 208 int res = 0;
205 struct domain_device *dev = cmd_to_domain_dev(cmd); 209 struct domain_device *dev = cmd_to_domain_dev(cmd);
@@ -410,7 +414,7 @@ static int sas_recover_I_T(struct domain_device *dev)
410} 414}
411 415
412/* Find the sas_phy that's attached to this device */ 416/* Find the sas_phy that's attached to this device */
413struct sas_phy *find_local_sas_phy(struct domain_device *dev) 417static struct sas_phy *find_local_sas_phy(struct domain_device *dev)
414{ 418{
415 struct domain_device *pdev = dev->parent; 419 struct domain_device *pdev = dev->parent;
416 struct ex_phy *exphy = NULL; 420 struct ex_phy *exphy = NULL;
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index e42374cebf95..93248cd48373 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -563,7 +563,7 @@ struct sas_task {
563 struct work_struct abort_work; 563 struct work_struct abort_work;
564}; 564};
565 565
566 566extern struct kmem_cache *sas_task_cache;
567 567
568#define SAS_TASK_STATE_PENDING 1 568#define SAS_TASK_STATE_PENDING 1
569#define SAS_TASK_STATE_DONE 2 569#define SAS_TASK_STATE_DONE 2
@@ -573,7 +573,6 @@ struct sas_task {
573 573
574static inline struct sas_task *sas_alloc_task(gfp_t flags) 574static inline struct sas_task *sas_alloc_task(gfp_t flags)
575{ 575{
576 extern struct kmem_cache *sas_task_cache;
577 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); 576 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags);
578 577
579 if (task) { 578 if (task) {
@@ -590,7 +589,6 @@ static inline struct sas_task *sas_alloc_task(gfp_t flags)
590static inline void sas_free_task(struct sas_task *task) 589static inline void sas_free_task(struct sas_task *task)
591{ 590{
592 if (task) { 591 if (task) {
593 extern struct kmem_cache *sas_task_cache;
594 BUG_ON(!list_empty(&task->list)); 592 BUG_ON(!list_empty(&task->list));
595 kmem_cache_free(sas_task_cache, task); 593 kmem_cache_free(sas_task_cache, task);
596 } 594 }