scsi: pmcraid: fix duplicated code for different branches

Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Gustavo A. R. Silva 2017-08-12 20:26:32 -05:00 committed by Martin K. Petersen
parent 60747936bd
commit db269932b9
1 changed files with 1 additions and 6 deletions

View File

@ -1595,12 +1595,7 @@ static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance)
if (pinstance->ccn.hcam->notification_type == if (pinstance->ccn.hcam->notification_type ==
NOTIFICATION_TYPE_ENTRY_CHANGED && NOTIFICATION_TYPE_ENTRY_CHANGED &&
cfg_entry->resource_type == RES_TYPE_VSET) { cfg_entry->resource_type == RES_TYPE_VSET) {
hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0;
if (fw_version <= PMCRAID_FW_VERSION_1)
hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0;
else
hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0;
} else if (!pmcraid_expose_resource(fw_version, cfg_entry)) { } else if (!pmcraid_expose_resource(fw_version, cfg_entry)) {
goto out_notify_apps; goto out_notify_apps;
} }