* [PATCH 0/2] net: systemport: Minor IO macros changes @ 2024-10-15 17:24 Florian Fainelli 2024-10-15 17:24 ` [PATCH 1/2] net: systemport: Remove unused txchk accessors Florian Fainelli 2024-10-15 17:24 ` [PATCH 2/2] net: systemport: Move IO macros to header file Florian Fainelli 0 siblings, 2 replies; 6+ messages in thread From: Florian Fainelli @ 2024-10-15 17:24 UTC (permalink / raw) To: netdev Cc: Florian Fainelli, Broadcom internal kernel review list, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, open list, open list:CLANG/LLVM BUILD SUPPORT:, vladimir.oltean This patch series addresses the warning initially reported by Vladimir here: https://lore.kernel.org/all/20241014150139.927423-1-vladimir.oltean@nxp.com/ and follows on with proceeding with his suggestion the IO macros to the header file. Florian Fainelli (2): net: systemport: Remove unused txchk accessors net: systemport: Move IO macros to header file drivers/net/ethernet/broadcom/bcmsysport.c | 24 ---------------------- drivers/net/ethernet/broadcom/bcmsysport.h | 24 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) -- 2.43.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] net: systemport: Remove unused txchk accessors 2024-10-15 17:24 [PATCH 0/2] net: systemport: Minor IO macros changes Florian Fainelli @ 2024-10-15 17:24 ` Florian Fainelli 2024-10-15 17:29 ` Vladimir Oltean 2024-10-15 17:30 ` Florian Fainelli 2024-10-15 17:24 ` [PATCH 2/2] net: systemport: Move IO macros to header file Florian Fainelli 1 sibling, 2 replies; 6+ messages in thread From: Florian Fainelli @ 2024-10-15 17:24 UTC (permalink / raw) To: netdev Cc: Florian Fainelli, Vladimir Oltean, Broadcom internal kernel review list, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, open list, open list:CLANG/LLVM BUILD SUPPORT: Vladimir reported the following warning with clang-16 and W=1: warning: unused function 'txchk_readl' [-Wunused-function] BCM_SYSPORT_IO_MACRO(txchk, SYS_PORT_TXCHK_OFFSET); note: expanded from macro 'BCM_SYSPORT_IO_MACRO' warning: unused function 'txchk_writel' [-Wunused-function] note: expanded from macro 'BCM_SYSPORT_IO_MACRO' warning: unused function 'tbuf_readl' [-Wunused-function] BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); note: expanded from macro 'BCM_SYSPORT_IO_MACRO' warning: unused function 'tbuf_writel' [-Wunused-function] note: expanded from macro 'BCM_SYSPORT_IO_MACRO' The TXCHK block is not being accessed, remove the IO macros used to access this block. No functional impact. Reported-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> --- drivers/net/ethernet/broadcom/bcmsysport.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 9332a9390f0d..05c83cb3871c 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -46,7 +46,6 @@ BCM_SYSPORT_IO_MACRO(umac, SYS_PORT_UMAC_OFFSET); BCM_SYSPORT_IO_MACRO(gib, SYS_PORT_GIB_OFFSET); BCM_SYSPORT_IO_MACRO(tdma, SYS_PORT_TDMA_OFFSET); BCM_SYSPORT_IO_MACRO(rxchk, SYS_PORT_RXCHK_OFFSET); -BCM_SYSPORT_IO_MACRO(txchk, SYS_PORT_TXCHK_OFFSET); BCM_SYSPORT_IO_MACRO(rbuf, SYS_PORT_RBUF_OFFSET); BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); BCM_SYSPORT_IO_MACRO(topctrl, SYS_PORT_TOPCTRL_OFFSET); -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] net: systemport: Remove unused txchk accessors 2024-10-15 17:24 ` [PATCH 1/2] net: systemport: Remove unused txchk accessors Florian Fainelli @ 2024-10-15 17:29 ` Vladimir Oltean 2024-10-15 17:32 ` Florian Fainelli 2024-10-15 17:30 ` Florian Fainelli 1 sibling, 1 reply; 6+ messages in thread From: Vladimir Oltean @ 2024-10-15 17:29 UTC (permalink / raw) To: Florian Fainelli Cc: netdev, Broadcom internal kernel review list, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, open list, open list:CLANG/LLVM BUILD SUPPORT: On Tue, Oct 15, 2024 at 10:24:57AM -0700, Florian Fainelli wrote: > Vladimir reported the following warning with clang-16 and W=1: > > warning: unused function 'txchk_readl' [-Wunused-function] > BCM_SYSPORT_IO_MACRO(txchk, SYS_PORT_TXCHK_OFFSET); > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > warning: unused function 'txchk_writel' [-Wunused-function] > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > warning: unused function 'tbuf_readl' [-Wunused-function] > BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > warning: unused function 'tbuf_writel' [-Wunused-function] > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' I mean the warnings do say that the tbuf macros are unused too, yet you only remove txchk? I did ask yesterday if that should also be deleted, and with it the other unused transmit buffer macros? https://lore.kernel.org/netdev/20241014174056.sxcgikf4hhw2olp7@skbuf/ > > The TXCHK block is not being accessed, remove the IO macros used to > access this block. No functional impact. > > Reported-by: Vladimir Oltean <vladimir.oltean@nxp.com> > Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> > --- > drivers/net/ethernet/broadcom/bcmsysport.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c > index 9332a9390f0d..05c83cb3871c 100644 > --- a/drivers/net/ethernet/broadcom/bcmsysport.c > +++ b/drivers/net/ethernet/broadcom/bcmsysport.c > @@ -46,7 +46,6 @@ BCM_SYSPORT_IO_MACRO(umac, SYS_PORT_UMAC_OFFSET); > BCM_SYSPORT_IO_MACRO(gib, SYS_PORT_GIB_OFFSET); > BCM_SYSPORT_IO_MACRO(tdma, SYS_PORT_TDMA_OFFSET); > BCM_SYSPORT_IO_MACRO(rxchk, SYS_PORT_RXCHK_OFFSET); > -BCM_SYSPORT_IO_MACRO(txchk, SYS_PORT_TXCHK_OFFSET); > BCM_SYSPORT_IO_MACRO(rbuf, SYS_PORT_RBUF_OFFSET); > BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); > BCM_SYSPORT_IO_MACRO(topctrl, SYS_PORT_TOPCTRL_OFFSET); > -- > 2.43.0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] net: systemport: Remove unused txchk accessors 2024-10-15 17:29 ` Vladimir Oltean @ 2024-10-15 17:32 ` Florian Fainelli 0 siblings, 0 replies; 6+ messages in thread From: Florian Fainelli @ 2024-10-15 17:32 UTC (permalink / raw) To: Vladimir Oltean Cc: netdev, Broadcom internal kernel review list, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, open list, open list:CLANG/LLVM BUILD SUPPORT: On 10/15/24 10:29, Vladimir Oltean wrote: > On Tue, Oct 15, 2024 at 10:24:57AM -0700, Florian Fainelli wrote: >> Vladimir reported the following warning with clang-16 and W=1: >> >> warning: unused function 'txchk_readl' [-Wunused-function] >> BCM_SYSPORT_IO_MACRO(txchk, SYS_PORT_TXCHK_OFFSET); >> note: expanded from macro 'BCM_SYSPORT_IO_MACRO' >> >> warning: unused function 'txchk_writel' [-Wunused-function] >> note: expanded from macro 'BCM_SYSPORT_IO_MACRO' >> >> warning: unused function 'tbuf_readl' [-Wunused-function] >> BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); >> note: expanded from macro 'BCM_SYSPORT_IO_MACRO' >> >> warning: unused function 'tbuf_writel' [-Wunused-function] >> note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > I mean the warnings do say that the tbuf macros are unused too, yet you > only remove txchk? I did ask yesterday if that should also be deleted, > and with it the other unused transmit buffer macros? > https://lore.kernel.org/netdev/20241014174056.sxcgikf4hhw2olp7@skbuf/ See my response to my own posting. -- Florian ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] net: systemport: Remove unused txchk accessors 2024-10-15 17:24 ` [PATCH 1/2] net: systemport: Remove unused txchk accessors Florian Fainelli 2024-10-15 17:29 ` Vladimir Oltean @ 2024-10-15 17:30 ` Florian Fainelli 1 sibling, 0 replies; 6+ messages in thread From: Florian Fainelli @ 2024-10-15 17:30 UTC (permalink / raw) To: netdev Cc: Vladimir Oltean, Broadcom internal kernel review list, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, open list, open list:CLANG/LLVM BUILD SUPPORT: On 10/15/24 10:24, Florian Fainelli wrote: > Vladimir reported the following warning with clang-16 and W=1: > > warning: unused function 'txchk_readl' [-Wunused-function] > BCM_SYSPORT_IO_MACRO(txchk, SYS_PORT_TXCHK_OFFSET); > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > warning: unused function 'txchk_writel' [-Wunused-function] > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > warning: unused function 'tbuf_readl' [-Wunused-function] > BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > warning: unused function 'tbuf_writel' [-Wunused-function] > note: expanded from macro 'BCM_SYSPORT_IO_MACRO' > > The TXCHK block is not being accessed, remove the IO macros used to > access this block. No functional impact. > > Reported-by: Vladimir Oltean <vladimir.oltean@nxp.com> > Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Forgot to remove the tbuf accessor here as well, will post again in 24hrs. -- Florian ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] net: systemport: Move IO macros to header file 2024-10-15 17:24 [PATCH 0/2] net: systemport: Minor IO macros changes Florian Fainelli 2024-10-15 17:24 ` [PATCH 1/2] net: systemport: Remove unused txchk accessors Florian Fainelli @ 2024-10-15 17:24 ` Florian Fainelli 1 sibling, 0 replies; 6+ messages in thread From: Florian Fainelli @ 2024-10-15 17:24 UTC (permalink / raw) To: netdev Cc: Florian Fainelli, Vladimir Oltean, Broadcom internal kernel review list, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, open list, open list:CLANG/LLVM BUILD SUPPORT: Move the BCM_SYSPORT_IO_MACRO() definition and its use to bcmsysport.h where it is more appropriate and where static inline helpers are acceptable. While at it, make sure that the macro 'offset' argument does not trigger a checkpatch warning due to possible argument re-use. Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> --- drivers/net/ethernet/broadcom/bcmsysport.c | 23 --------------------- drivers/net/ethernet/broadcom/bcmsysport.h | 24 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 05c83cb3871c..fe641a4effb2 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -27,29 +27,6 @@ #include "bcmsysport.h" -/* I/O accessors register helpers */ -#define BCM_SYSPORT_IO_MACRO(name, offset) \ -static inline u32 name##_readl(struct bcm_sysport_priv *priv, u32 off) \ -{ \ - u32 reg = readl_relaxed(priv->base + offset + off); \ - return reg; \ -} \ -static inline void name##_writel(struct bcm_sysport_priv *priv, \ - u32 val, u32 off) \ -{ \ - writel_relaxed(val, priv->base + offset + off); \ -} \ - -BCM_SYSPORT_IO_MACRO(intrl2_0, SYS_PORT_INTRL2_0_OFFSET); -BCM_SYSPORT_IO_MACRO(intrl2_1, SYS_PORT_INTRL2_1_OFFSET); -BCM_SYSPORT_IO_MACRO(umac, SYS_PORT_UMAC_OFFSET); -BCM_SYSPORT_IO_MACRO(gib, SYS_PORT_GIB_OFFSET); -BCM_SYSPORT_IO_MACRO(tdma, SYS_PORT_TDMA_OFFSET); -BCM_SYSPORT_IO_MACRO(rxchk, SYS_PORT_RXCHK_OFFSET); -BCM_SYSPORT_IO_MACRO(rbuf, SYS_PORT_RBUF_OFFSET); -BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); -BCM_SYSPORT_IO_MACRO(topctrl, SYS_PORT_TOPCTRL_OFFSET); - /* On SYSTEMPORT Lite, any register after RDMA_STATUS has the exact * same layout, except it has been moved by 4 bytes up, *sigh* */ diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h index 335cf6631db5..2977e70806fc 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.h +++ b/drivers/net/ethernet/broadcom/bcmsysport.h @@ -773,4 +773,28 @@ struct bcm_sysport_priv { struct bcm_sysport_tx_ring *ring_map[DSA_MAX_PORTS * 8]; }; + +/* I/O accessors register helpers */ +#define BCM_SYSPORT_IO_MACRO(name, offset) \ +static inline u32 name##_readl(struct bcm_sysport_priv *priv, u32 off) \ +{ \ + u32 reg = readl_relaxed(priv->base + (offset) + off); \ + return reg; \ +} \ +static inline void name##_writel(struct bcm_sysport_priv *priv, \ + u32 val, u32 off) \ +{ \ + writel_relaxed(val, priv->base + (offset) + off); \ +} \ + +BCM_SYSPORT_IO_MACRO(intrl2_0, SYS_PORT_INTRL2_0_OFFSET); +BCM_SYSPORT_IO_MACRO(intrl2_1, SYS_PORT_INTRL2_1_OFFSET); +BCM_SYSPORT_IO_MACRO(umac, SYS_PORT_UMAC_OFFSET); +BCM_SYSPORT_IO_MACRO(gib, SYS_PORT_GIB_OFFSET); +BCM_SYSPORT_IO_MACRO(tdma, SYS_PORT_TDMA_OFFSET); +BCM_SYSPORT_IO_MACRO(rxchk, SYS_PORT_RXCHK_OFFSET); +BCM_SYSPORT_IO_MACRO(rbuf, SYS_PORT_RBUF_OFFSET); +BCM_SYSPORT_IO_MACRO(tbuf, SYS_PORT_TBUF_OFFSET); +BCM_SYSPORT_IO_MACRO(topctrl, SYS_PORT_TOPCTRL_OFFSET); + #endif /* __BCM_SYSPORT_H */ -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-15 17:32 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-15 17:24 [PATCH 0/2] net: systemport: Minor IO macros changes Florian Fainelli 2024-10-15 17:24 ` [PATCH 1/2] net: systemport: Remove unused txchk accessors Florian Fainelli 2024-10-15 17:29 ` Vladimir Oltean 2024-10-15 17:32 ` Florian Fainelli 2024-10-15 17:30 ` Florian Fainelli 2024-10-15 17:24 ` [PATCH 2/2] net: systemport: Move IO macros to header file Florian Fainelli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox