[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 <error27@gmail.com> Signed-off-by: Fubo Chen <fubo.chen@gmail.com> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
这个提交包含在:
@@ -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
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include <target/target_core_base.h>
|
||||
#include <target/target_core_device.h>
|
||||
#include <target/target_core_transport.h>
|
||||
#include <target/target_core_fabric_lib.h>
|
||||
#include <target/target_core_fabric_ops.h>
|
||||
#include <target/target_core_configfs.h>
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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)
|
||||
|
在新工单中引用
屏蔽一个用户