rtase: Refine the if statement
Subsystems (3)
Justin Lai
maintainerPATCH 1/1 rtase: Refine the if statement
Refine the if statement to improve readability.
--- drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/realtek/rtase/rtase_main.c +6 -6
@@ -2018,7 +2018,7 @@ static int rtase_init_board(struct pci_dev *pdev, struct net_device **dev_out,SET_NETDEV_DEV (dev, &pdev->dev); ret =pci_enable_device (pdev); -if (ret <0 ) +if (ret) goto err_out_free_dev;/* make sure PCI base addr 1 is MMIO */
@@ -2034,7 +2034,7 @@ static int rtase_init_board(struct pci_dev *pdev, struct net_device **dev_out, } ret =pci_request_regions (pdev,KBUILD_MODNAME ); -if (ret <0 ) +if (ret) goto err_out_disable; ret =dma_set_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (64 ));
@@ -2110,7 +2110,7 @@ static int rtase_init_one(struct pci_dev *pdev,dev_dbg (&pdev->dev,"Automotive Switch Ethernet driver loaded\n" ); ret =rtase_init_board (pdev, &dev, &ioaddr); -if (ret !=0 ) +if (ret)return ret; tp =netdev_priv (dev);
@@ -2120,7 +2120,7 @@ static int rtase_init_one(struct pci_dev *pdev,/* identify chip attached to board */ ret =rtase_check_mac_version_valid (tp); -if (ret !=0 ) { +if (ret) {dev_err (&pdev->dev,"unknown chip version: 0x%08x, contact rtase maintainers (see MAINTAINERS file)\n" , tp->hw_ver);
@@ -2131,7 +2131,7 @@ static int rtase_init_one(struct pci_dev *pdev,rtase_init_hardware (tp); ret =rtase_alloc_interrupt (pdev, tp); -if (ret <0 ) { +if (ret) {dev_err (&pdev->dev,"unable to alloc MSIX/MSI\n" ); goto err_out_del_napi; }
@@ -2176,7 +2176,7 @@ static int rtase_init_one(struct pci_dev *pdev,netif_carrier_off (dev); ret =register_netdev (dev); -if (ret !=0 ) +if (ret) goto err_out_free_dma;netdev_dbg (dev,"%pM, IRQ %d\n" , dev->dev_addr, dev->irq);
Signature · 1 line
2.34.1
Quoted 7 lines · Justin Lai
Refine the if statement to improve readability.
Signed-off-by Justin Lai <[email protected]>--- drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
[...]
I am not sure if it is worth to change. However, looks correct:
Quoted 2 lines
Signature · 1 line
2.34.1
Jakub Kicinski
maintainerQuoted 1 line · On Fri, 6 Dec 2024 11:44:58 +0100 Michal Swiatkowski wrote:
I am not sure if it is worth to change.
True, tho, FWIW, if it's the maintainer of the codebase sending the change it's generally fine. Our "no pointless churn" rule is primarily for randoes.
Quoted 6 lines · Jakub Kicinski
Quoted 1 line · On Fri, 6 Dec 2024 11:44:58 +0100 Michal Swiatkowski wrote:
I am not sure if it is worth to change.
True, tho, FWIW, if it's the maintainer of the codebase sending the change it's generally fine. Our "no pointless churn" rule is primarily for randoes.
Sure, thanks for letting me know.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Fri, 6 Dec 2024 16:48:51 +0800 you wrote:
Refine the if statement to improve readability.
Signed-off-by Justin Lai <[email protected]>--- drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Here is the summary with links:
- [net-next] rtase: Refine the if statement
https://git.kernel.org/netdev/net-next/c/7ea2745766d7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html