Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-19 Thread Patrick McHardy
David Miller wrote: From: David Miller [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 16:43:05 -0800 (PST) I think we can fix this easily by using __attribute_const_ on the print_mac() declaration. Let me play with that. Actually it seems the 'pure' attribute is more important here. Although

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread Patrick McHardy
Joe Perches wrote: On Fri, 2008-02-15 at 02:58 -0800, David Miller wrote: From: Bruno Randolf [EMAIL PROTECTED] Date: Fri, 15 Feb 2008 19:48:05 +0900 is there any chance to include a macro like this for printing mac addresses? its advantage is that it can be used without the need to declare

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread Joe Perches
On Mon, 2008-02-18 at 16:19 +0100, Patrick McHardy wrote: @@ -404,11 +405,8 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) pr_debug(%s: about to send skb: %p to dev: %s\n, __FUNCTION__, skb, skb-dev-name); - pr_debug( MAC_FMT

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread Patrick McHardy
David Miller wrote: From: Patrick McHardy [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 16:19:40 +0100 Joe Perches wrote: We specifically removed this sort of thing, please don't add it back. Why? We converted the entire tree over the print_mac(), and since the MAC_FMT

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 16:19:40 +0100 Joe Perches wrote: On Fri, 2008-02-15 at 02:58 -0800, David Miller wrote: From: Bruno Randolf [EMAIL PROTECTED] Date: Fri, 15 Feb 2008 19:48:05 +0900 is there any chance to include a macro like this for

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread Patrick McHardy
Joe Perches wrote: On Mon, 2008-02-18 at 16:19 +0100, Patrick McHardy wrote: @@ -404,11 +405,8 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) pr_debug(%s: about to send skb: %p to dev: %s\n, __FUNCTION__, skb, skb-dev-name); -

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread David Miller
From: David Miller [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 16:43:05 -0800 (PST) I think we can fix this easily by using __attribute_const_ on the print_mac() declaration. Let me play with that. Actually it seems the 'pure' attribute is more important here. Although it's not semantically a

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread Joe Perches
On Mon, 2008-02-18 at 16:50 -0800, David Miller wrote: Actually it seems the 'pure' attribute is more important here. Although it's not semantically a perfect match, what we need to tell the compiler is basically that: 1) the return value depends upon the inputs 2) if the input is not

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 22:17:27 +0100 The way pr_debug is implemented it still results in two function calls per packet since the compiler doesn't know that it doesn't have visible side-effects besides modifying the (unused) buffer. I confirmed this

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread Philip Craig
Joe Perches wrote: Perhaps it's more sensible to go back to #ifdef DEBUG #define pr_debug(fmt, arg...) do {} while (0) #endif and give up the printf argument verification I think argument verification is important. Can you keep it like this: #ifdef DEBUG #define pr_debug(fmt, arg...)

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-18 Thread David Miller
From: Joe Perches [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 17:03:32 -0800 Does this need to be done for all function calls declared with __attribute__((format(printf, x, y))) { return 0; } ie: pr_debug, dev_dbg, dev_vdbg? No, I don't think so. We're adding the tag to teach the compiler

Re: [PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-17 Thread David Miller
From: Joe Perches [EMAIL PROTECTED] Date: Fri, 15 Feb 2008 09:42:50 -0800 On Fri, 2008-02-15 at 02:58 -0800, David Miller wrote: From: Bruno Randolf [EMAIL PROTECTED] Date: Fri, 15 Feb 2008 19:48:05 +0900 is there any chance to include a macro like this for printing mac addresses?

[PATCH] net/8021q/vlan_dev.c - Use print_mac

2008-02-15 Thread Joe Perches
On Fri, 2008-02-15 at 02:58 -0800, David Miller wrote: From: Bruno Randolf [EMAIL PROTECTED] Date: Fri, 15 Feb 2008 19:48:05 +0900 is there any chance to include a macro like this for printing mac addresses? its advantage is that it can be used without the need to declare buffers for