diff mbox series

[net-next,6/8] net: mscc: ocelot: strengthen type of "u32 reg" and "u32 base" in ocelot_stats.c

Message ID 20230412124737.2243527-7-vladimir.oltean@nxp.com (mailing list archive)
State Accepted
Commit eae0b9d15ba6050852180449b932996bc3add48e
Delegated to: Netdev Maintainers
Headers show
Series Ocelot/Felix driver cleanup | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
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: 18 this patch: 18
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
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: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Vladimir Oltean April 12, 2023, 12:47 p.m. UTC
Use the specific enum ocelot_reg to make it clear that the region
registers are encoded and not plain addresses.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot_stats.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Keller, Jacob E April 12, 2023, 9:19 p.m. UTC | #1
On 4/12/2023 5:47 AM, Vladimir Oltean wrote:
> Use the specific enum ocelot_reg to make it clear that the region
> registers are encoded and not plain addresses.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  drivers/net/ethernet/mscc/ocelot_stats.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c
> index 99a14a942600..a381e326cb2b 100644
> --- a/drivers/net/ethernet/mscc/ocelot_stats.c
> +++ b/drivers/net/ethernet/mscc/ocelot_stats.c
> @@ -145,7 +145,7 @@ enum ocelot_stat {
>  };
>  
>  struct ocelot_stat_layout {
> -	u32 reg;
> +	enum ocelot_reg reg;
>  	char name[ETH_GSTRING_LEN];
>  };
>  
> @@ -257,7 +257,7 @@ struct ocelot_stat_layout {
>  
>  struct ocelot_stats_region {
>  	struct list_head node;
> -	u32 base;
> +	enum ocelot_reg base;
>  	enum ocelot_stat first_stat;
>  	int count;
>  	u32 *buf;
> @@ -889,7 +889,7 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot)
>  {
>  	struct ocelot_stats_region *region = NULL;
>  	const struct ocelot_stat_layout *layout;
> -	unsigned int last = 0;
> +	enum ocelot_reg last = 0;
>  	int i;
>  
>  	INIT_LIST_HEAD(&ocelot->stats_regions);

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c
index 99a14a942600..a381e326cb2b 100644
--- a/drivers/net/ethernet/mscc/ocelot_stats.c
+++ b/drivers/net/ethernet/mscc/ocelot_stats.c
@@ -145,7 +145,7 @@  enum ocelot_stat {
 };
 
 struct ocelot_stat_layout {
-	u32 reg;
+	enum ocelot_reg reg;
 	char name[ETH_GSTRING_LEN];
 };
 
@@ -257,7 +257,7 @@  struct ocelot_stat_layout {
 
 struct ocelot_stats_region {
 	struct list_head node;
-	u32 base;
+	enum ocelot_reg base;
 	enum ocelot_stat first_stat;
 	int count;
 	u32 *buf;
@@ -889,7 +889,7 @@  static int ocelot_prepare_stats_regions(struct ocelot *ocelot)
 {
 	struct ocelot_stats_region *region = NULL;
 	const struct ocelot_stat_layout *layout;
-	unsigned int last = 0;
+	enum ocelot_reg last = 0;
 	int i;
 
 	INIT_LIST_HEAD(&ocelot->stats_regions);