From 5dd7ed2e811d5cd12f31fb7f0c5ad0107d494a12 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 14 Mar 2011 04:06:01 -0700 Subject: [SCSI] target: Minor sparse warning fixes and annotations This patch addresses the majority of sparse warnings and adds proper locking annotations. It also fixes the dubious one-bit signed bitfield, for which the signed one-bit types can be 0 or -1 which can cause a problem if someone ever checks if (foo->lu_gp_assoc == 1). The current code is fine because everyone just checks zero vs non-zero. But Sparse complains about it so lets change it. The warnings look like this: include/target/target_core_base.h:228:26: error: dubious one-bit signed bitfield Signed-off-by: Dan Carpenter Signed-off-by: Fubo Chen Signed-off-by: Nicholas A. Bellinger Signed-off-by: James Bottomley --- drivers/target/target_core_device.c | 1 + drivers/target/target_core_fabric_lib.c | 1 + drivers/target/target_core_pscsi.c | 3 +++ drivers/target/target_core_rd.h | 2 -- drivers/target/target_core_transport.c | 4 +--- 5 files changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/target') diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 9e182bd245f..3fb8e32506e 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -589,6 +589,7 @@ static void core_export_port( * Called with struct se_device->se_port_lock spinlock held. */ static void core_release_port(struct se_device *dev, struct se_port *port) + __releases(&dev->se_port_lock) __acquires(&dev->se_port_lock) { /* * Wait for any port reference for PR ALL_TG_PT=1 operation diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c index a3c695adabe..d57ad672677 100644 --- a/drivers/target/target_core_fabric_lib.c +++ b/drivers/target/target_core_fabric_lib.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 51fd309388f..7ff6a35f26a 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -441,6 +441,7 @@ static struct se_device *pscsi_create_type_disk( struct pscsi_dev_virt *pdv, struct se_subsystem_dev *se_dev, struct se_hba *hba) + __releases(sh->host_lock) { struct se_device *dev; struct pscsi_hba_virt *phv = (struct pscsi_hba_virt *)pdv->pdv_se_hba->hba_ptr; @@ -488,6 +489,7 @@ static struct se_device *pscsi_create_type_rom( struct pscsi_dev_virt *pdv, struct se_subsystem_dev *se_dev, struct se_hba *hba) + __releases(sh->host_lock) { struct se_device *dev; struct pscsi_hba_virt *phv = (struct pscsi_hba_virt *)pdv->pdv_se_hba->hba_ptr; @@ -522,6 +524,7 @@ static struct se_device *pscsi_create_type_other( struct pscsi_dev_virt *pdv, struct se_subsystem_dev *se_dev, struct se_hba *hba) + __releases(sh->host_lock) { struct se_device *dev; struct pscsi_hba_virt *phv = (struct pscsi_hba_virt *)pdv->pdv_se_hba->hba_ptr; diff --git a/drivers/target/target_core_rd.h b/drivers/target/target_core_rd.h index 13badfbaf9c..3ea19e29d8e 100644 --- a/drivers/target/target_core_rd.h +++ b/drivers/target/target_core_rd.h @@ -14,8 +14,6 @@ #define RD_BLOCKSIZE 512 #define RD_MAX_SECTORS 1024 -extern struct kmem_cache *se_mem_cache; - /* Used in target_core_init_configfs() for virtual LUN 0 access */ int __init rd_module_init(void); void rd_module_exit(void); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index ff9ace01e27..80df4056f9f 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -227,8 +227,6 @@ static void transport_remove_cmd_from_queue(struct se_cmd *cmd, static int transport_set_sense_codes(struct se_cmd *cmd, u8 asc, u8 ascq); static void transport_stop_all_task_timers(struct se_cmd *cmd); -int transport_emulate_control_cdb(struct se_task *task); - int init_se_global(void) { struct se_global *global; @@ -4395,7 +4393,7 @@ out: return -1; } -extern u32 transport_calc_sg_num( +u32 transport_calc_sg_num( struct se_task *task, struct se_mem *in_se_mem, u32 task_offset) -- cgit v1.2.3-18-g5258