diff mbox series

[v2,2/2] net: mii: make mii_ethtool_gset() return void

Message ID 94ec6d98ab2d9a937da8fba8d7b99805f72809aa.1629296113.git.paskripkin@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [v2,1/2] net: pch_gbe: remove mii_ethtool_gset() error handling | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 918 this patch: 918
netdev/kdoc success Errors and warnings before: 15 this patch: 15
netdev/verify_fixes success Link
netdev/checkpatch warning CHECK: extern prototypes should be avoided in .h files
netdev/build_allmodconfig_warn success Errors and warnings before: 785 this patch: 785
netdev/header_inline success Link

Commit Message

Pavel Skripkin Aug. 18, 2021, 2:18 p.m. UTC
mii_ethtool_gset() does not return any errors. Since there is no users
of this function that rely on its return value, it can be
made void.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---

Changes in v2:
	inverted the order of patches

---
 drivers/net/mii.c   | 5 +----
 include/linux/mii.h | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Andy Shevchenko Aug. 18, 2021, 2:59 p.m. UTC | #1
On Wed, Aug 18, 2021 at 05:18:55PM +0300, Pavel Skripkin wrote:
> mii_ethtool_gset() does not return any errors. Since there is no users

there are

> of this function that rely on its return value, it can be
> made void.
> 
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> ---
> 
> Changes in v2:
> 	inverted the order of patches
> 
> ---
>  drivers/net/mii.c   | 5 +----
>  include/linux/mii.h | 2 +-
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/mii.c b/drivers/net/mii.c
> index 779c3a96dba7..3e7823267a3b 100644
> --- a/drivers/net/mii.c
> +++ b/drivers/net/mii.c
> @@ -50,9 +50,8 @@ static u32 mii_get_an(struct mii_if_info *mii, u16 addr)
>   * The @ecmd parameter is expected to have been cleared before calling
>   * mii_ethtool_gset().

>   *

This line should gone as well.

> - * Returns 0 for success, negative on error.
>   */
> -int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
> +void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
>  {
>  	struct net_device *dev = mii->dev;
>  	u16 bmcr, bmsr, ctrl1000 = 0, stat1000 = 0;
> @@ -131,8 +130,6 @@ int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
>  	mii->full_duplex = ecmd->duplex;
>  
>  	/* ignore maxtxpkt, maxrxpkt for now */
> -
> -	return 0;
>  }
>  
>  /**
> diff --git a/include/linux/mii.h b/include/linux/mii.h
> index 219b93cad1dd..12ea29e04293 100644
> --- a/include/linux/mii.h
> +++ b/include/linux/mii.h
> @@ -32,7 +32,7 @@ struct mii_if_info {
>  
>  extern int mii_link_ok (struct mii_if_info *mii);
>  extern int mii_nway_restart (struct mii_if_info *mii);
> -extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
> +extern void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
>  extern void mii_ethtool_get_link_ksettings(
>  	struct mii_if_info *mii, struct ethtool_link_ksettings *cmd);
>  extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
> -- 
> 2.32.0
>
diff mbox series

Patch

diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index 779c3a96dba7..3e7823267a3b 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -50,9 +50,8 @@  static u32 mii_get_an(struct mii_if_info *mii, u16 addr)
  * The @ecmd parameter is expected to have been cleared before calling
  * mii_ethtool_gset().
  *
- * Returns 0 for success, negative on error.
  */
-int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
+void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
 {
 	struct net_device *dev = mii->dev;
 	u16 bmcr, bmsr, ctrl1000 = 0, stat1000 = 0;
@@ -131,8 +130,6 @@  int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
 	mii->full_duplex = ecmd->duplex;
 
 	/* ignore maxtxpkt, maxrxpkt for now */
-
-	return 0;
 }
 
 /**
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 219b93cad1dd..12ea29e04293 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -32,7 +32,7 @@  struct mii_if_info {
 
 extern int mii_link_ok (struct mii_if_info *mii);
 extern int mii_nway_restart (struct mii_if_info *mii);
-extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
+extern void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
 extern void mii_ethtool_get_link_ksettings(
 	struct mii_if_info *mii, struct ethtool_link_ksettings *cmd);
 extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);