Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 65a15d6560df ("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>

authored by

Tom Rix and committed by
Martin K. Petersen
392e4daa 81221ab7

-14
-14
drivers/scsi/ipr.c
··· 1101 1101 struct ipr_config_table_entry_wrapper *cfgtew) 1102 1102 { 1103 1103 int found = 0; 1104 - unsigned int proto; 1105 1104 struct ipr_ioa_cfg *ioa_cfg = res->ioa_cfg; 1106 1105 struct ipr_resource_entry *gscsi_res = NULL; 1107 1106 ··· 1113 1114 res->sdev = NULL; 1114 1115 1115 1116 if (ioa_cfg->sis64) { 1116 - proto = cfgtew->u.cfgte64->proto; 1117 1117 res->flags = be16_to_cpu(cfgtew->u.cfgte64->flags); 1118 1118 res->res_flags = be16_to_cpu(cfgtew->u.cfgte64->res_flags); 1119 1119 res->qmodel = IPR_QUEUEING_MODEL64(res); ··· 1158 1160 set_bit(res->target, ioa_cfg->target_ids); 1159 1161 } 1160 1162 } else { 1161 - proto = cfgtew->u.cfgte->proto; 1162 1163 res->qmodel = IPR_QUEUEING_MODEL(res); 1163 1164 res->flags = cfgtew->u.cfgte->flags; 1164 1165 if (res->flags & IPR_IS_IOA_RESOURCE) ··· 1255 1258 struct ipr_config_table_entry_wrapper *cfgtew) 1256 1259 { 1257 1260 char buffer[IPR_MAX_RES_PATH_LENGTH]; 1258 - unsigned int proto; 1259 1261 int new_path = 0; 1260 1262 1261 1263 if (res->ioa_cfg->sis64) { ··· 1266 1270 sizeof(struct ipr_std_inq_data)); 1267 1271 1268 1272 res->qmodel = IPR_QUEUEING_MODEL64(res); 1269 - proto = cfgtew->u.cfgte64->proto; 1270 1273 res->res_handle = cfgtew->u.cfgte64->res_handle; 1271 1274 res->dev_id = cfgtew->u.cfgte64->dev_id; 1272 1275 ··· 1294 1299 sizeof(struct ipr_std_inq_data)); 1295 1300 1296 1301 res->qmodel = IPR_QUEUEING_MODEL(res); 1297 - proto = cfgtew->u.cfgte->proto; 1298 1302 res->res_handle = cfgtew->u.cfgte->res_handle; 1299 1303 } 1300 1304 } ··· 4407 4413 **/ 4408 4414 static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth) 4409 4415 { 4410 - struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata; 4411 - struct ipr_resource_entry *res; 4412 - unsigned long lock_flags = 0; 4413 - 4414 - spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 4415 - res = (struct ipr_resource_entry *)sdev->hostdata; 4416 - spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4417 - 4418 4416 scsi_change_queue_depth(sdev, qdepth); 4419 4417 return sdev->queue_depth; 4420 4418 }