Skip to content

Commit f28a0a9

Browse files
avasquez01James Bottomley
authored andcommitted
[SCSI] qla2xxx: Check for a match before attempting to set FCP-priority information.
Modifying qla24xx_get_fcp_prio() to return a 'found' status allows the driver to short circuit the 'set FCP-priority' call and reduce the amount of noise generated in the messages file: scsi(5): Unable to activate fcp priority, ret=0x102 scsi(5): Unable to activate fcp priority, ret=0x102 Also make qla24xx_get_fcp_prio() static. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 80d7944 commit f28a0a9

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎drivers/scsi/qla2xxx/qla_init.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5508,26 +5508,26 @@ qla81xx_update_fw_options(scsi_qla_host_t *vha)
55085508
*
55095509
* Return:
55105510
* non-zero (if found)
5511-
* 0 (if not found)
5511+
* -1 (if not found)
55125512
*
55135513
* Context:
55145514
* Kernel context
55155515
*/
5516-
uint8_t
5516+
static int
55175517
qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
55185518
{
55195519
int i, entries;
55205520
uint8_t pid_match, wwn_match;
5521-
uint8_t priority;
5521+
int priority;
55225522
uint32_t pid1, pid2;
55235523
uint64_t wwn1, wwn2;
55245524
struct qla_fcp_prio_entry *pri_entry;
55255525
struct qla_hw_data *ha = vha->hw;
55265526

55275527
if (!ha->fcp_prio_cfg || !ha->flags.fcp_prio_enabled)
5528-
return 0;
5528+
return -1;
55295529

5530-
priority = 0;
5530+
priority = -1;
55315531
entries = ha->fcp_prio_cfg->num_entries;
55325532
pri_entry = &ha->fcp_prio_cfg->entry[0];
55335533

@@ -5610,14 +5610,17 @@ int
56105610
qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
56115611
{
56125612
int ret;
5613-
uint8_t priority;
5613+
int priority;
56145614
uint16_t mb[5];
56155615

56165616
if (fcport->port_type != FCT_TARGET ||
56175617
fcport->loop_id == FC_NO_LOOP_ID)
56185618
return QLA_FUNCTION_FAILED;
56195619

56205620
priority = qla24xx_get_fcp_prio(vha, fcport);
5621+
if (priority < 0)
5622+
return QLA_FUNCTION_FAILED;
5623+
56215624
ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb);
56225625
if (ret == QLA_SUCCESS)
56235626
fcport->fcp_prio = priority;

0 commit comments

Comments
 (0)