Netdev List
 help / color / mirror / Atom feed
* [PATCH 4/5] firewire: net: invalidate ARP entries for removed nodes.
From: Maxim Levitsky @ 2010-11-28  1:15 UTC (permalink / raw)
  To: linux1394-devel; +Cc: Stefan Richter, netdev, Maxim Levitsky
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>

This allows to be able to connect to nodes that disappered
from the bus and after some time appeared again.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
 drivers/firewire/net.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 1a467a9..d422519 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -189,6 +189,7 @@ struct fwnet_peer {
 	struct fwnet_device *dev;
 	u64 guid;
 	u64 fifo;
+	__be32 ip;
 
 	/* guarded by dev->lock */
 	struct list_head pd_list; /* received partial datagrams */
@@ -568,6 +569,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
 				peer->speed = sspd;
 			if (peer->max_payload > max_payload)
 				peer->max_payload = max_payload;
+
+			peer->ip = arp1394->sip;
 		}
 		spin_unlock_irqrestore(&dev->lock, flags);
 
@@ -1443,6 +1446,7 @@ static int fwnet_add_peer(struct fwnet_device *dev,
 	peer->dev = dev;
 	peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
 	peer->fifo = FWNET_NO_FIFO_ADDR;
+	peer->ip = 0;
 	INIT_LIST_HEAD(&peer->pd_list);
 	peer->pdg_size = 0;
 	peer->datagram_label = 0;
@@ -1558,6 +1562,9 @@ static int fwnet_remove(struct device *_dev)
 
 	mutex_lock(&fwnet_device_mutex);
 
+	if (dev->netdev && peer->ip)
+		arp_invalidate(dev->netdev, peer->ip);
+
 	fwnet_remove_peer(peer);
 
 	if (list_empty(&dev->peer_list)) {
-- 
1.7.1


^ permalink raw reply related

* [PATCH 3/5] NET: ARP: allow to invalidate specific ARP entries
From: Maxim Levitsky @ 2010-11-28  1:15 UTC (permalink / raw)
  To: linux1394-devel; +Cc: Stefan Richter, netdev, Maxim Levitsky
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>

IPv4 over firewire needs to be able to remove ARP entries
from cache that belong to nodes that are removed, because
IPv4 over firewire uses ARP packets for private information
about nodes.

This information becames invalid on node removal, thus
as soon as it is connected again, ARP packet should be sent
to it which is not done due to valid cache entry.

CC: netdev@vger.kernel.org
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
 include/net/arp.h |    1 +
 net/ipv4/arp.c    |   29 ++++++++++++++++++-----------
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/include/net/arp.h b/include/net/arp.h
index f4cf6ce..91f0568 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -25,5 +25,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
 				  const unsigned char *src_hw,
 				  const unsigned char *target_hw);
 extern void arp_xmit(struct sk_buff *skb);
+int arp_invalidate(struct net_device *dev, __be32 ip);
 
 #endif	/* _ARP_H */
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index d8e540c..35b1272 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1142,6 +1142,23 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev)
 	return err;
 }
 
+int arp_invalidate(struct net_device *dev, __be32 ip)
+{
+	int err = -ENXIO;
+	struct neighbour *neigh = neigh_lookup(&arp_tbl, &ip, dev);
+
+	if (neigh) {
+		if (neigh->nud_state & ~NUD_NOARP)
+			err = neigh_update(neigh, NULL, NUD_FAILED,
+					   NEIGH_UPDATE_F_OVERRIDE|
+					   NEIGH_UPDATE_F_ADMIN);
+		neigh_release(neigh);
+	}
+
+	return err;
+}
+EXPORT_SYMBOL(arp_invalidate);
+
 static int arp_req_delete_public(struct net *net, struct arpreq *r,
 		struct net_device *dev)
 {
@@ -1162,7 +1179,6 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
 {
 	int err;
 	__be32 ip;
-	struct neighbour *neigh;
 
 	if (r->arp_flags & ATF_PUBL)
 		return arp_req_delete_public(net, r, dev);
@@ -1180,16 +1196,7 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
 		if (!dev)
 			return -EINVAL;
 	}
-	err = -ENXIO;
-	neigh = neigh_lookup(&arp_tbl, &ip, dev);
-	if (neigh) {
-		if (neigh->nud_state & ~NUD_NOARP)
-			err = neigh_update(neigh, NULL, NUD_FAILED,
-					   NEIGH_UPDATE_F_OVERRIDE|
-					   NEIGH_UPDATE_F_ADMIN);
-		neigh_release(neigh);
-	}
-	return err;
+	return arp_invalidate(dev, ip);
 }
 
 /*
-- 
1.7.1


^ permalink raw reply related

* [PATCH 5/5] firewire: net: ratelimit error messages
From: Maxim Levitsky @ 2010-11-28  1:15 UTC (permalink / raw)
  To: linux1394-devel; +Cc: Stefan Richter, netdev, Maxim Levitsky
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>

This patch ensures that firewire-net won't be able to flood
the logs with errors by combining series of same errors together.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
 drivers/firewire/net.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index d422519..ac563d6 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -999,15 +999,23 @@ static void fwnet_transmit_packet_failed(struct fwnet_packet_task *ptask)
 static void fwnet_write_complete(struct fw_card *card, int rcode,
 				 void *payload, size_t length, void *data)
 {
-	struct fwnet_packet_task *ptask;
-
-	ptask = data;
+	struct fwnet_packet_task *ptask = data;
+	static unsigned long j;
+	static int last_rcode, errors_skipped;
 
 	if (rcode == RCODE_COMPLETE) {
 		fwnet_transmit_packet_done(ptask);
 	} else {
-		fw_error("fwnet_write_complete: failed: %x\n", rcode);
 		fwnet_transmit_packet_failed(ptask);
+
+		if (printk_timed_ratelimit(&j,  1000) || rcode != last_rcode) {
+			fw_error("fwnet_write_complete: "
+				"failed: %x (skipped %d)\n", rcode, errors_skipped);
+
+			errors_skipped = 0;
+			last_rcode = rcode;
+		} else
+			errors_skipped++;
 	}
 }
 
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH] econet: Move to staging; remove from defconfig
From: David Miller @ 2010-11-28  1:26 UTC (permalink / raw)
  To: gregkh; +Cc: ben, netdev, devel, linux-arm-kernel, debian-kernel
In-Reply-To: <20101128002135.GA4562@suse.de>

From: Greg KH <gregkh@suse.de>
Date: Sat, 27 Nov 2010 16:21:35 -0800

> And I need an ack from the networking maintainer to be able to accept
> this also.

I'm not applying this, nor do I want anyone else to.

If people think this protocol is not maintained adequately
right now, wait until you push it into staging.

Furthermore, once Phil Blundell was made aware of security
holes in econet he fixed them within a few days.  Which is
much better than I can say for some of the other protocols
and filesystems in the tree.

Moving this into staging, is therefore not appropriate.

^ permalink raw reply

* Re: [PATCH] econet: Move to staging; remove from defconfig
From: Greg KH @ 2010-11-28  1:39 UTC (permalink / raw)
  To: David Miller; +Cc: devel, netdev, ben, linux-arm-kernel, debian-kernel
In-Reply-To: <20101127.172644.226781076.davem@davemloft.net>

On Sat, Nov 27, 2010 at 05:26:44PM -0800, David Miller wrote:
> From: Greg KH <gregkh@suse.de>
> Date: Sat, 27 Nov 2010 16:21:35 -0800
> 
> > And I need an ack from the networking maintainer to be able to accept
> > this also.
> 
> I'm not applying this, nor do I want anyone else to.
> 
> If people think this protocol is not maintained adequately
> right now, wait until you push it into staging.
> 
> Furthermore, once Phil Blundell was made aware of security
> holes in econet he fixed them within a few days.  Which is
> much better than I can say for some of the other protocols
> and filesystems in the tree.
> 
> Moving this into staging, is therefore not appropriate.

Agreed.

Ben, why are you trying to remove these protocols that people use and
maintain?  This is the third one that has been shot down recently...

^ permalink raw reply

* Re: [PATCH] Net: ceph: Makefile: Remove unnessary code
From: David Miller @ 2010-11-28  1:39 UTC (permalink / raw)
  To: tdent48227; +Cc: sage, ceph-devel, linux-kernel, netdev
In-Reply-To: <1290389030-2743-1-git-send-email-tdent48227@gmail.com>

From: Tracey Dent <tdent48227@gmail.com>
Date: Sun, 21 Nov 2010 20:23:50 -0500

> Remove the if and else conditional because the code is in mainline and there
> is no need in it being there.
> 
> Signed-off-by: Tracey Dent <tdent48227@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 2/2] pch_gbe driver: The wrong of initializer entry
From: David Miller @ 2010-11-28  1:41 UTC (permalink / raw)
  To: toshiharu-linux
  Cc: linux, randy.dunlap, john.linn, ralf, kristoffer, mbizon,
	gregory.v.rose, netdev, linux-kernel, masa-korg, qi.wang,
	yong.y.wang, andrew.chih.howe.khor, joel.clark, margie.foster,
	kok.howg.ewe
In-Reply-To: <4CEA069D.20009@dsn.okisemi.com>

From: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Date: Mon, 22 Nov 2010 14:58:53 +0900

> The wrong of initializer entry was modified.
> 
> Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>

How about you give some credit to David Alan Gilbert who made
you aware of this issue?

^ permalink raw reply

* Re: [PATCH] econet: Move to staging; remove from defconfig
From: Ben Hutchings @ 2010-11-28  1:53 UTC (permalink / raw)
  To: David Miller; +Cc: gregkh, netdev, devel, linux-arm-kernel, debian-kernel
In-Reply-To: <20101127.172644.226781076.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]

On Sat, 2010-11-27 at 17:26 -0800, David Miller wrote:
> From: Greg KH <gregkh@suse.de>
> Date: Sat, 27 Nov 2010 16:21:35 -0800
> 
> > And I need an ack from the networking maintainer to be able to accept
> > this also.
> 
> I'm not applying this, nor do I want anyone else to.
> 
> If people think this protocol is not maintained adequately
> right now, wait until you push it into staging.
> 
> Furthermore, once Phil Blundell was made aware of security
> holes in econet he fixed them within a few days.  Which is
> much better than I can say for some of the other protocols
> and filesystems in the tree.

Those bugs were present for years and would have been obvious to anyone
who cared to read the code.  While I very much appreciate Phil's quick
response, I don't think this reactive maintenance is enough.

> Moving this into staging, is therefore not appropriate.

Oh well, it's not enough as if many distributions bothered to build it
anyway, and we've learned our lesson now.  Whether it's labelled as
staging or not, it's dead, Jim.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH] econet: Move to staging; remove from defconfig
From: Ben Hutchings @ 2010-11-28  2:02 UTC (permalink / raw)
  To: Greg KH; +Cc: David Miller, netdev, devel, linux-arm-kernel, debian-kernel
In-Reply-To: <20101128013923.GA9285@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

On Sat, 2010-11-27 at 17:39 -0800, Greg KH wrote:
> On Sat, Nov 27, 2010 at 05:26:44PM -0800, David Miller wrote:
> > From: Greg KH <gregkh@suse.de>
> > Date: Sat, 27 Nov 2010 16:21:35 -0800
> > 
> > > And I need an ack from the networking maintainer to be able to accept
> > > this also.
> > 
> > I'm not applying this, nor do I want anyone else to.
> > 
> > If people think this protocol is not maintained adequately
> > right now, wait until you push it into staging.
> > 
> > Furthermore, once Phil Blundell was made aware of security
> > holes in econet he fixed them within a few days.  Which is
> > much better than I can say for some of the other protocols
> > and filesystems in the tree.
> > 
> > Moving this into staging, is therefore not appropriate.
> 
> Agreed.
> 
> Ben, why are you trying to remove these protocols that people use and
> maintain?  This is the third one that has been shot down recently...

Moving to staging is a step toward removal, but not removal itself.  I
already stated the reasons I picked those three protocols; I'm not going
to push the issue if David disagrees.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH 0/5] Firewire networking assorted fixes
From: Maxim Levitsky @ 2010-11-28  3:02 UTC (permalink / raw)
  To: linux1394-devel; +Cc: netdev, Stefan Richter
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>

On Sun, 2010-11-28 at 03:15 +0200, Maxim Levitsky wrote:
> Here is few patches to fix few annoying problems with firewire networking.
> 
> I need a feedback on patch #3 from netdev folks.
> 
> patch #2 implements initial version of IR/IR resume support.
Sorry for bad spelling and grammar in the changelogs and here, usually I
mange much better than that....




------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev

^ permalink raw reply

* Re: [PATCH] econet: Move to staging; remove from defconfig
From: David Miller @ 2010-11-28  6:38 UTC (permalink / raw)
  To: ben; +Cc: gregkh, netdev, devel, linux-arm-kernel, debian-kernel
In-Reply-To: <1290909215.3292.230.camel@localhost>

From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 28 Nov 2010 01:53:35 +0000

> On Sat, 2010-11-27 at 17:26 -0800, David Miller wrote:
>> From: Greg KH <gregkh@suse.de>
>> Date: Sat, 27 Nov 2010 16:21:35 -0800
>> 
>> > And I need an ack from the networking maintainer to be able to accept
>> > this also.
>> 
>> I'm not applying this, nor do I want anyone else to.
>> 
>> If people think this protocol is not maintained adequately
>> right now, wait until you push it into staging.
>> 
>> Furthermore, once Phil Blundell was made aware of security
>> holes in econet he fixed them within a few days.  Which is
>> much better than I can say for some of the other protocols
>> and filesystems in the tree.
> 
> Those bugs were present for years and would have been obvious to anyone
> who cared to read the code.  While I very much appreciate Phil's quick
> response, I don't think this reactive maintenance is enough.

These same arguments could for be made for RDS.  Look at all the
hellacious awful obvious crap we've discovered in that code recently.
A simple read would have caught those too, and I don't see it's
maintainer doing such things.

So, you're very much still not convincing Ben, but feel free to keep
trying.

^ permalink raw reply

* Re: [PATCH net-next-2.6] be2net: adding support for Lancer family of CNAs
From: David Miller @ 2010-11-28  6:52 UTC (permalink / raw)
  To: sathya.perla; +Cc: netdev
In-Reply-To: <20101122092550.GA11076@emulex.com>

From: Sathya Perla <sathya.perla@emulex.com>
Date: Mon, 22 Nov 2010 14:55:50 +0530

> Key changes are:
> - EQ ids are not assigned consecutively in Lancer. So, fix mapping of MSIx
>   vector to EQ-id.
> - BAR mapping and some req locations different for Lancer.
> - TCP,UDP,IP checksum fields must be compulsorily set in TX wrb for TSO in
>   Lancer.
> - CEV_IST reg not present in Lancer; so, peek into event queue to check for
>   new entries
> - cq_create and mcc_create cmd interface is different for Lancer; handle
>   accordingly
> 
> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCN net-next-2.6] drivers/net: use vzalloc()
From: David Miller @ 2010-11-28  6:54 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1290420906.2811.14.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 22 Nov 2010 11:15:06 +0100

> Use vzalloc() and vzalloc_node() in net drivers
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH net-next-2.6]: rtnl: make link af-specific updates atomic
From: David Miller @ 2010-11-28  6:56 UTC (permalink / raw)
  To: tgraf; +Cc: netdev
In-Reply-To: <20101122113154.GA16382@canuck.infradead.org>

From: Thomas Graf <tgraf@infradead.org>
Date: Mon, 22 Nov 2010 06:31:54 -0500

> As David pointed out correctly, updates to af-specific attributes
> are currently not atomic. If multiple changes are requested and
> one of them fails, previous updates may have been applied already
> leaving the link behind in a undefined state.
> 
> This patch splits the function parse_link_af() into two functions
> validate_link_af() and set_link_at(). validate_link_af() is placed
> to validate_linkmsg() check for errors as early as possible before
> any changes to the link have been made. set_link_af() is called to
> commit the changes later.
> 
> This method is not fail proof, while it is currently sufficient
> to make set_link_af() inerrable and thus 100% atomic, the
> validation function method will not be able to detect all error
> scenarios in the future, there will likely always be errors
> depending on states which are f.e. not protected by rtnl_mutex
> and thus may change between validation and setting.
> 
> Also, instead of silently ignoring unknown address families and
> config blocks for address families which did not register a set
> function the errors EAFNOSUPPORT respectively EOPNOSUPPORT are
> returned to avoid comitting 4 out of 5 update requests without
> notifying the user.
> 
> Signed-off-by: Thomas Graf <tgraf@infradead.org>

Applied, thanks Thomas.

^ permalink raw reply

* Re: [PATCH] netns: Don't leak others' openreq-s in proc
From: David Miller @ 2010-11-28  6:58 UTC (permalink / raw)
  To: xemul; +Cc: netdev
In-Reply-To: <4CEA6F74.6010107@parallels.com>

From: Pavel Emelyanov <xemul@parallels.com>
Date: Mon, 22 Nov 2010 16:26:12 +0300

> The /proc/net/tcp leaks openreq sockets from other namespaces.
> 
> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

Applied to net-2.6, thanks!

^ permalink raw reply

* Re: [PATCH 5/6] forcedeth: use KERN_ facility level in printk
From: Michał Mirosław @ 2010-11-28  9:05 UTC (permalink / raw)
  To: Joe Perches; +Cc: Ben Hutchings, Szymon Janc, netdev
In-Reply-To: <1290887140.22971.16.camel@Joe-Laptop>

2010/11/27 Joe Perches <joe@perches.com>:
> On Sat, 2010-11-27 at 19:04 +0000, Ben Hutchings wrote:
>> On Sat, 2010-11-27 at 19:39 +0100, Szymon Janc wrote:
>> > diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
>> > index 2f092d7..a2b6681 100644
>> > --- a/drivers/net/forcedeth.c
>> > +++ b/drivers/net/forcedeth.c
>> > @@ -958,7 +958,7 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
>> >             delaymax -= delay;
>> >             if (delaymax < 0) {
>> >                     if (msg)
>> > -                           printk("%s", msg);
>> > +                           printk(KERN_WARNING "%s", msg);
>> No, msg already includes a log level.
>
> True.  The messages are still broken though.
> Some have trailing newlines, others not.
>
> It'd be better to move the msg after the reg_delay
> call and add the missing newlines.
>
[...]
> diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> index 0fa1776..2d11028f 100644
> --- a/drivers/net/forcedeth.c
> +++ b/drivers/net/forcedeth.c
[...]
> @@ -1547,9 +1544,9 @@ static void nv_stop_rx(struct net_device *dev)
>        else
>                rx_ctrl |= NVREG_RCVCTL_RX_PATH_EN;
>        writel(rx_ctrl, base + NvRegReceiverControl);
> -       reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
> -                       NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
> -                       KERN_INFO "nv_stop_rx: ReceiverStatus remained busy");
> +       if (reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
> +                     NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX))
> +               printk(KERN_INFO "nv_stop_rx: ReceiverStatus remained busy\n");

You could change it to dev_info() and friends in one go.

>        udelay(NV_RXSTOP_DELAY2);
>        if (!np->mac_in_use)
[...]

Best Regards,
Michał Mirosław

^ permalink raw reply

* [PATCH 0/4] drivers/net: Remove unnecessary [kv][mcz]alloc casts
From: Joe Perches @ 2010-11-28  9:05 UTC (permalink / raw)
  To: netdev, linux-wireless; +Cc: linux-kernel

These are the last remaining alloc casts in drivers/net...

Joe Perches (4):
  netxen: remove unnecessary [kv][mcz]alloc casts
  qlcnic: remove unnecessary [kv][mcz]alloc casts
  vxge: remove unnecessary [kv][mcz]alloc casts
  zd1211rw: remove unnecessary [kv][mcz]alloc casts

 drivers/net/netxen/netxen_nic_init.c    |    3 +--
 drivers/net/qlcnic/qlcnic_init.c        |    3 +--
 drivers/net/vxge/vxge-config.c          |   24 +++++++++---------------
 drivers/net/vxge/vxge-main.c            |    4 +---
 drivers/net/wireless/zd1211rw/zd_chip.c |    3 +--
 5 files changed, 13 insertions(+), 24 deletions(-)

-- 
1.7.3.2.245.g03276.dirty

^ permalink raw reply

* [PATCH 1/4] netxen: remove unnecessary [kv][mcz]alloc casts
From: Joe Perches @ 2010-11-28  9:05 UTC (permalink / raw)
  To: Amit Kumar Salecha; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290934782.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/netxen/netxen_nic_init.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index f946de2..731077d 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -278,8 +278,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
 			break;
 
 		}
-		rds_ring->rx_buf_arr = (struct netxen_rx_buffer *)
-			vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
+		rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
 		if (rds_ring->rx_buf_arr == NULL) {
 			printk(KERN_ERR "%s: Failed to allocate "
 				"rx buffer ring %d\n",
-- 
1.7.3.2.245.g03276.dirty

^ permalink raw reply related

* [PATCH 4/4] zd1211rw: remove unnecessary [kv][mcz]alloc casts
From: Joe Perches @ 2010-11-28  9:05 UTC (permalink / raw)
  To: Daniel Drake, Ulrich Kunitz
  Cc: John W. Linville, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1290934782.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/wireless/zd1211rw/zd_chip.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 87a95bc..dfcebed 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -117,8 +117,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr
 
 	/* Allocate a single memory block for values and addresses. */
 	count16 = 2*count;
-	a16 = (zd_addr_t *) kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
-		                   GFP_KERNEL);
+	a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), GFP_KERNEL);
 	if (!a16) {
 		dev_dbg_f(zd_chip_dev(chip),
 			  "error ENOMEM in allocation of a16\n");
-- 
1.7.3.2.245.g03276.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 2/4] qlcnic: remove unnecessary [kv][mcz]alloc casts
From: Joe Perches @ 2010-11-28  9:05 UTC (permalink / raw)
  To: Amit Kumar Salecha, Anirban Chakraborty, linux-driver
  Cc: netdev, linux-kernel
In-Reply-To: <cover.1290934782.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/qlcnic/qlcnic_init.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 3f97018..c5ea2f4 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -274,8 +274,7 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
 				rds_ring->dma_size + NET_IP_ALIGN;
 			break;
 		}
-		rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
-			vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
+		rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
 		if (rds_ring->rx_buf_arr == NULL) {
 			dev_err(&netdev->dev, "Failed to allocate "
 				"rx buffer ring %d\n", ring);
-- 
1.7.3.2.245.g03276.dirty


^ permalink raw reply related

* [PATCH 3/4] vxge: remove unnecessary [kv][mcz]alloc casts
From: Joe Perches @ 2010-11-28  9:05 UTC (permalink / raw)
  To: Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur,
	Jon Mason
  Cc: netdev, linux-kernel
In-Reply-To: <cover.1290934782.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/vxge/vxge-config.c |   24 +++++++++---------------
 drivers/net/vxge/vxge-main.c   |    4 +---
 2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 44d3ddd..a0241fe 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -1219,8 +1219,7 @@ vxge_hw_device_initialize(
 	if (status != VXGE_HW_OK)
 		goto exit;
 
-	hldev = (struct __vxge_hw_device *)
-			vzalloc(sizeof(struct __vxge_hw_device));
+	hldev = vzalloc(sizeof(struct __vxge_hw_device));
 	if (hldev == NULL) {
 		status = VXGE_HW_ERR_OUT_OF_MEMORY;
 		goto exit;
@@ -2140,8 +2139,7 @@ __vxge_hw_mempool_create(
 		goto exit;
 	}
 
-	mempool = (struct vxge_hw_mempool *)
-			vzalloc(sizeof(struct vxge_hw_mempool));
+	mempool = vzalloc(sizeof(struct vxge_hw_mempool));
 	if (mempool == NULL) {
 		status = VXGE_HW_ERR_OUT_OF_MEMORY;
 		goto exit;
@@ -2165,7 +2163,7 @@ __vxge_hw_mempool_create(
 
 	/* allocate array of memblocks */
 	mempool->memblocks_arr =
-		(void **) vzalloc(sizeof(void *) * mempool->memblocks_max);
+		vzalloc(sizeof(void *) * mempool->memblocks_max);
 	if (mempool->memblocks_arr == NULL) {
 		__vxge_hw_mempool_destroy(mempool);
 		status = VXGE_HW_ERR_OUT_OF_MEMORY;
@@ -2175,7 +2173,7 @@ __vxge_hw_mempool_create(
 
 	/* allocate array of private parts of items per memblocks */
 	mempool->memblocks_priv_arr =
-		(void **) vzalloc(sizeof(void *) * mempool->memblocks_max);
+		vzalloc(sizeof(void *) * mempool->memblocks_max);
 	if (mempool->memblocks_priv_arr == NULL) {
 		__vxge_hw_mempool_destroy(mempool);
 		status = VXGE_HW_ERR_OUT_OF_MEMORY;
@@ -2184,7 +2182,7 @@ __vxge_hw_mempool_create(
 	}
 
 	/* allocate array of memblocks DMA objects */
-	mempool->memblocks_dma_arr = (struct vxge_hw_mempool_dma *)
+	mempool->memblocks_dma_arr =
 		vzalloc(sizeof(struct vxge_hw_mempool_dma) *
 			mempool->memblocks_max);
 
@@ -2196,8 +2194,7 @@ __vxge_hw_mempool_create(
 	}
 
 	/* allocate hash array of items */
-	mempool->items_arr =
-		(void **) vzalloc(sizeof(void *) * mempool->items_max);
+	mempool->items_arr = vzalloc(sizeof(void *) * mempool->items_max);
 	if (mempool->items_arr == NULL) {
 		__vxge_hw_mempool_destroy(mempool);
 		status = VXGE_HW_ERR_OUT_OF_MEMORY;
@@ -4258,8 +4255,7 @@ vxge_hw_vpath_open(struct __vxge_hw_device *hldev,
 	if (status != VXGE_HW_OK)
 		goto vpath_open_exit1;
 
-	vp = (struct __vxge_hw_vpath_handle *)
-		vzalloc(sizeof(struct __vxge_hw_vpath_handle));
+	vp = vzalloc(sizeof(struct __vxge_hw_vpath_handle));
 	if (vp == NULL) {
 		status = VXGE_HW_ERR_OUT_OF_MEMORY;
 		goto vpath_open_exit2;
@@ -5065,8 +5061,7 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
 				item);
 
 	if (entry == NULL)
-		entry = (struct __vxge_hw_blockpool_entry *)
-			vmalloc(sizeof(struct __vxge_hw_blockpool_entry));
+		entry = vmalloc(sizeof(struct __vxge_hw_blockpool_entry));
 	else
 		list_del(&entry->item);
 
@@ -5182,8 +5177,7 @@ __vxge_hw_blockpool_free(struct __vxge_hw_device *devh,
 					item);
 
 		if (entry == NULL)
-			entry = (struct __vxge_hw_blockpool_entry *)
-				vmalloc(sizeof(
+			entry = vmalloc(sizeof(
 					struct __vxge_hw_blockpool_entry));
 		else
 			list_del(&entry->item);
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index 5cba4a6..a21dae1 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -4602,9 +4602,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
 
 	/* Copy the station mac address to the list */
 	for (i = 0; i < vdev->no_of_vpath; i++) {
-		entry =	(struct vxge_mac_addrs *)
-				kzalloc(sizeof(struct vxge_mac_addrs),
-					GFP_KERNEL);
+		entry =	kzalloc(sizeof(struct vxge_mac_addrs), GFP_KERNEL);
 		if (NULL == entry) {
 			vxge_debug_init(VXGE_ERR,
 				"%s: mac_addr_list : memory allocation failed",
-- 
1.7.3.2.245.g03276.dirty


^ permalink raw reply related

* Re: [PATCH 5/6] forcedeth: use KERN_ facility level in printk
From: Joe Perches @ 2010-11-28  9:11 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: Ben Hutchings, Szymon Janc, netdev
In-Reply-To: <AANLkTi=X-4mg2SyKx870B1xN4uW+4NPuPL=Fv_cqYf--@mail.gmail.com>

On Sun, 2010-11-28 at 10:05 +0100, Michał Mirosław wrote:
> 2010/11/27 Joe Perches <joe@perches.com>:
> > On Sat, 2010-11-27 at 19:04 +0000, Ben Hutchings wrote:
> >> On Sat, 2010-11-27 at 19:39 +0100, Szymon Janc wrote:
> >> > diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> >> > index 2f092d7..a2b6681 100644
> >> > @@ -958,7 +958,7 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
[]
> >> > -                           printk("%s", msg);
> >> > +                           printk(KERN_WARNING "%s", msg);
> >> No, msg already includes a log level.
> > True.  The messages are still broken though.
> > Some have trailing newlines, others not.
> > It'd be better to move the msg after the reg_delay
> > call and add the missing newlines.
> [...]
> > diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> > @@ -1547,9 +1544,9 @@ static void nv_stop_rx(struct net_device *dev)
[]
> > -       reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
> > -                       NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
> > -                       KERN_INFO "nv_stop_rx: ReceiverStatus remained busy");
> > +       if (reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
> > +                     NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX))
> > +               printk(KERN_INFO "nv_stop_rx: ReceiverStatus remained busy\n");
> You could change it to dev_info() and friends in one go.

Yeah, I did that in a local tree for all logging calls,
(dprintk->netdev_dbg, printk->netdev_<level> etc) but I'll
wait until Szymon's patches are applied or nacked.



^ permalink raw reply

* Re: [PATCH 4/4] zd1211rw: remove unnecessary [kv][mcz]alloc casts
From: Johannes Berg @ 2010-11-28  9:12 UTC (permalink / raw)
  To: Joe Perches
  Cc: Daniel Drake, Ulrich Kunitz, John W. Linville, linux-wireless,
	netdev, linux-kernel
In-Reply-To: <704bdd89d630b364043ac7a9ec0a110d311a17a2.1290934782.git.joe@perches.com>

On Sun, 2010-11-28 at 01:05 -0800, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/net/wireless/zd1211rw/zd_chip.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
> index 87a95bc..dfcebed 100644
> --- a/drivers/net/wireless/zd1211rw/zd_chip.c
> +++ b/drivers/net/wireless/zd1211rw/zd_chip.c
> @@ -117,8 +117,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr
>  
>  	/* Allocate a single memory block for values and addresses. */
>  	count16 = 2*count;
> -	a16 = (zd_addr_t *) kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
> -		                   GFP_KERNEL);
> +	a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), GFP_KERNEL);

I believe this is on purpose for sparse.

johannes

^ permalink raw reply

* Re: [PATCH 4/4] zd1211rw: remove unnecessary [kv][mcz]alloc casts
From: Joe Perches @ 2010-11-28  9:20 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Daniel Drake, Ulrich Kunitz, linux-wireless, John W. Linville,
	linux-kernel, netdev
In-Reply-To: <1290935566.3467.0.camel@jlt3.sipsolutions.net>

On Sun, 2010-11-28 at 10:12 +0100, Johannes Berg wrote:
> On Sun, 2010-11-28 at 01:05 -0800, Joe Perches wrote:
> > diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
> > @@ -117,8 +117,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr
> >  
> >  	/* Allocate a single memory block for values and addresses. */
> >  	count16 = 2*count;
> > -	a16 = (zd_addr_t *) kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
> > -		                   GFP_KERNEL);
> > +	a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), GFP_KERNEL);
> I believe this is on purpose for sparse.

Perhaps in a previous version, but not now.

$ make C=1 drivers/net/wireless/zd1211rw/zd_chip.o
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHECK   drivers/net/wireless/zd1211rw/zd_chip.c
include/trace/events/kmem.h:45:1: error: Expected ( after asm
include/trace/events/kmem.h:45:1: error: got goto
include/trace/events/kmem.h:53:1: error: Expected ( after asm
include/trace/events/kmem.h:53:1: error: got goto
include/trace/events/kmem.h:99:1: error: Expected ( after asm
include/trace/events/kmem.h:99:1: error: got goto
include/trace/events/kmem.h:108:1: error: Expected ( after asm
include/trace/events/kmem.h:108:1: error: got goto
include/trace/events/kmem.h:136:1: error: Expected ( after asm
include/trace/events/kmem.h:136:1: error: got goto
include/trace/events/kmem.h:143:1: error: Expected ( after asm
include/trace/events/kmem.h:143:1: error: got goto
include/trace/events/kmem.h:150:1: error: Expected ( after asm
include/trace/events/kmem.h:150:1: error: got goto
include/trace/events/kmem.h:172:1: error: Expected ( after asm
include/trace/events/kmem.h:172:1: error: got goto
include/trace/events/kmem.h:194:1: error: Expected ( after asm
include/trace/events/kmem.h:194:1: error: got goto
include/trace/events/kmem.h:249:1: error: Expected ( after asm
include/trace/events/kmem.h:249:1: error: got goto
include/trace/events/kmem.h:256:1: error: Expected ( after asm
include/trace/events/kmem.h:256:1: error: got goto
include/trace/events/kmem.h:267:1: error: Expected ( after asm
include/trace/events/kmem.h:267:1: error: got goto
include/trace/events/module.h:18:1: error: Expected ( after asm
include/trace/events/module.h:18:1: error: got goto
include/trace/events/module.h:37:1: error: Expected ( after asm
include/trace/events/module.h:37:1: error: got goto
include/trace/events/module.h:79:1: error: Expected ( after asm
include/trace/events/module.h:79:1: error: got goto
include/trace/events/module.h:86:1: error: Expected ( after asm
include/trace/events/module.h:86:1: error: got goto
include/trace/events/module.h:94:1: error: Expected ( after asm
include/trace/events/module.h:94:1: error: got goto
/home/joe/linux/net-next-2.6-2/arch/x86/include/asm/uaccess_32.h:197:9: error: attribute 'error': unknown attribute
include/trace/events/irq.h:37:1: error: Expected ( after asm
include/trace/events/irq.h:37:1: error: got goto
include/trace/events/irq.h:67:1: error: Expected ( after asm
include/trace/events/irq.h:67:1: error: got goto
include/trace/events/irq.h:112:1: error: Expected ( after asm
include/trace/events/irq.h:112:1: error: got goto
include/trace/events/irq.h:126:1: error: Expected ( after asm
include/trace/events/irq.h:126:1: error: got goto
include/trace/events/irq.h:140:1: error: Expected ( after asm
include/trace/events/irq.h:140:1: error: got goto
include/trace/events/kmem.h:45:1: error: need constant string for inline asm
include/trace/events/kmem.h:45:1: error: incompatible types in comparison expression (different address spaces)
include/trace/events/kmem.h:45:1: error: need constant string for inline asm
include/trace/events/kmem.h:45:1: error: incompatible types in comparison expression (different address spaces)
include/trace/events/kmem.h:45:1: error: need constant string for inline asm
include/trace/events/kmem.h:45:1: error: incompatible types in comparison expression (different address spaces)
include/trace/events/kmem.h:45:1: error: need constant string for inline asm
include/trace/events/kmem.h:45:1: error: incompatible types in comparison expression (different address spaces)
  CC      drivers/net/wireless/zd1211rw/zd_chip.o
$ 



^ permalink raw reply

* Re: [PATCH 4/4] zd1211rw: remove unnecessary [kv][mcz]alloc casts
From: Johannes Berg @ 2010-11-28  9:30 UTC (permalink / raw)
  To: Joe Perches
  Cc: Daniel Drake, Ulrich Kunitz, linux-wireless, John W. Linville,
	linux-kernel, netdev
In-Reply-To: <1290936047.16349.13.camel@Joe-Laptop>

On Sun, 2010-11-28 at 01:20 -0800, Joe Perches wrote:
> On Sun, 2010-11-28 at 10:12 +0100, Johannes Berg wrote:
> > On Sun, 2010-11-28 at 01:05 -0800, Joe Perches wrote:
> > > diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
> > > @@ -117,8 +117,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr
> > >  
> > >  	/* Allocate a single memory block for values and addresses. */
> > >  	count16 = 2*count;
> > > -	a16 = (zd_addr_t *) kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
> > > -		                   GFP_KERNEL);
> > > +	a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), GFP_KERNEL);
> > I believe this is on purpose for sparse.
> 
> Perhaps in a previous version, but not now.
> 
> $ make C=1 drivers/net/wireless/zd1211rw/zd_chip.o
>   CHK     include/linux/version.h
>   CHK     include/generated/utsrelease.h
>   CALL    scripts/checksyscalls.sh
>   CHECK   drivers/net/wireless/zd1211rw/zd_chip.c
> include/trace/events/kmem.h:45:1: error: Expected ( after asm
> include/trace/events/kmem.h:45:1: error: got goto

How do you know? I thought sparse was pretty much not reliable after the
first error it prints.

johannes

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox