Skip to content

Commit 392e4da

Browse files
Tom Rixmartinkpetersen
authored andcommitted
scsi: ipr: Remove several unused variables
gcc with W=1 reports drivers/scsi/ipr.c: In function ‘ipr_init_res_entry’: drivers/scsi/ipr.c:1104:22: error: variable ‘proto’ set but not used [-Werror=unused-but-set-variable] 1104 | unsigned int proto; | ^~~~~ drivers/scsi/ipr.c: In function ‘ipr_update_res_entry’: drivers/scsi/ipr.c:1261:22: error: variable ‘proto’ set but not used [-Werror=unused-but-set-variable] 1261 | unsigned int proto; | ^~~~~ drivers/scsi/ipr.c: In function ‘ipr_change_queue_depth’: drivers/scsi/ipr.c:4417:36: error: variable ‘res’ set but not used [-Werror=unused-but-set-variable] 4417 | struct ipr_resource_entry *res; | ^~~ These variables are not used, so remove them. The lock around res is not needed so remove that. This makes ioa_cfg and lock_flags unneeded so remove them as well. Fixes: 65a15d6 ("scsi: ipr: Remove SATA support") Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20230420125035.3888188-1-trix@redhat.com Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 81221ab commit 392e4da

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

drivers/scsi/ipr.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,6 @@ static void ipr_init_res_entry(struct ipr_resource_entry *res,
11011101
struct ipr_config_table_entry_wrapper *cfgtew)
11021102
{
11031103
int found = 0;
1104-
unsigned int proto;
11051104
struct ipr_ioa_cfg *ioa_cfg = res->ioa_cfg;
11061105
struct ipr_resource_entry *gscsi_res = NULL;
11071106

@@ -1114,7 +1113,6 @@ static void ipr_init_res_entry(struct ipr_resource_entry *res,
11141113
res->sdev = NULL;
11151114

11161115
if (ioa_cfg->sis64) {
1117-
proto = cfgtew->u.cfgte64->proto;
11181116
res->flags = be16_to_cpu(cfgtew->u.cfgte64->flags);
11191117
res->res_flags = be16_to_cpu(cfgtew->u.cfgte64->res_flags);
11201118
res->qmodel = IPR_QUEUEING_MODEL64(res);
@@ -1160,7 +1158,6 @@ static void ipr_init_res_entry(struct ipr_resource_entry *res,
11601158
set_bit(res->target, ioa_cfg->target_ids);
11611159
}
11621160
} else {
1163-
proto = cfgtew->u.cfgte->proto;
11641161
res->qmodel = IPR_QUEUEING_MODEL(res);
11651162
res->flags = cfgtew->u.cfgte->flags;
11661163
if (res->flags & IPR_IS_IOA_RESOURCE)
@@ -1258,7 +1255,6 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
12581255
struct ipr_config_table_entry_wrapper *cfgtew)
12591256
{
12601257
char buffer[IPR_MAX_RES_PATH_LENGTH];
1261-
unsigned int proto;
12621258
int new_path = 0;
12631259

12641260
if (res->ioa_cfg->sis64) {
@@ -1270,7 +1266,6 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
12701266
sizeof(struct ipr_std_inq_data));
12711267

12721268
res->qmodel = IPR_QUEUEING_MODEL64(res);
1273-
proto = cfgtew->u.cfgte64->proto;
12741269
res->res_handle = cfgtew->u.cfgte64->res_handle;
12751270
res->dev_id = cfgtew->u.cfgte64->dev_id;
12761271

@@ -1299,7 +1294,6 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
12991294
sizeof(struct ipr_std_inq_data));
13001295

13011296
res->qmodel = IPR_QUEUEING_MODEL(res);
1302-
proto = cfgtew->u.cfgte->proto;
13031297
res->res_handle = cfgtew->u.cfgte->res_handle;
13041298
}
13051299
}
@@ -4413,14 +4407,6 @@ static int ipr_free_dump(struct ipr_ioa_cfg *ioa_cfg) { return 0; };
44134407
**/
44144408
static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth)
44154409
{
4416-
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata;
4417-
struct ipr_resource_entry *res;
4418-
unsigned long lock_flags = 0;
4419-
4420-
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
4421-
res = (struct ipr_resource_entry *)sdev->hostdata;
4422-
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4423-
44244410
scsi_change_queue_depth(sdev, qdepth);
44254411
return sdev->queue_depth;
44264412
}

0 commit comments

Comments
 (0)