iavf: remove redundant ret variable
authorMinghao Chi <chi.minghao@zte.com.cn>
Mon, 10 Jan 2022 10:46:56 +0000 (10:46 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 1 Mar 2022 16:50:11 +0000 (08:50 -0800)
Return value directly instead of taking this in another redundant
variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c

index f339b78..25796d0 100644 (file)
@@ -1523,7 +1523,6 @@ static void iavf_fill_rss_lut(struct iavf_adapter *adapter)
 static int iavf_init_rss(struct iavf_adapter *adapter)
 {
        struct iavf_hw *hw = &adapter->hw;
-       int ret;
 
        if (!RSS_PF(adapter)) {
                /* Enable PCTYPES for RSS, TCP/UDP with IPv4/IPv6 */
@@ -1539,9 +1538,8 @@ static int iavf_init_rss(struct iavf_adapter *adapter)
 
        iavf_fill_rss_lut(adapter);
        netdev_rss_key_fill((void *)adapter->rss_key, adapter->rss_key_size);
-       ret = iavf_config_rss(adapter);
 
-       return ret;
+       return iavf_config_rss(adapter);
 }
 
 /**
@@ -4745,8 +4743,6 @@ static struct pci_driver iavf_driver = {
  **/
 static int __init iavf_init_module(void)
 {
-       int ret;
-
        pr_info("iavf: %s\n", iavf_driver_string);
 
        pr_info("%s\n", iavf_copyright);
@@ -4757,8 +4753,7 @@ static int __init iavf_init_module(void)
                pr_err("%s: Failed to create workqueue\n", iavf_driver_name);
                return -ENOMEM;
        }
-       ret = pci_register_driver(&iavf_driver);
-       return ret;
+       return pci_register_driver(&iavf_driver);
 }
 
 module_init(iavf_init_module);