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

Configure Feed

Select the types of activity you want to include in your feed.

net: lan743x: Remove extranous gotos

The gotos for cleanup aren't required, the function
might as well just return the actual error code.

Signed-off-by: Moritz Fischer <moritzf@google.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Moritz Fischer and committed by
David S. Miller
0f0f5868 a92fb5c0

+5 -15
+5 -15
drivers/net/ethernet/microchip/lan743x_main.c
··· 160 160 { 161 161 struct lan743x_csr *csr = &adapter->csr; 162 162 resource_size_t bar_start, bar_length; 163 - int result; 164 163 165 164 bar_start = pci_resource_start(adapter->pdev, 0); 166 165 bar_length = pci_resource_len(adapter->pdev, 0); 167 166 csr->csr_address = devm_ioremap(&adapter->pdev->dev, 168 167 bar_start, bar_length); 169 - if (!csr->csr_address) { 170 - result = -ENOMEM; 171 - goto clean_up; 172 - } 168 + if (!csr->csr_address) 169 + return -ENOMEM; 173 170 174 171 csr->id_rev = lan743x_csr_read(adapter, ID_REV); 175 172 csr->fpga_rev = lan743x_csr_read(adapter, FPGA_REV); ··· 174 177 "ID_REV = 0x%08X, FPGA_REV = %d.%d\n", 175 178 csr->id_rev, FPGA_REV_GET_MAJOR_(csr->fpga_rev), 176 179 FPGA_REV_GET_MINOR_(csr->fpga_rev)); 177 - if (!ID_REV_IS_VALID_CHIP_ID_(csr->id_rev)) { 178 - result = -ENODEV; 179 - goto clean_up; 180 - } 180 + if (!ID_REV_IS_VALID_CHIP_ID_(csr->id_rev)) 181 + return -ENODEV; 181 182 182 183 csr->flags = LAN743X_CSR_FLAG_SUPPORTS_INTR_AUTO_SET_CLR; 183 184 switch (csr->id_rev & ID_REV_CHIP_REV_MASK_) { ··· 188 193 break; 189 194 } 190 195 191 - result = lan743x_csr_light_reset(adapter); 192 - if (result) 193 - goto clean_up; 194 - return 0; 195 - clean_up: 196 - return result; 196 + return lan743x_csr_light_reset(adapter); 197 197 } 198 198 199 199 static void lan743x_intr_software_isr(struct lan743x_adapter *adapter)