diff mbox series

igb: Fix styling in enable/disable SR-IOV

Message ID Zw2mTeDYEkWnh36A@Fantasy-Ubuntu (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series igb: Fix styling in enable/disable SR-IOV | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 35 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 38 this patch: 38
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-10-15--06-00 (tests: 777)

Commit Message

Johnny Park Oct. 14, 2024, 11:16 p.m. UTC
This patch fixes the checks and warnings for igb_enable_sriov and
igb_disable_sriov function reported by checkpatch.pl

Signed-off-by: Johnny Park <pjohnny0508@gmail.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Jakub Kicinski Oct. 16, 2024, 12:46 a.m. UTC | #1
On Mon, 14 Oct 2024 17:16:29 -0600 Johnny Park wrote:
> This patch fixes the checks and warnings for igb_enable_sriov and
> igb_disable_sriov function reported by checkpatch.pl

Quoting documentation:

  Clean-up patches
  ~~~~~~~~~~~~~~~~
  
  Netdev discourages patches which perform simple clean-ups, which are not in
  the context of other work. For example:
  
  * Addressing ``checkpatch.pl`` warnings
  * Addressing :ref:`Local variable ordering<rcs>` issues
  * Conversions to device-managed APIs (``devm_`` helpers)
  
  This is because it is felt that the churn that such changes produce comes
  at a greater cost than the value of such clean-ups.
  
  Conversely, spelling and grammar fixes are not discouraged.
  
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#clean-up-patches
Johnny Park Oct. 16, 2024, 4:02 a.m. UTC | #2
On Tue, Oct 15, 2024 at 05:46:07PM -0700, Jakub Kicinski wrote:
> On Mon, 14 Oct 2024 17:16:29 -0600 Johnny Park wrote:
> > This patch fixes the checks and warnings for igb_enable_sriov and
> > igb_disable_sriov function reported by checkpatch.pl
> 
> Quoting documentation:
> 
>   Clean-up patches
>   ~~~~~~~~~~~~~~~~
>   
>   Netdev discourages patches which perform simple clean-ups, which are not in
>   the context of other work. For example:
>   
>   * Addressing ``checkpatch.pl`` warnings
>   * Addressing :ref:`Local variable ordering<rcs>` issues
>   * Conversions to device-managed APIs (``devm_`` helpers)
>   
>   This is because it is felt that the churn that such changes produce comes
>   at a greater cost than the value of such clean-ups.
>   
>   Conversely, spelling and grammar fixes are not discouraged.
>   
> See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#clean-up-patches
I see. Apologies for the inconvenience, I'm new to this area so I must have missed that portion of documentation.
Jacob Keller Oct. 16, 2024, 10:54 p.m. UTC | #3
On 10/15/2024 9:02 PM, Johnny Park wrote:
> On Tue, Oct 15, 2024 at 05:46:07PM -0700, Jakub Kicinski wrote:
>> On Mon, 14 Oct 2024 17:16:29 -0600 Johnny Park wrote:
>>> This patch fixes the checks and warnings for igb_enable_sriov and
>>> igb_disable_sriov function reported by checkpatch.pl
>>
>> Quoting documentation:
>>
>>   Clean-up patches
>>   ~~~~~~~~~~~~~~~~
>>   
>>   Netdev discourages patches which perform simple clean-ups, which are not in
>>   the context of other work. For example:
>>   
>>   * Addressing ``checkpatch.pl`` warnings
>>   * Addressing :ref:`Local variable ordering<rcs>` issues
>>   * Conversions to device-managed APIs (``devm_`` helpers)
>>   
>>   This is because it is felt that the churn that such changes produce comes
>>   at a greater cost than the value of such clean-ups.
>>   
>>   Conversely, spelling and grammar fixes are not discouraged.
>>   
>> See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#clean-up-patches
> I see. Apologies for the inconvenience, I'm new to this area so I must have missed that portion of documentation.

You likely missed this because its a recent addition to the docs by
commit aeb218d900e3 ("docs: netdev: document guidance on cleanup
patches") from a week ago.

The policy itself is older than this, but we've had a recent surge in
similar changes on a few drivers.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 1ef4cb871452..5a3b10b81848 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3703,10 +3703,10 @@  static int igb_disable_sriov(struct pci_dev *pdev, bool reinit)
 			dev_warn(&pdev->dev,
 				 "Cannot deallocate SR-IOV virtual functions while they are assigned - VFs will not be deallocated\n");
 			return -EPERM;
-		} else {
-			pci_disable_sriov(pdev);
-			msleep(500);
 		}
+
+		pci_disable_sriov(pdev);
+		msleep(500);
 		spin_lock_irqsave(&adapter->vfs_lock, flags);
 		kfree(adapter->vf_mac_list);
 		adapter->vf_mac_list = NULL;
@@ -3739,6 +3739,7 @@  static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs, bool reinit)
 		err = -EPERM;
 		goto out;
 	}
+
 	if (!num_vfs)
 		goto out;
 
@@ -3746,11 +3747,13 @@  static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs, bool reinit)
 		dev_info(&pdev->dev, "%d pre-allocated VFs found - override max_vfs setting of %d\n",
 			 old_vfs, max_vfs);
 		adapter->vfs_allocated_count = old_vfs;
-	} else
+	} else {
 		adapter->vfs_allocated_count = num_vfs;
+	}
 
 	adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
-				sizeof(struct vf_data_storage), GFP_KERNEL);
+				   sizeof(struct vf_data_storage),
+				   GFP_KERNEL);
 
 	/* if allocation failed then we do not support SR-IOV */
 	if (!adapter->vf_data) {