Skip to content
Snippets Groups Projects
Commit e65379de authored by Maxim Menshikov's avatar Maxim Menshikov
Browse files

libethernet/generic: fix static analysis errors

parent 5fe6ea76
No related branches found
No related tags found
1 merge request!282easy-soc-libs: Enable errors instead of warnings, fix warnings, enable static analysis for libqos/libeasy
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
#include "ethernet.h" #include "ethernet.h"
#ifdef IOPSYS_BROADCOM #if defined(IOPSYS_BROADCOM)
extern const struct eth_ops bcm_eth_ops; extern const struct eth_ops bcm_eth_ops;
#elif IOPSYS_TEST #elif defined(IOPSYS_TEST)
extern const struct eth_ops test_eth_ops; extern const struct eth_ops test_eth_ops;
#elif IOPSYS_ECONET #elif defined(IOPSYS_ECONET)
extern const struct eth_ops econet_gen_eth_ops; extern const struct eth_ops econet_gen_eth_ops;
extern const struct eth_ops econet_nas_wan_eth_ops; extern const struct eth_ops econet_nas_wan_eth_ops;
extern const struct eth_ops econet_ae_wan_eth_ops; extern const struct eth_ops econet_ae_wan_eth_ops;
...@@ -51,11 +51,11 @@ extern const struct eth_ops ethsw_ops; ...@@ -51,11 +51,11 @@ extern const struct eth_ops ethsw_ops;
#endif #endif
const struct eth_ops *eth_ops[] = { const struct eth_ops *eth_ops[] = {
#ifdef IOPSYS_BROADCOM #if defined(IOPSYS_BROADCOM)
&bcm_eth_ops, &bcm_eth_ops,
#elif IOPSYS_TEST #elif defined(IOPSYS_TEST)
&test_eth_ops, &test_eth_ops,
#elif IOPSYS_ECONET #elif defined(IOPSYS_ECONET)
&econet_gen_eth_ops, &econet_gen_eth_ops,
&econet_nas_wan_eth_ops, &econet_nas_wan_eth_ops,
&econet_ae_wan_eth_ops, &econet_ae_wan_eth_ops,
...@@ -244,7 +244,7 @@ int eth_mii_get_phy_id(const char *ifname, int port, int *phy_id) ...@@ -244,7 +244,7 @@ int eth_mii_get_phy_id(const char *ifname, int port, int *phy_id)
mii = if_mii(&ifr); mii = if_mii(&ifr);
memset(mii, 0, sizeof(struct mii_ioctl_data)); memset(mii, 0, sizeof(struct mii_ioctl_data));
mii->val_in = port; mii->val_in = (uint16_t)port;
if (ioctl(s, SIOCGMIIPHY, &ifr) < 0) { if (ioctl(s, SIOCGMIIPHY, &ifr) < 0) {
libethernet_err("SIOCGMIIPHY failed!\n"); libethernet_err("SIOCGMIIPHY failed!\n");
...@@ -283,9 +283,9 @@ static int eth_mii_ioctl(const char *ifname, int cmd, int phy_id, int reg, ...@@ -283,9 +283,9 @@ static int eth_mii_ioctl(const char *ifname, int cmd, int phy_id, int reg,
memset(mii, 0, sizeof(struct mii_ioctl_data)); memset(mii, 0, sizeof(struct mii_ioctl_data));
//PHYID_2_MII_IOCTL(phy_id, mii); //PHYID_2_MII_IOCTL(phy_id, mii);
mii->phy_id = phy_id; mii->phy_id = (uint16_t)phy_id;
mii->reg_num = reg; mii->reg_num = (uint16_t)reg;
mii->val_in = in; mii->val_in = (uint16_t)in;
if (ioctl(s, cmd, &ifr) < 0) { if (ioctl(s, cmd, &ifr) < 0) {
libethernet_err("MII cmd on %s failed\n", ifr.ifr_name); libethernet_err("MII cmd on %s failed\n", ifr.ifr_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment