Skip to content

Commit

Permalink
staging: octeon: remove typedef declaration for cvmx_helper_link_info
Browse files Browse the repository at this point in the history
Remove declaration of union cvmx_helper_link_info as typedef.
Also replace its previous uses with new union declaration.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/fb373aed8fd2b04d01198f5a5769fd2476714e88.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wambui Karuga authored and Greg Kroah-Hartman committed Oct 14, 2019
1 parent ef1fe6b commit 73aef0c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/octeon/ethernet-mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int cvm_oct_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
}

void cvm_oct_note_carrier(struct octeon_ethernet *priv,
cvmx_helper_link_info_t li)
union cvmx_helper_link_info li)
{
if (li.s.link_up) {
pr_notice_ratelimited("%s: %u Mbps %s duplex, port %d, queue %d\n",
Expand All @@ -81,7 +81,7 @@ void cvm_oct_note_carrier(struct octeon_ethernet *priv,
void cvm_oct_adjust_link(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
cvmx_helper_link_info_t link_info;
union cvmx_helper_link_info link_info;

link_info.u64 = 0;
link_info.s.link_up = dev->phydev->link ? 1 : 0;
Expand All @@ -106,7 +106,7 @@ int cvm_oct_common_stop(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
cvmx_helper_link_info_t link_info;
union cvmx_helper_link_info link_info;
union cvmx_gmxx_prtx_cfg gmx_cfg;
int index = INDEX(priv->port);

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/octeon/ethernet-rgmii.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void cvm_oct_set_hw_preamble(struct octeon_ethernet *priv, bool enable)
static void cvm_oct_check_preamble_errors(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
cvmx_helper_link_info_t link_info;
union cvmx_helper_link_info link_info;
unsigned long flags;

link_info.u64 = priv->link_info;
Expand Down Expand Up @@ -103,7 +103,7 @@ static void cvm_oct_check_preamble_errors(struct net_device *dev)
static void cvm_oct_rgmii_poll(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
cvmx_helper_link_info_t link_info;
union cvmx_helper_link_info link_info;
bool status_change;

link_info = cvmx_helper_link_get(priv->port);
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/octeon/ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ int cvm_oct_common_open(struct net_device *dev,
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
int index = INDEX(priv->port);
cvmx_helper_link_info_t link_info;
union cvmx_helper_link_info link_info;
int rv;

rv = cvm_oct_phy_setup_device(dev);
Expand Down Expand Up @@ -496,7 +496,7 @@ int cvm_oct_common_open(struct net_device *dev,
void cvm_oct_link_poll(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
cvmx_helper_link_info_t link_info;
union cvmx_helper_link_info link_info;

link_info = cvmx_helper_link_get(priv->port);
if (link_info.u64 == priv->link_info)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/octeon/octeon-ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int cvm_oct_common_stop(struct net_device *dev);
int cvm_oct_common_open(struct net_device *dev,
void (*link_poll)(struct net_device *));
void cvm_oct_note_carrier(struct octeon_ethernet *priv,
cvmx_helper_link_info_t li);
union cvmx_helper_link_info li);
void cvm_oct_link_poll(struct net_device *dev);

extern int always_use_pow;
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/octeon/octeon-stubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ struct cvmx_wqe {
uint8_t packet_data[96];
};

typedef union {
union cvmx_helper_link_info {
uint64_t u64;
struct {
uint64_t reserved_20_63:44;
uint64_t link_up:1; /**< Is the physical link up? */
uint64_t full_duplex:1; /**< 1 if the link is full duplex */
uint64_t speed:18; /**< Speed of the link in Mbps */
} s;
} cvmx_helper_link_info_t;
};

typedef enum {
CVMX_FAU_REG_32_START = 0,
Expand Down Expand Up @@ -1267,15 +1267,15 @@ static inline cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
return 0;
}

static inline cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port)
static inline union cvmx_helper_link_info cvmx_helper_link_get(int ipd_port)
{
cvmx_helper_link_info_t ret = { .u64 = 0 };
union cvmx_helper_link_info ret = { .u64 = 0 };

return ret;
}

static inline int cvmx_helper_link_set(int ipd_port,
cvmx_helper_link_info_t link_info)
union cvmx_helper_link_info link_info)
{
return 0;
}
Expand Down

0 comments on commit 73aef0c

Please sign in to comment.