* Re: [PATCH net-next v3] ipv6: make unsolicited report intervals configurable for mld
From: David Miller @ 2013-08-14 0:09 UTC (permalink / raw)
To: hannes; +Cc: netdev, xiyou.wangcong, william.manley, bcrl, yoshfuji
In-Reply-To: <20130813230346.GA16264@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Wed, 14 Aug 2013 01:03:46 +0200
> Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
> Reduce Unsolicited report interval to 1s when using IGMPv3") and
> 2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
> configuration of igmp unsolicited report interval") by William Manley made
> igmp unsolicited report intervals configurable per interface and corrected
> the interval of unsolicited igmpv3 report messages resendings to 1s.
>
> Same needs to be done for IPv6:
>
> MLDv1 (RFC2710 7.10.): 10 seconds
> MLDv2 (RFC3810 9.11.): 1 second
>
> Both intervals are configurable via new procfs knobs
> mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.
>
> (also added .force_mld_version to ipv6_devconf_dflt to bring structs in
> line without semantic changes)
>
> v2:
> a) Joined documentation update for IPv4 and IPv6 MLD/IGMP
> unsolicited_report_interval procfs knobs.
> b) incorporate stylistic feedback from William Manley
>
> v3:
> a) add new DEVCONF_* values to the end of the enum (thanks to David
> Miller)
>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Cc: William Manley <william.manley@youview.com>
> Cc: Benjamin LaHaise <bcrl@kvack.org>
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net] skge: dma_sync the whole receive buffer
From: Stephen Hemminger @ 2013-08-14 1:00 UTC (permalink / raw)
To: David Miller; +Cc: pomidorabelisima, netdev
In-Reply-To: <20130813.150955.1471100759610399160.davem@davemloft.net>
On Tue, 13 Aug 2013 15:09:55 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Sat, 10 Aug 2013 15:02:07 -0700
>
> > The DMA sync should sync the whole receive buffer, not just
> > part of it. Fixes log messages dma_sync_check.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> Applied, but I really suspect that your "check DMA mapping errors"
> patch has added a serious regression. A regression much worse than
> the bug you were trying to fix with that change.
Argh. The problem is deeper than that. Device got broken somewhere between
3.2 and 3.4. My old Dlink card works on 3.2 but gets DMA errors on 3.4.
The config's are different though so checking that as well.
^ permalink raw reply
* Re: [PATCH 1/3 v2] ipv6: do not disable temp_address when reaching max_address
From: Ding Tianhong @ 2013-08-14 1:34 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Netdev
In-Reply-To: <20130813110521.GE27385@order.stressinduktion.org>
On 2013/8/13 19:05, Hannes Frederic Sowa wrote:
> On Tue, Aug 13, 2013 at 03:57:14PM +0800, Ding Tianhong wrote:
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> index da4241c..72911fd 100644
>> --- a/net/ipv6/addrconf.c
>> +++ b/net/ipv6/addrconf.c
>> @@ -1134,10 +1134,27 @@ retry:
>> if (IS_ERR_OR_NULL(ift)) {
>> in6_ifa_put(ifp);
>> in6_dev_put(idev);
>> - pr_info("%s: retry temporary address regeneration\n", __func__);
>> - tmpaddr = &addr;
>> - write_lock(&idev->lock);
>> - goto retry;
>> +
>> + /* According RFC4941 3.3.7:
>> + * If DAD indicates the address is already in use,
>> + * the node must generate a new randomized interface
>> + * identifier as described in section 3.2 above, and
>> + * repeat the previous steps as appropriate up to
>> + * TEMP_IDGEN_RETRIES times.
>> + * If after TEMP_IDGEN_RETRIES consecutive attempts no
>> + * non-unique address was generated, the node must log
>> + * a system error and must not attempt to generate
>> + * temporary address for that interface.
>> + * So we have to check the return err and distinguish
>> + * the correct retry path.
>> + */
>> + if (PTR_ERR(ift) == -EEXIST) {
>> + pr_info("%s: retry temporary address regeneration\n", __func__);
>> + tmpaddr = &addr;
>> + write_lock(&idev->lock);
>> + goto retry;
>> + } else
>> + goto out;
>
> Correct me if I am wrong, but the RFC referes by mentioning "in use" to
> allocated on the subnet and not in use by this host. I don't see how this
> fixes the CVE then. dad is triggered by ipv6_add_addr.
>
> Greetings,
>
> Hannes
>
Reference:
-> http://seclists.org/oss-sec/2012/q4/292
-> http://seclists.org/oss-sec/2013/q1/92
I think the point is after the ./flood_route26 attack,
the proc/sys/net/ipv6/conf/iface/use_tempaddr will change from 2 to -1,
whether is correct? :)
regards
Ding Tianhong
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> .
>
^ permalink raw reply
* Re: [PATCH 1/3 v2] ipv6: do not disable temp_address when reaching max_address
From: Ding Tianhong @ 2013-08-14 1:39 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Netdev
In-Reply-To: <20130813115318.GG27385@order.stressinduktion.org>
On 2013/8/13 19:53, Hannes Frederic Sowa wrote:
> On Tue, Aug 13, 2013 at 01:05:21PM +0200, Hannes Frederic Sowa wrote:
>> On Tue, Aug 13, 2013 at 03:57:14PM +0800, Ding Tianhong wrote:
>>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>>> index da4241c..72911fd 100644
>>> --- a/net/ipv6/addrconf.c
>>> +++ b/net/ipv6/addrconf.c
>>> @@ -1134,10 +1134,27 @@ retry:
>>> if (IS_ERR_OR_NULL(ift)) {
>>> in6_ifa_put(ifp);
>>> in6_dev_put(idev);
>>> - pr_info("%s: retry temporary address regeneration\n", __func__);
>>> - tmpaddr = &addr;
>>> - write_lock(&idev->lock);
>>> - goto retry;
>>> +
>>> + /* According RFC4941 3.3.7:
>>> + * If DAD indicates the address is already in use,
>>> + * the node must generate a new randomized interface
>>> + * identifier as described in section 3.2 above, and
>>> + * repeat the previous steps as appropriate up to
>>> + * TEMP_IDGEN_RETRIES times.
>>> + * If after TEMP_IDGEN_RETRIES consecutive attempts no
>>> + * non-unique address was generated, the node must log
>>> + * a system error and must not attempt to generate
>>> + * temporary address for that interface.
>>> + * So we have to check the return err and distinguish
>>> + * the correct retry path.
>>> + */
>>> + if (PTR_ERR(ift) == -EEXIST) {
>>> + pr_info("%s: retry temporary address regeneration\n", __func__);
>>> + tmpaddr = &addr;
>>> + write_lock(&idev->lock);
>>> + goto retry;
>>> + } else
>>> + goto out;
>>
>> Correct me if I am wrong, but the RFC referes by mentioning "in use" to
>> allocated on the subnet and not in use by this host. I don't see how this
>> fixes the CVE then. dad is triggered by ipv6_add_addr.
>
> Eric already posted a proposal. It seems it lacked testing. Maybe you could
> start from this?
>
> http://permalink.gmane.org/gmane.linux.network/253518
>
> Thanks for looking into this,
>
> Hannes
>
the patch could not solve the problem, the use_tempaddr will still be -1 after the attack.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> .
>
^ permalink raw reply
* Re: [PATCH 1/2] ipv6: do not disable temp_address when reaching max_address
From: Ding Tianhong @ 2013-08-14 1:41 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Netdev, Patrick McHardy
In-Reply-To: <520A432F.4000308@cogentembedded.com>
On 2013/8/13 22:31, Sergei Shtylyov wrote:
> Hello.
>
> On 08/13/2013 10:14 AM, Ding Tianhong wrote:
>
>> A LAN user can remotely disable temporary address which may lead
>> to privacy violatins and information disclosure.
>
>> The reason is that the linux kernel uses the 'ipv6.max_addresses'
>> option to specify how many ipv6 addresses and interface may have.
>> The 'ipv6.regen_max_retry' (default value 3) option specifies
>> how many times the kernel will try to create a new address.
>
>> But the kernel is not distinguish between the event of reaching
>> max_addresses for an interface and failing to generate a new address.
>> the kernel disable the temporary address after regenerate a new
>> address 'regen_max_retry' times.
>
>> According RFC4941 3.3.7:
>
>> ---------------------------------------
>
>> If DAD indicates the address is already in use,
>> the node must generate a new randomized interface
>> identifier as described in section 3.2 above, and
>> repeat the previous steps as appropriate up to
>> TEMP_IDGEN_RETRIES times.
>
>> If after TEMP_IDGEN_RETRIES consecutive attempts no
>> non-unique address was generated, the node must log
>> a system error and must not attempt to generate
>> temporary address for that interface.
>
>> ------------------------------------------
>
>> RFC4941 3.3.7 specifies that disabling the temp_address must happen
>> upon the address is already in use, not reach the max_address,
>> So we have to check the return err and distinguish the correct retry path.
>
>> This fixes CVE-2013-0343
>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>> Tested-by: Wang Weidong <wangweidong1@huawei.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> ---
>> net/ipv6/addrconf.c | 25 +++++++++++++++++++++----
>> 1 file changed, 21 insertions(+), 4 deletions(-)
>
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> index da4241c..99f9fd5 100644
>> --- a/net/ipv6/addrconf.c
>> +++ b/net/ipv6/addrconf.c
>> @@ -1134,10 +1134,27 @@ retry:
> [...]
>> + if (PTR_ERR(ift) == -EEXIST) {
>> + pr_info("%s: retry temporary address regeneration\n", __func__);
>> + tmpaddr = &addr;
>> + write_lock(&idev->lock);
>> + goto retry;
>> + } else
>> + goto out;
>
> According to CodingStyle, both arms of the *if* statement should have {} if one has it.
>
> WBR, Sergei
>
thanks your opinion. I will collect feedback and resend v3 for the patch set.
regards
Ding Tianhong
>
> .
>
^ permalink raw reply
* Re: [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx()
From: Ding Tianhong @ 2013-08-14 1:43 UTC (permalink / raw)
To: Joe Perches
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Netdev, Patrick McHardy
In-Reply-To: <1376412534.1949.33.camel@joe-AO722>
On 2013/8/14 0:48, Joe Perches wrote:
> On Tue, 2013-08-13 at 15:57 +0800, Ding Tianhong wrote:
>> According to Joe Perches opinions, the ADBG() was tedious and it is
>> better to remove the KERN_<LEVEL>s and use the pr_xxx() instead of ADBG().
>
> No, that's not really what I wrote.
>
> I suggested it might be better to remove the KERN_<LEVELS>
> from these ADBG uses and use pr_debug.
>
> As is, you've changed logging messages which today
> always compile away to nothing to now emit what I
> think are pretty unnecessary messages.
>
>
sorry for misunderstand your opinion, I will modify it and resend soon.:)
regards
Ding Tianhong
>
>
^ permalink raw reply
* Re: [PATCH net-next] bonding: lacp_port_id setting for 802.3ad
From: Ding Tianhong @ 2013-08-14 1:46 UTC (permalink / raw)
To: Krisztian Ivancso; +Cc: Jay Vosburgh, netdev
In-Reply-To: <520AC296.2080503@ivancso.net>
On 2013/8/14 7:34, Krisztian Ivancso wrote:
> On 08/13/2013 08:25 PM, Jay Vosburgh wrote:
>> Krisztian Ivancso <github-ivan@ivancso.net> wrote:
>>
>>> On 08/13/2013 11:39 AM, Ding Tianhong wrote:
>>>> On 2013/8/13 17:20, Krisztian Ivancso wrote:
>>>>> On 08/13/2013 03:07 AM, Ding Tianhong wrote:
>>>>>> On 2013/8/12 19:19, Krisztian Ivancso wrote:
>>>>>>> >From 472fffa5a8f170daed9e4cc677af8e2560b86be2 Mon Sep 17 00:00:00 2001
>>>>>>> From: Krisztian Ivancso <github-ivan@ivancso.net>
>>>>>>> Date: Sun, 11 Aug 2013 20:30:44 +0200
>>>>>>> Subject: [PATCH net-next] bonding: lacp_port_id setting for 802.3ad ports
>>>>
>>>> ok, for example: the bonding has four slave, slave1 and slave2 aggregation to 1 group,
>>>> and slave3 and slave4 aggregtion to 2 group, how you distinguish the 1 and 2 group by initialize id.
>>>
>>> this is not possible, because all slave have to be a member of the same
>>> aggregation group.
>>
>> Just on the above point, bonding can group slaves into multiple
>> aggregators, but only one aggregator will be active at any given time.
>>
>> To answer the question, the four slaves would each be given
>> unique port IDs that do not conflict.
>>
>>> i think we misunderstood each other.
>>>
>>> here is a new example:
>>> - switch1 is a switch with a configured lag with two members ports
>>> (member1 and member2)
>>> - two linux (linux1 and linux2) box with a configured bonding device
>>> (bond0) with the same MAC set in both box and one
>>> slave on each
>>> - lacp_port_id is set to 10 in linux1 and 20 in linux2
>>>
>>> you can attach the slave from both linux boxes to the same
>>> lag on switch1. (slave from linux1 to port member1 and
>>> slave from linux2 to port member2 on switch1)
>>>
>>> port id must be unique within a system.
>>> bonding implementation set a unique system id for every bonding device
>>> which is derived from MAC of one of the slave interfaces.
>>>
>>> if we use the current bonding implementation second linux box can't be
>>> a member on switch1 because port id is 1 in both linux bonding device.
>>>
>>> if we can set different starting port id for bonding in different boxes
>>> the second box can be a member also.
>>
>> I understand what you're trying to do here (permit multiple
>> instances of bonding on different systems to connect to a single
>> aggregator on a switch), and I don't really have a problem with it in
>> general.
>>
>> I do have some comments:
>>
>> First, altering the lacp_port_id (via sysfs) should only be
>> permitted when there are no slaves in the bond, otherwise the
>> /proc/net/bonding/bond0 output for the first port id will not match the
>> actual first port id value assigned to the slaves. As a practical
>> matter, altering lacp_port_id while slaves are present in the bond has
>> no effect until all slaves are released and the first new slave is
>> added, so this is not reducing functionality.
>>
>> Second, the lacp_port_id is global across all bonds created
>> within the loaded module, and so multiple bonds will all use the same
>> starting value. Setting the lacp_port_id via sysfs has no effect, as it
>> alters a per-bond value, bond->params.lacp_port_id, that is never
>> actually used to set the port ID of a first slave in bond_enslave.
>>
>> The global default value should only be used to initialize the
>> per-bond value when a bond is created, and that per-bond value should be
>> used when setting the port id in bond_enslave(). The per-bond value is
>> already displayed in /proc/net/bonding/bond0, and is the value modified
>> by the sysfs functions
>>
>> Third, consider adding the port ID to the 803.2ad section in
>> bond_info_show_slave.
>
> Thanks for these great comments. I'll soon fix sysfs related bug and
> rework patch.
>
>>
>> Lastly, I think this should be tested against systems other than
>> Cisco to insure that it really interoperates with, for example,
>> Juniper's methodology for spanning an aggregator across physical
>> chassis. I'm not sure why it wouldn't, but once new functionality
>> becomes part of the kernel, changing it in non-backwards compatible ways
>> is difficult.
>
agreed
Ding Tianhong
> I agree. I try to test it with devices from other manufacturers.
>
>
> .
>
^ permalink raw reply
* Re: Bridge VLAN kernel/iproute2 incompatibility
From: David Miller @ 2013-08-14 2:10 UTC (permalink / raw)
To: ast; +Cc: vyasevic, stephen, bridge, linux-kernel, netdev
In-Reply-To: <52090C26.4090001@fiberby.net>
From: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Date: Mon, 12 Aug 2013 16:24:06 +0000
> Let's start with a little history:
I've applied your kernel patch, but the detailed analysis you put
here, belongs in the commit message.
Thanks.
^ permalink raw reply
* Re: [PATCH net] tun: compare with 0 instead of total_len
From: David Miller @ 2013-08-14 2:29 UTC (permalink / raw)
To: wpan; +Cc: netdev
In-Reply-To: <732ec15a7682b3ab87858de0b19a0848f0ad8944.1376399185.git.wpan@redhat.com>
From: Weiping Pan <wpan@redhat.com>
Date: Tue, 13 Aug 2013 21:46:56 +0800
> Since we set "len = total_len" in the beginning of tun_get_user(),
> so we should compare the new len with 0, instead of total_len,
> or the if statement always returns false.
>
> Signed-off-by: Weiping Pan <wpan@redhat.com>
Definitely looks correct to me, applied, thanks.
^ permalink raw reply
* RE: [PATCH net-next 1/3] net/usb/r8152: support aggregation
From: hayeswang @ 2013-08-14 3:02 UTC (permalink / raw)
To: 'David Miller', oneukum; +Cc: netdev, linux-kernel, linux-usb
In-Reply-To: <20130813.164118.1992860501009385037.davem@davemloft.net>
David Miller [mailto:davem@davemloft.net]
> Sent: Wednesday, August 14, 2013 7:41 AM
> To: oneukum@suse.de
> Cc: Hayeswang; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org
> Subject: Re: [PATCH net-next 1/3] net/usb/r8152: support aggregation
>
[...]
> > I don't understand what problem the function is supposed to
> fix. As long
> > as I don't understand it I cannot say for sure whether it
> is correct.
> > There seems no obvious reason for a memory barrier, but
> there may be a
> > hidden reason I don't see.
>
> Hayes, when Oliver asks you "Against what is the memory
> barrier?" he is asking
> you which memory operations you are trying to order.
>
> You do not explain this in your commit message, nor do you
> explain it with a
> suitable comment. This is not acceptable.
>
> It is absolutely critical, that any time you add a memory
> barrier, you add a
> comment above the new memory barrier explaining exactly what
> the barrier is
> trying to achieve.
>
> In fact, this is required by our coding standards.
I just want to make sure the rx_desc and rx_data are set correctly before
they are used. However, I study some examples and information from internet,
and I think that the memory barries is not necessary here. Therefore, I would
remove them later.
Best Regards,
Hayes
^ permalink raw reply
* [PATCH 1/3 v3] ipv6: do not disable temp_address when reaching max_address
From: Ding Tianhong @ 2013-08-14 3:35 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Jon Maloy, Eric Dumazet,
Netdev
A LAN user can remotely disable temporary address which may lead
to privacy violatins and information disclosure.
The reason is that the linux kernel uses the 'ipv6.max_addresses'
option to specify how many ipv6 addresses and interface may have.
The 'ipv6.regen_max_retry' (default value 3) option specifies
how many times the kernel will try to create a new address.
But the kernel is not distinguish between the event of reaching
max_addresses for an interface and failing to generate a new address.
the kernel disable the temporary address after regenerate a new
address 'regen_max_retry' times.
According RFC4941 3.3.7:
---------------------------------------
If DAD indicates the address is already in use,
the node must generate a new randomized interface
identifier as described in section 3.2 above, and
repeat the previous steps as appropriate up to
TEMP_IDGEN_RETRIES times.
If after TEMP_IDGEN_RETRIES consecutive attempts no
non-unique address was generated, the node must log
a system error and must not attempt to generate
temporary address for that interface.
------------------------------------------
RFC4941 3.3.7 specifies that disabling the temp_address must happen
upon the address is already in use, not reach the max_address,
So we have to check the return err and distinguish the correct retry path.
This fixes CVE-2013-0343
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Tested-by: Wang Weidong <wangweidong1@huawei.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Eric Dumazet <edumazet@google.com>
---
net/ipv6/addrconf.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index da4241c..7b55464 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1134,10 +1134,28 @@ retry:
if (IS_ERR_OR_NULL(ift)) {
in6_ifa_put(ifp);
in6_dev_put(idev);
- pr_info("%s: retry temporary address regeneration\n", __func__);
- tmpaddr = &addr;
- write_lock(&idev->lock);
- goto retry;
+
+ /* According RFC4941 3.3.7:
+ * If DAD indicates the address is already in use,
+ * the node must generate a new randomized interface
+ * identifier as described in section 3.2 above, and
+ * repeat the previous steps as appropriate up to
+ * TEMP_IDGEN_RETRIES times.
+ * If after TEMP_IDGEN_RETRIES consecutive attempts no
+ * non-unique address was generated, the node must log
+ * a system error and must not attempt to generate
+ * temporary address for that interface.
+ * So we have to check the return err and distinguish
+ * the correct retry path.
+ */
+ if (PTR_ERR(ift) == -EEXIST) {
+ pr_info("%s: retry temporary address regeneration\n", __func__);
+ tmpaddr = &addr;
+ write_lock(&idev->lock);
+ goto retry;
+ }
+ /* do not retry if the err code is not -EEXIST */
+ goto out;
}
spin_lock_bh(&ift->lock);
--
1.8.2.1
^ permalink raw reply related
* [PATCH 3/3 v3] ipv6: fix checkpatch errors in net/ipv6/addrconf.c
From: Ding Tianhong @ 2013-08-14 3:36 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Netdev
ERROR: code indent should use tabs where possible: fix 2.
ERROR: do not use assignment in if condition: fix 5.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
net/ipv6/addrconf.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 734724c..00e3fdc 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1105,8 +1105,8 @@ retry:
spin_unlock_bh(&ifp->lock);
regen_advance = idev->cnf.regen_max_retry *
- idev->cnf.dad_transmits *
- idev->nd_parms->retrans_time / HZ;
+ idev->cnf.dad_transmits *
+ idev->nd_parms->retrans_time / HZ;
write_unlock(&idev->lock);
/* A temporary address is created only if this calculated Preferred
@@ -2514,7 +2514,8 @@ static int inet6_addr_del(struct net *net, int ifindex, const struct in6_addr *p
if (!dev)
return -ENODEV;
- if ((idev = __in6_dev_get(dev)) == NULL)
+ idev = __in6_dev_get(dev);
+ if (!idev)
return -ENXIO;
read_lock_bh(&idev->lock);
@@ -2653,7 +2654,8 @@ static void init_loopback(struct net_device *dev)
ASSERT_RTNL();
- if ((idev = ipv6_find_idev(dev)) == NULL) {
+ idev = ipv6_find_idev(dev);
+ if (!idev) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
@@ -2751,7 +2753,8 @@ static void addrconf_sit_config(struct net_device *dev)
* our v4 addrs in the tunnel
*/
- if ((idev = ipv6_find_idev(dev)) == NULL) {
+ idev = ipv6_find_idev(dev);
+ if (!idev) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
@@ -2783,7 +2786,8 @@ static void addrconf_gre_config(struct net_device *dev)
ASSERT_RTNL();
- if ((idev = ipv6_find_idev(dev)) == NULL) {
+ idev = ipv6_find_idev(dev);
+ if (!idev) {
pr_debug("%s: add_dev failed\n", __func__);
return;
}
@@ -2814,11 +2818,11 @@ static void ip6_tnl_add_linklocal(struct inet6_dev *idev)
struct net *net = dev_net(idev->dev);
/* first try to inherit the link-local address from the link device */
- if (idev->dev->iflink &&
- (link_dev = __dev_get_by_index(net, idev->dev->iflink))) {
- if (!ipv6_inherit_linklocal(idev, link_dev))
+ if (idev->dev->iflink)
+ link_dev = __dev_get_by_index(net, idev->dev->iflink);
+ if (link_dev && !ipv6_inherit_linklocal(idev, link_dev))
return;
- }
+
/* then try to inherit it from any device */
for_each_netdev(net, link_dev) {
if (!ipv6_inherit_linklocal(idev, link_dev))
--
1.8.2.1
^ permalink raw reply related
* [PATCH RESEND 0/8] use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:36 UTC (permalink / raw)
To: David Miller
Cc: netdev, LKML, Li Zefan, leoli, linuxppc-dev, pantelis.antoniou,
vbordug, Greg KH, jg1.han
In-Reply-To: <5208E20A.4010306@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &pdev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
changelog:
this version add modify record about dev_set_drvdata().
Libo Chen (8):
net: fsl_pq_mdio: use platform_{get,set}_drvdata()
net: ucc_geth: use platform_{get,set}_drvdata()
net: fec_mpc52xx_phy: use platform_{get,set}_drvdata()
net: fs_enet: remove unnecessary dev_set_drvdata()
net: sunbmac: use platform_{get,set}_drvdata()
net: sunhme: use platform_{get,set}_drvdata()
net: xilinx_emaclite: use platform_{get,set}_drvdata()
net: davinci_mdio: use platform_{get,set}_drvdata()
drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 4 +---
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 1 -
drivers/net/ethernet/freescale/fsl_pq_mdio.c | 3 +--
drivers/net/ethernet/freescale/ucc_geth.c | 4 +---
drivers/net/ethernet/sun/sunbmac.c | 3 +--
drivers/net/ethernet/sun/sunhme.c | 8 +++-----
drivers/net/ethernet/ti/davinci_mdio.c | 4 +---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 4 +---
8 files changed, 9 insertions(+), 22 deletions(-)
^ permalink raw reply
* [PATCH 2/3 v3] ipv6: convert the uses of ADBG and remove the superfluous parentheses
From: Ding Tianhong @ 2013-08-14 3:36 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Joe Perches, Netdev
Just follow the Joe Perches's opinion, it is a better way to fix the
style errors.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
net/ipv6/addrconf.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7b55464..734724c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -99,9 +99,9 @@
#define ACONF_DEBUG 2
#if ACONF_DEBUG >= 3
-#define ADBG(x) printk x
+#define ADBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
-#define ADBG(x)
+#define ADBG(fmt, ...) do {} while (0)
#endif
#define INFINITY_LIFE_TIME 0xFFFFFFFF
@@ -369,9 +369,9 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
dev_hold(dev);
if (snmp6_alloc_dev(ndev) < 0) {
- ADBG((KERN_WARNING
+ ADBG(KERN_WARNING
"%s: cannot allocate memory for statistics; dev=%s.\n",
- __func__, dev->name));
+ __func__, dev->name);
neigh_parms_release(&nd_tbl, ndev->nd_parms);
dev_put(dev);
kfree(ndev);
@@ -379,9 +379,9 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
}
if (snmp6_register_dev(ndev) < 0) {
- ADBG((KERN_WARNING
+ ADBG(KERN_WARNING
"%s: cannot create /proc/net/dev_snmp6/%s\n",
- __func__, dev->name));
+ __func__, dev->name);
neigh_parms_release(&nd_tbl, ndev->nd_parms);
ndev->dead = 1;
in6_dev_finish_destroy(ndev);
@@ -844,7 +844,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
/* Ignore adding duplicate addresses on an interface */
if (ipv6_chk_same_addr(dev_net(idev->dev), addr, idev->dev)) {
- ADBG(("ipv6_add_addr: already assigned\n"));
+ ADBG("ipv6_add_addr: already assigned\n");
err = -EEXIST;
goto out;
}
@@ -852,7 +852,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
ifa = kzalloc(sizeof(struct inet6_ifaddr), GFP_ATOMIC);
if (ifa == NULL) {
- ADBG(("ipv6_add_addr: malloc failed\n"));
+ ADBG("ipv6_add_addr: malloc failed\n");
err = -ENOBUFS;
goto out;
}
@@ -2070,7 +2070,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
pinfo = (struct prefix_info *) opt;
if (len < sizeof(struct prefix_info)) {
- ADBG(("addrconf: prefix option too short\n"));
+ ADBG("addrconf: prefix option too short\n");
return;
}
@@ -3650,8 +3650,8 @@ restart:
if (time_before(next_sched, jiffies + ADDRCONF_TIMER_FUZZ_MAX))
next_sched = jiffies + ADDRCONF_TIMER_FUZZ_MAX;
- ADBG((KERN_DEBUG "now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
- now, next, next_sec, next_sched));
+ ADBG(KERN_DEBUG "now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
+ now, next, next_sec, next_sched);
addr_chk_timer.expires = next_sched;
add_timer(&addr_chk_timer);
--
1.8.2.1
^ permalink raw reply related
* [PATCH RESEND 1/8] net: fsl_pq_mdio: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev, LKML, Li Zefan
In-Reply-To: <5208E215.6030007@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &pdev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/freescale/fsl_pq_mdio.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index c93a056..995a3ab 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -409,7 +409,7 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
priv->regs = priv->map + data->mii_offset;
new_bus->parent = &pdev->dev;
- dev_set_drvdata(&pdev->dev, new_bus);
+ platform_set_drvdata(pdev, new_bus);
if (data->get_tbipa) {
for_each_child_of_node(np, tbi) {
@@ -468,7 +468,6 @@ static int fsl_pq_mdio_remove(struct platform_device *pdev)
mdiobus_unregister(bus);
- dev_set_drvdata(device, NULL);
iounmap(priv->map);
mdiobus_free(bus);
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 3/8] net: fec_mpc52xx_phy: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev, LKML, Li Zefan
In-Reply-To: <5208E21F.3090002@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &of->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
index 360a578..e052890 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
@@ -123,12 +123,10 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of)
static int mpc52xx_fec_mdio_remove(struct platform_device *of)
{
- struct device *dev = &of->dev;
- struct mii_bus *bus = dev_get_drvdata(dev);
+ struct mii_bus *bus = platform_get_drvdata(of);
struct mpc52xx_fec_mdio_priv *priv = bus->priv;
mdiobus_unregister(bus);
- dev_set_drvdata(dev, NULL);
iounmap(priv->regs);
kfree(priv);
mdiobus_free(bus);
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 4/8] net: fs_enet: remove unnecessary dev_set_drvdata()
From: Libo Chen @ 2013-08-14 3:39 UTC (permalink / raw)
To: David Miller, vbordug, pantelis.antoniou
Cc: linuxppc-dev, netdev, LKML, Li Zefan
In-Reply-To: <5208E222.60300@huawei.com>
unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index 8de53a1..7e3de10 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -1122,7 +1122,6 @@ static int fs_enet_remove(struct platform_device *ofdev)
fep->ops->free_bd(ndev);
fep->ops->cleanup_data(ndev);
- dev_set_drvdata(fep->dev, NULL);
of_node_put(fep->fpi->phy_node);
free_netdev(ndev);
return 0;
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 5/8] net: sunbmac: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:39 UTC (permalink / raw)
To: David Miller; +Cc: emilio, Greg KH, netdev, LKML, Li Zefan
In-Reply-To: <5208E225.5040301@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &of->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/sun/sunbmac.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c
index 0d43fa9..34b94cc 100644
--- a/drivers/net/ethernet/sun/sunbmac.c
+++ b/drivers/net/ethernet/sun/sunbmac.c
@@ -1239,7 +1239,7 @@ static int bigmac_sbus_probe(struct platform_device *op)
static int bigmac_sbus_remove(struct platform_device *op)
{
- struct bigmac *bp = dev_get_drvdata(&op->dev);
+ struct bigmac *bp = platform_get_drvdata(op);
struct device *parent = op->dev.parent;
struct net_device *net_dev = bp->dev;
struct platform_device *qec_op;
@@ -1259,7 +1259,6 @@ static int bigmac_sbus_remove(struct platform_device *op)
free_netdev(net_dev);
- dev_set_drvdata(&op->dev, NULL);
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 2/8] net: ucc_geth: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:39 UTC (permalink / raw)
To: David Miller, leoli; +Cc: netdev, LKML, Li Zefan, linuxppc-dev
In-Reply-To: <5208E21A.3020805@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &ofdev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/freescale/ucc_geth.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 3c43dac..5930c39 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3911,14 +3911,12 @@ static int ucc_geth_probe(struct platform_device* ofdev)
static int ucc_geth_remove(struct platform_device* ofdev)
{
- struct device *device = &ofdev->dev;
- struct net_device *dev = dev_get_drvdata(device);
+ struct net_device *dev = platform_get_drvdata(ofdev);
struct ucc_geth_private *ugeth = netdev_priv(dev);
unregister_netdev(dev);
free_netdev(dev);
ucc_geth_memclean(ugeth);
- dev_set_drvdata(device, NULL);
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 6/8] net: sunhme: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:40 UTC (permalink / raw)
To: David Miller; +Cc: David Miller, jg1.han, Bill Pemberton, netdev, LKML
In-Reply-To: <5208E229.9070300@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &pdev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/sun/sunhme.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 171f5b0..a111f29 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -3111,7 +3111,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
goto err_out_iounmap;
}
- dev_set_drvdata(&pdev->dev, hp);
+ platform_set_drvdata(pdev, hp);
if (!qfe_slot) {
struct pci_dev *qpdev = qp->quattro_dev;
@@ -3159,7 +3159,7 @@ err_out:
static void happy_meal_pci_remove(struct pci_dev *pdev)
{
- struct happy_meal *hp = dev_get_drvdata(&pdev->dev);
+ struct happy_meal *hp = platform_get_drvdata(pdev);
struct net_device *net_dev = hp->dev;
unregister_netdev(net_dev);
@@ -3171,7 +3171,6 @@ static void happy_meal_pci_remove(struct pci_dev *pdev)
free_netdev(net_dev);
- dev_set_drvdata(&pdev->dev, NULL);
}
static DEFINE_PCI_DEVICE_TABLE(happymeal_pci_ids) = {
@@ -3231,7 +3230,7 @@ static int hme_sbus_probe(struct platform_device *op)
static int hme_sbus_remove(struct platform_device *op)
{
- struct happy_meal *hp = dev_get_drvdata(&op->dev);
+ struct happy_meal *hp = platform_get_drvdata(op);
struct net_device *net_dev = hp->dev;
unregister_netdev(net_dev);
@@ -3250,7 +3249,6 @@ static int hme_sbus_remove(struct platform_device *op)
free_netdev(net_dev);
- dev_set_drvdata(&op->dev, NULL);
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 7/8] net: xilinx_emaclite: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:40 UTC (permalink / raw)
To: David Miller; +Cc: michal.simek, renner, Greg KH, netdev, LKML, Li Zefan
In-Reply-To: <5208E22C.4090101@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &of_dev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index fd4dbda..4c619ea 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1230,8 +1230,7 @@ error:
*/
static int xemaclite_of_remove(struct platform_device *of_dev)
{
- struct device *dev = &of_dev->dev;
- struct net_device *ndev = dev_get_drvdata(dev);
+ struct net_device *ndev = platform_get_drvdata(of_dev);
struct net_local *lp = netdev_priv(ndev);
@@ -1250,7 +1249,6 @@ static int xemaclite_of_remove(struct platform_device *of_dev)
lp->phy_node = NULL;
xemaclite_remove_ndev(ndev, of_dev);
- dev_set_drvdata(dev, NULL);
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH RESEND 8/8] net: davinci_mdio: use platform_{get,set}_drvdata()
From: Libo Chen @ 2013-08-14 3:40 UTC (permalink / raw)
To: David Miller
Cc: mugunthanvnm, bigeasy, prabhakar.csengg, b-liu, netdev, LKML,
Li Zefan
In-Reply-To: <5208E231.60104@huawei.com>
We can use the wrapper functions platform_{get,set}_drvdata() instead of
dev_{get,set}_drvdata() with &pdev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
drivers/net/ethernet/ti/davinci_mdio.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 16ddfc3..2249b2c 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -421,8 +421,7 @@ bail_out:
static int davinci_mdio_remove(struct platform_device *pdev)
{
- struct device *dev = &pdev->dev;
- struct davinci_mdio_data *data = dev_get_drvdata(dev);
+ struct davinci_mdio_data *data = platform_get_drvdata(pdev);
if (data->bus) {
mdiobus_unregister(data->bus);
@@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
- dev_set_drvdata(dev, NULL);
kfree(data);
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 2/3 v3] ipv6: convert the uses of ADBG and remove the superfluous parentheses
From: Joe Perches @ 2013-08-14 3:44 UTC (permalink / raw)
To: Ding Tianhong
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Netdev
In-Reply-To: <520AFB20.2000109@huawei.com>
On Wed, 2013-08-14 at 11:36 +0800, Ding Tianhong wrote:
> Just follow the Joe Perches's opinion, it is a better way to fix the
> style errors.
[]
> Signed-off-by: Joe Perches <joe@perches.com>
Nope, not signed by me. I sent you a suggestion.
Please don't add Signed-off-by: signatures for others.
Maybe you might use Suggested-by:
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> @@ -99,9 +99,9 @@
> #define ACONF_DEBUG 2
>
> #if ACONF_DEBUG >= 3
> -#define ADBG(x) printk x
> +#define ADBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
> #else
> -#define ADBG(x)
> +#define ADBG(fmt, ...) do {} while (0)
btw: The macro I suggested will always verify format
and arguments. This will not.
#define ADBG(fmt, ...) do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
^ permalink raw reply
* Re: [PATCH 2/3 v3] ipv6: convert the uses of ADBG and remove the superfluous parentheses
From: Ding Tianhong @ 2013-08-14 3:47 UTC (permalink / raw)
To: Joe Perches
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Netdev
In-Reply-To: <1376451847.1949.60.camel@joe-AO722>
On 2013/8/14 11:44, Joe Perches wrote:
> On Wed, 2013-08-14 at 11:36 +0800, Ding Tianhong wrote:
>> Just follow the Joe Perches's opinion, it is a better way to fix the
>> style errors.
>
> []
>
>> Signed-off-by: Joe Perches <joe@perches.com>
>
> Nope, not signed by me. I sent you a suggestion.
> Please don't add Signed-off-by: signatures for others.
> Maybe you might use Suggested-by:
>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>
>> @@ -99,9 +99,9 @@
>> #define ACONF_DEBUG 2
>>
>> #if ACONF_DEBUG >= 3
>> -#define ADBG(x) printk x
>> +#define ADBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
>> #else
>> -#define ADBG(x)
>> +#define ADBG(fmt, ...) do {} while (0)
>
> btw: The macro I suggested will always verify format
> and arguments. This will not.
>
> #define ADBG(fmt, ...) do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
>
>
yes, I got your opinion , but I think it's more simple and clear, maybe not align :)
>
> .
>
^ permalink raw reply
* Re: [PATCH] phy: micrel: Add definitions for common Micrel PHY registers
From: Shawn Guo @ 2013-08-14 5:17 UTC (permalink / raw)
To: dinguyen
Cc: dinh.linux, Nicolas Ferre, David S. Miller, Andrew Victor,
Jean-Christophe Plagniol-Villard, netdev, linux-arm-kernel
In-Reply-To: <1376405940-17141-1-git-send-email-dinguyen@altera.com>
On Tue, Aug 13, 2013 at 09:58:59AM -0500, dinguyen@altera.com wrote:
> From: Dinh Nguyen <dinguyen@altera.com>
>
> Hi Shawn,
>
> Can you apply this patch to your tree for 3.12?
>
I need David's Ack to send the patch through IMX tree.
Shawn
> Thanks,
>
> Dinh Nguyen (1):
> phy: micrel: Add definitions for common Micrel PHY registers
>
> arch/arm/mach-at91/board-dt-sama5.c | 17 ++++++-----------
> arch/arm/mach-imx/mach-imx6q.c | 13 ++++++++-----
> include/linux/micrel_phy.h | 6 ++++++
> 3 files changed, 20 insertions(+), 16 deletions(-)
>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: David S. Miller <davem@davemloft.net>
> CC: Andrew Victor <linux@maxim.org.za>
> CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
>
> --
> 1.7.9.5
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox