PCI: remove uneccessary if() and assignment
PATCH 1/1 PCI: remove uneccessary if() and assignment
This second if is uneccesary, because, the first if is equals.
The assignment os return pci_revert_fw_address() to ret variable is uneccessary to. Then, the second if() was removed and the return function is the return of pci_revert_fw_address()
Signed-off-by Guilherme Giacomo Simoes <[email protected]>
--- drivers/pci/setup-res.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/pci/setup-res.c +1 -6
@@ -352,12 +352,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)*/ if (ret <0 ) {pci_info (dev,"%s %pR: can't assign; no space\n" , res_name, res); - ret =pci_revert_fw_address (res, dev, resno, size); - } - -if (ret <0 ) { -pci_info (dev,"%s %pR: failed to assign\n" , res_name, res); -return ret; +return pci_revert_fw_address (res, dev, resno, size); } res->flags &= ~IORESOURCE_UNSET ;
Signature · 1 line
2.46.0
Guilherme Giacomo Simoes <[email protected]> wrotes:
Quoted 29 lines
This second if is uneccesary, because, the first if is equals.
The assignment os returnpci_revert_fw_address()to ret variable is uneccessary to. Then, the secondif()was removed and the return function is the return ofpci_revert_fw_address()Signed-off-by Guilherme Giacomo Simoes <[email protected]>--- drivers/pci/setup-res.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/pci/setup-res.c +1
-7@@ -352,12 +352,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)*/ if (ret <0 ) {pci_info (dev,"%s %pR: can't assign; no space\n" , res_name, res); - ret =pci_revert_fw_address (res, dev, resno, size); - } - -if (ret <0 ) { -pci_info (dev,"%s %pR: failed to assign\n" , res_name, res); -return ret; +return pci_revert_fw_address (res, dev, resno, size); } res->flags &= ~IORESOURCE_UNSET ; --
Quoted 2 lines
2.46.0
Please disregard this patch.