From: Sean Anderson <sean.anderson@seco.com>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: Camelia Groza <camelia.groza@nxp.com>,
Madalin Bucur <madalin.bucur@nxp.com>,
linux-kernel@vger.kernel.org (open list),
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org,
Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH net-next v5 08/14] net: fman: Specify type of mac_dev for exception_cb
Date: Fri, 2 Sep 2022 17:57:30 -0400 [thread overview]
Message-ID: <20220902215737.981341-9-sean.anderson@seco.com> (raw)
In-Reply-To: <20220902215737.981341-1-sean.anderson@seco.com>
Instead of using a void pointer for mac_dev, specify its type
explicitly.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
---
Changes in v5:
- Reduce line length of tgec_config
Changes in v2:
- New
drivers/net/ethernet/freescale/fman/fman_dtsec.c | 2 +-
drivers/net/ethernet/freescale/fman/fman_mac.h | 5 +++--
drivers/net/ethernet/freescale/fman/fman_memac.c | 2 +-
drivers/net/ethernet/freescale/fman/fman_tgec.c | 5 +++--
drivers/net/ethernet/freescale/fman/mac.c | 5 ++---
5 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
index 09ad1117005a..7acd57424034 100644
--- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c
+++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
@@ -301,7 +301,7 @@ struct fman_mac {
/* Ethernet physical interface */
phy_interface_t phy_if;
u16 max_speed;
- void *dev_id; /* device cookie used by the exception cbs */
+ struct mac_device *dev_id; /* device cookie used by the exception cbs */
fman_mac_exception_cb *exception_cb;
fman_mac_exception_cb *event_cb;
/* Number of individual addresses in registers for this station */
diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h
index 730aae7fed13..65887a3160d7 100644
--- a/drivers/net/ethernet/freescale/fman/fman_mac.h
+++ b/drivers/net/ethernet/freescale/fman/fman_mac.h
@@ -41,6 +41,7 @@
#include <linux/if_ether.h>
struct fman_mac;
+struct mac_device;
/* Ethernet Address */
typedef u8 enet_addr_t[ETH_ALEN];
@@ -158,8 +159,8 @@ struct eth_hash_entry {
struct list_head node;
};
-typedef void (fman_mac_exception_cb)(void *dev_id,
- enum fman_mac_exceptions exceptions);
+typedef void (fman_mac_exception_cb)(struct mac_device *dev_id,
+ enum fman_mac_exceptions exceptions);
/* FMan MAC config input */
struct fman_mac_params {
diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
index af2e67a250de..0e0d9415b93e 100644
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -311,7 +311,7 @@ struct fman_mac {
/* Ethernet physical interface */
phy_interface_t phy_if;
u16 max_speed;
- void *dev_id; /* device cookie used by the exception cbs */
+ struct mac_device *dev_id; /* device cookie used by the exception cbs */
fman_mac_exception_cb *exception_cb;
fman_mac_exception_cb *event_cb;
/* Pointer to driver's global address hash table */
diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c
index 2642a4c27292..0a66ae58c026 100644
--- a/drivers/net/ethernet/freescale/fman/fman_tgec.c
+++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c
@@ -180,7 +180,7 @@ struct fman_mac {
/* MAC address of device; */
u64 addr;
u16 max_speed;
- void *dev_id; /* device cookie used by the exception cbs */
+ struct mac_device *dev_id; /* device cookie used by the exception cbs */
fman_mac_exception_cb *exception_cb;
fman_mac_exception_cb *event_cb;
/* pointer to driver's global address hash table */
@@ -728,7 +728,8 @@ static int tgec_free(struct fman_mac *tgec)
return 0;
}
-static struct fman_mac *tgec_config(struct mac_device *mac_dev, struct fman_mac_params *params)
+static struct fman_mac *tgec_config(struct mac_device *mac_dev,
+ struct fman_mac_params *params)
{
struct fman_mac *tgec;
struct tgec_cfg *cfg;
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 0f9e3e9e60c6..66a3742a862b 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -41,10 +41,9 @@ struct mac_address {
struct list_head list;
};
-static void mac_exception(void *handle, enum fman_mac_exceptions ex)
+static void mac_exception(struct mac_device *mac_dev,
+ enum fman_mac_exceptions ex)
{
- struct mac_device *mac_dev = handle;
-
if (ex == FM_MAC_EX_10G_RX_FIFO_OVFL) {
/* don't flag RX FIFO after the first */
mac_dev->set_exception(mac_dev->fman_mac,
--
2.35.1.1320.gc452695387.dirty
next prev parent reply other threads:[~2022-09-02 21:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 21:57 [PATCH net-next v5 00/14] net: dpaa: Cleanups in preparation for phylink conversion (part 2) Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 01/14] net: fman: Move initialization to mac-specific files Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 02/14] net: fman: Mark mac methods static Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 03/14] net: fman: Inline several functions into initialization Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 04/14] net: fman: Remove internal_phy_node from params Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 05/14] net: fman: Map the base address once Sean Anderson
2022-10-17 15:15 ` Geert Uytterhoeven
2022-10-17 15:34 ` Sean Anderson
2022-10-17 15:49 ` Geert Uytterhoeven
2022-09-02 21:57 ` [PATCH net-next v5 06/14] net: fman: Pass params directly to mac init Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 07/14] net: fman: Use mac_dev for some params Sean Anderson
2022-09-02 21:57 ` Sean Anderson [this message]
2022-09-02 21:57 ` [PATCH net-next v5 09/14] net: fman: Clean up error handling Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 10/14] net: fman: Change return type of disable to void Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 11/14] net: dpaa: Use mac_dev variable in dpaa_netdev_init Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 12/14] soc: fsl: qbman: Add helper for sanity checking cgr ops Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 13/14] soc: fsl: qbman: Add CGR update function Sean Anderson
2022-09-02 21:57 ` [PATCH net-next v5 14/14] net: dpaa: Adjust queue depth on rate change Sean Anderson
2022-09-05 13:40 ` [PATCH net-next v5 00/14] net: dpaa: Cleanups in preparation for phylink conversion (part 2) patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220902215737.981341-9-sean.anderson@seco.com \
--to=sean.anderson@seco.com \
--cc=camelia.groza@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=madalin.bucur@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®