* [PATCH 1/4] staging: et131x: Fix et131x sparse warnings
@ 2011-10-10 15:21 Mark Einon
2011-10-10 15:21 ` [PATCH 2/4] staging: et131x: Fix et131x smatch issues Mark Einon
0 siblings, 1 reply; 2+ messages in thread
From: Mark Einon @ 2011-10-10 15:21 UTC (permalink / raw)
To: gregkh; +Cc: dan.carpenter, devel, linux-kernel, Mark Einon
This fixes the following warnings:
et1310_mac.c:375:44: warning: incorrect type in initializer (different address spaces)
et1310_mac.c:382:28: warning: incorrect type in argument 2 (different address spaces)
et1310_mac.c:384:31: warning: incorrect type in argument 2 (different address spaces)
et131x_initpci.c:555:5: warning: symbol 'et131x_mii_probe' was not declared. Should it be static?
et131x_netdev.c:267:5: warning: symbol 'et131x_ioctl' was not declared. Should it be static?
et131x_netdev.c:285:5: warning: symbol 'et131x_set_packet_filter' was not declared. Should it be static?
et131x_netdev.c:347:6: warning: symbol 'et131x_multicast' was not declared. Should it be static?
et131x_netdev.c:420:5: warning: symbol 'et131x_tx' was not declared. Should it be static?
et131x_netdev.c:453:6: warning: symbol 'et131x_tx_timeout' was not declared. Should it be static?
et131x_netdev.c:511:5: warning: symbol 'et131x_change_mtu' was not declared. Should it be static?
et131x_netdev.c:564:5: warning: symbol 'et131x_set_mac_addr' was not declared. Should it be static?
Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
drivers/staging/et131x/et1310_mac.c | 2 +-
drivers/staging/et131x/et131x_initpci.c | 2 +-
drivers/staging/et131x/et131x_netdev.c | 14 +++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/et131x/et1310_mac.c b/drivers/staging/et131x/et1310_mac.c
index 017ece7..042bc44 100644
--- a/drivers/staging/et131x/et1310_mac.c
+++ b/drivers/staging/et131x/et1310_mac.c
@@ -372,7 +372,7 @@ void et1310_config_rxmac_regs(struct et131x_adapter *adapter)
void et1310_config_txmac_regs(struct et131x_adapter *adapter)
{
- struct txmac_regs *txmac = &adapter->regs->txmac;
+ struct txmac_regs __iomem *txmac = &adapter->regs->txmac;
/* We need to update the Control Frame Parameters
* cfpt - control frame pause timer set to 64 (0x40)
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index 33e50e9..9b2dc55 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -552,7 +552,7 @@ static void et131x_adjust_link(struct net_device *netdev)
}
}
-int et131x_mii_probe(struct net_device *netdev)
+static int et131x_mii_probe(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
struct phy_device *phydev = NULL;
diff --git a/drivers/staging/et131x/et131x_netdev.c b/drivers/staging/et131x/et131x_netdev.c
index bcb4756..62070cf 100644
--- a/drivers/staging/et131x/et131x_netdev.c
+++ b/drivers/staging/et131x/et131x_netdev.c
@@ -264,7 +264,7 @@ int et131x_close(struct net_device *netdev)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
+static int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -282,7 +282,7 @@ int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
*
* Returns 0 on success, errno on failure
*/
-int et131x_set_packet_filter(struct et131x_adapter *adapter)
+static int et131x_set_packet_filter(struct et131x_adapter *adapter)
{
int status = 0;
uint32_t filter = adapter->packet_filter;
@@ -344,7 +344,7 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
* et131x_multicast - The handler to configure multicasting on the interface
* @netdev: a pointer to a net_device struct representing the device
*/
-void et131x_multicast(struct net_device *netdev)
+static void et131x_multicast(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
uint32_t packet_filter = 0;
@@ -417,7 +417,7 @@ void et131x_multicast(struct net_device *netdev)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
+static int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
{
int status = 0;
@@ -450,7 +450,7 @@ int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
* specified by the 'tx_timeo" element in the net_device structure (see
* et131x_alloc_device() to see how this value is set).
*/
-void et131x_tx_timeout(struct net_device *netdev)
+static void et131x_tx_timeout(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
struct tcb *tcb;
@@ -508,7 +508,7 @@ void et131x_tx_timeout(struct net_device *netdev)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_change_mtu(struct net_device *netdev, int new_mtu)
+static int et131x_change_mtu(struct net_device *netdev, int new_mtu)
{
int result = 0;
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -561,7 +561,7 @@ int et131x_change_mtu(struct net_device *netdev, int new_mtu)
*
* IMPLEMENTED BY : blux http://berndlux.de 22.01.2007 21:14
*/
-int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
+static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
{
int result = 0;
struct et131x_adapter *adapter = netdev_priv(netdev);
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/4] staging: et131x: Fix et131x smatch issues
2011-10-10 15:21 [PATCH 1/4] staging: et131x: Fix et131x sparse warnings Mark Einon
@ 2011-10-10 15:21 ` Mark Einon
0 siblings, 0 replies; 2+ messages in thread
From: Mark Einon @ 2011-10-10 15:21 UTC (permalink / raw)
To: gregkh; +Cc: dan.carpenter, devel, linux-kernel, Mark Einon
This fixes the following issues:
et131x_initpci.c +488 et131x_adjust_link(45) error: we previously assumed 'phydev' could be null.
et131x_initpci.c +504 et131x_adjust_link(61) warn: variable dereferenced before check 'phydev'
Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
drivers/staging/et131x/et131x_initpci.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index 9b2dc55..45ce832 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -485,7 +485,7 @@ static void et131x_adjust_link(struct net_device *netdev)
et1310_config_mac_regs2(adapter);
}
- if (phydev->link != adapter->link) {
+ if (phydev && phydev->link != adapter->link) {
/*
* Check to see if we are in coma mode and if
* so, disable it because we will not be able
@@ -501,7 +501,7 @@ static void et131x_adjust_link(struct net_device *netdev)
"Link down - cable problem ?\n");
adapter->boot_coma = 0;
- if (phydev && phydev->speed == SPEED_10) {
+ if (phydev->speed == SPEED_10) {
/* NOTE - Is there a way to query this without
* TruePHY?
* && TRU_QueryCoreType(adapter->hTruePhy, 0) ==
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-10 15:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-10 15:21 [PATCH 1/4] staging: et131x: Fix et131x sparse warnings Mark Einon
2011-10-10 15:21 ` [PATCH 2/4] staging: et131x: Fix et131x smatch issues Mark Einon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).