diff mbox series

net: mscc: ocelot: remove incompatible prototypes

Message ID 20230417205531.1880657-1-arnd@kernel.org (mailing list archive)
State Accepted
Commit 33d74c8ff5ced854bc0ab6f94a778464dd2b905b
Delegated to: Netdev Maintainers
Headers show
Series net: mscc: ocelot: remove incompatible prototypes | 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/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 10 of 10 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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Arnd Bergmann April 17, 2023, 8:55 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The types for the register argument changed recently, but there are
still incompatible prototypes that got left behind, and gcc-13 warns
about these:

In file included from drivers/net/ethernet/mscc/ocelot.c:13:
drivers/net/ethernet/mscc/ocelot.h:97:5: error: conflicting types for 'ocelot_port_readl' due to enum/integer mismatch; have 'u32(struct ocelot_port *, u32)' {aka 'unsigned int(struct ocelot_port *, unsigned int)'} [-Werror=enum-int-mismatch]
   97 | u32 ocelot_port_readl(struct ocelot_port *port, u32 reg);
      |     ^~~~~~~~~~~~~~~~~

Just remove the two prototypes, and rely on the copy in the global
header.

Fixes: 9ecd05794b8d ("net: mscc: ocelot: strengthen type of "u32 reg" in I/O accessors")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/mscc/ocelot.h | 3 ---
 1 file changed, 3 deletions(-)

Comments

Vladimir Oltean April 18, 2023, 4:17 p.m. UTC | #1
On Mon, Apr 17, 2023 at 10:55:25PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The types for the register argument changed recently, but there are
> still incompatible prototypes that got left behind, and gcc-13 warns
> about these:
> 
> In file included from drivers/net/ethernet/mscc/ocelot.c:13:
> drivers/net/ethernet/mscc/ocelot.h:97:5: error: conflicting types for 'ocelot_port_readl' due to enum/integer mismatch; have 'u32(struct ocelot_port *, u32)' {aka 'unsigned int(struct ocelot_port *, unsigned int)'} [-Werror=enum-int-mismatch]
>    97 | u32 ocelot_port_readl(struct ocelot_port *port, u32 reg);
>       |     ^~~~~~~~~~~~~~~~~
> 
> Just remove the two prototypes, and rely on the copy in the global
> header.
> 
> Fixes: 9ecd05794b8d ("net: mscc: ocelot: strengthen type of "u32 reg" in I/O accessors")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Interesting, I didn't even realize we had these duplicated there. Thanks.
FWIW, they were duplicated in commit 5e2563650232 ("net: mscc: ocelot:
publish structure definitions to include/soc/mscc/ocelot.h") and haven't
bothered anybody since then.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
patchwork-bot+netdevbpf@kernel.org April 19, 2023, 4:50 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 17 Apr 2023 22:55:25 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The types for the register argument changed recently, but there are
> still incompatible prototypes that got left behind, and gcc-13 warns
> about these:
> 
> In file included from drivers/net/ethernet/mscc/ocelot.c:13:
> drivers/net/ethernet/mscc/ocelot.h:97:5: error: conflicting types for 'ocelot_port_readl' due to enum/integer mismatch; have 'u32(struct ocelot_port *, u32)' {aka 'unsigned int(struct ocelot_port *, unsigned int)'} [-Werror=enum-int-mismatch]
>    97 | u32 ocelot_port_readl(struct ocelot_port *port, u32 reg);
>       |     ^~~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - net: mscc: ocelot: remove incompatible prototypes
    https://git.kernel.org/netdev/net-next/c/33d74c8ff5ce

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mscc/ocelot.h b/drivers/net/ethernet/mscc/ocelot.h
index d920ca930690..ed024d6504c5 100644
--- a/drivers/net/ethernet/mscc/ocelot.h
+++ b/drivers/net/ethernet/mscc/ocelot.h
@@ -94,9 +94,6 @@  int ocelot_mact_forget(struct ocelot *ocelot,
 struct net_device *ocelot_port_to_netdev(struct ocelot *ocelot, int port);
 int ocelot_netdev_to_port(struct net_device *dev);
 
-u32 ocelot_port_readl(struct ocelot_port *port, u32 reg);
-void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg);
-
 int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target,
 		      struct device_node *portnp);
 void ocelot_release_port(struct ocelot_port *ocelot_port);