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

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>

authored by

Gustavo A. R. Silva and committed by
Martin K. Petersen
db269932 60747936

+1 -6
+1 -6
drivers/scsi/pmcraid.c
··· 1595 1595 if (pinstance->ccn.hcam->notification_type == 1596 1596 NOTIFICATION_TYPE_ENTRY_CHANGED && 1597 1597 cfg_entry->resource_type == RES_TYPE_VSET) { 1598 - 1599 - if (fw_version <= PMCRAID_FW_VERSION_1) 1600 - hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0; 1601 - else 1602 - hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0; 1603 - 1598 + hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0; 1604 1599 } else if (!pmcraid_expose_resource(fw_version, cfg_entry)) { 1605 1600 goto out_notify_apps; 1606 1601 }