Re: [B.A.T.M.A.N.] [patch 2/2] scripts/spdxcheck.py: Handle special quotation mark comments

2019-01-20 Thread Joe Perches
On Sun, 2019-01-20 at 16:32 +0100, Sven Eckelmann wrote: > On Wednesday, 16 January 2019 11.26.53 CET Thomas Gleixner wrote: > > The SuperH boot code files use a magic format for the SPDX identifier > > comment: > > > > LIST "SPDX-License-Identifier: " > > > > The trailing quotation mark i

[B.A.T.M.A.N.] [PATCH] net: drivers/net: Convert random_ether_addr to eth_random_addr

2018-06-22 Thread Joe Perches
random_ether_addr is a #define for eth_random_addr which is generally preferred in kernel code by ~3:1 Convert the uses of random_ether_addr to enable removing the #define Miscellanea: o Convert &vfmac[0] to equivalent vfmac and avoid unnecessary line wrap Signed-off-by: Joe Per

Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default

2018-05-25 Thread Joe Perches
need this line. > > > > Hm, looks like this would have to be changed in a lot of places (~782 > > according to `git grep 'default n$'|wc -l` in my slightly outdated linux- > > next). Do you want to fix it everywhere? > > No, but we can at least not add th

Re: [B.A.T.M.A.N.] [PATCH 8/8] batman-adv: enable B.A.T.M.A.N. V compilation by default

2018-05-24 Thread Joe Perches
On Thu, 2018-05-24 at 14:03 +0200, Simon Wunderlich wrote: > From: Marek Lindner > > Signed-off-by: Marek Lindner > Acked-by: Antonio Quartulli > Signed-off-by: Sven Eckelmann > Signed-off-by: Simon Wunderlich > --- > net/batman-adv/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletio

[B.A.T.M.A.N.] [PATCH] batman-adv: Remove unnecessary length qualifier in %14pM

2017-06-14 Thread Joe Perches
It's misleading and unnecessary. Signed-off-by: Joe Perches --- net/batman-adv/distributed-arp-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 6930d6b50f99..b6cfa78e9381 1

Re: [B.A.T.M.A.N.] Odd use of %14pM in net/batman-adv/distributed-arp-table.c

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 10:23 +0200, Sven Eckelmann wrote: > On Dienstag, 13. Juni 2017 14:51:41 CEST Joe Perches wrote: > > An output mac address is 17 bytes > > [...] > > but in net/batman-adv/distributed-arp-table.c > > [...] > > %14pM is odd as this should not

[B.A.T.M.A.N.] Odd use of %14pM in net/batman-adv/distributed-arp-table.c

2017-06-13 Thread Joe Perches
An output mac address is 17 bytes 1 12345678901234567 00:11:22:33:44:55 but in net/batman-adv/distributed-arp-table.c int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset) { [...] seq_printf(seq, " * %15pI4 %14pM %4i %6i:%02i\n",

Re: [B.A.T.M.A.N.] [PATCH 17/17] batman-adv: Avoid precedence issues in macros

2016-10-28 Thread Joe Perches
On Fri, 2016-10-28 at 23:27 +0200, Sven Eckelmann wrote: > On Freitag, 28. Oktober 2016 14:13:06 CEST Joe Perches wrote: > > On Thu, 2016-10-27 at 21:01 +0200, Simon Wunderlich wrote: > > > From: Sven Eckelmann > > > > > > It must be avoided that argument

Re: [B.A.T.M.A.N.] [PATCH 17/17] batman-adv: Avoid precedence issues in macros

2016-10-28 Thread Joe Perches
On Thu, 2016-10-27 at 21:01 +0200, Simon Wunderlich wrote: > From: Sven Eckelmann > > It must be avoided that arguments to a macro are evaluated ungrouped (which > enforces normal operator precendence). Otherwise the result of the macro > is not well defined. Curiosity: in net/batman-adv/tp_met

Re: [B.A.T.M.A.N.] [PATCH 02/17] batman-adv: statically print gateway table header

2016-07-01 Thread Joe Perches
On Fri, 2016-07-01 at 15:08 +0200, Simon Wunderlich wrote: > To make it easier to search through the code it is better to print static > strings directly instead of using format strings printing constants. It's also generally smaller object code and faster at runtime. $ size net/batman-adv/gatewa

[B.A.T.M.A.N.] [PATCH net-next] batman-adv: Fix use of seq_has_overflowed()

2015-02-22 Thread Joe Perches
net-next commit 6d91147d183c ("batman-adv: Remove uses of return value of seq_printf") incorrectly changed the overflow occurred return from -1 to 1. Change it back so that the test of batadv_write_buffer_text's return value in batadv_gw_client_seq_print_text works properly. Sig

[B.A.T.M.A.N.] [PATCH] checkpatch: Improve "no space is necessary after a cast" test

2015-02-20 Thread Joe Perches
The "no space is necessary after a cast" sizeof exclusion doesn't work properly. The test reports a false positive for code like: BUILD_BUG_ON(sizeof(struct batadv_bla_claim_dst) != 6); Make it work, simplify the exclusions, and add some comments. Signed-off-by: Joe Pe

Re: [B.A.T.M.A.N.] checkpatch: CHECK: No space is necessary after a cast

2015-02-19 Thread Joe Perches
On Thu, 2015-02-19 at 13:35 +0800, Marek Lindner wrote: > Hi Joe, Hi Marek > we have come across a checkpatch false-positive: [] > BUILD_BUG_ON(sizeof(struct batadv_bla_claim_dst) != 6); > CHECK: No space is necessary after a cast > #440: FILE: main.c:440: > + BUILD_BUG_ON(sizeof(stru

[B.A.T.M.A.N.] [PATCH] batman-adv: Remove uses of return value of seq_printf

2015-02-16 Thread Joe Perches
This function is soon going to return void so remove the return value use. Convert the return value to test seq_has_overflowed() instead. Signed-off-by: Joe Perches --- net/batman-adv/gateway_client.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/net

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Joe Perches
On Sat, 2014-06-28 at 21:49 +0200, Antonio Quartulli wrote: > Hi all, > > On 28/06/14 21:13, Joe Perches wrote: > > diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c [] > > @@ -896,7 +896,7 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, > >

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Joe Perches
On Sun, 2014-06-29 at 00:06 +0530, Himangi Saraogi wrote: > kasprintf combines kmalloc and sprintf, and takes care of the size > calculation itself. Nice. A small conversion to remove unnecessary initializations, avoid calling kfree with known NULL pointers, and save a few bytes of code space wou

Re: [B.A.T.M.A.N.] [PATCH 09/21] batman-adv: slight optimization of addr compare

2013-12-23 Thread Joe Perches
On Mon, 2013-12-23 at 09:46 +0100, Antonio Quartulli wrote: > On 23/12/13 06:10, Ding Tianhong wrote: > > [...] > > > --- a/net/batman-adv/originator.c > > +++ b/net/batman-adv/originator.c > > @@ -41,7 +41,7 @@ int batadv_compare_orig(const struct hlist_node *node, > > const void *data2) > >

Re: [B.A.T.M.A.N.] [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-11 Thread Joe Perches
On Wed, 2013-12-11 at 08:05 +, Al Viro wrote: > On Wed, Dec 11, 2013 at 07:55:26AM +, Al Viro wrote: > > > This sucker should return 0. Insufficiently large buffer will be handled > > by caller, TYVM, if you give that caller a chance to do so. Returning 1 > > from ->show() is a bug in al

[B.A.T.M.A.N.] [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-10 Thread Joe Perches
r of bytes emitted ala printk. Signed-off-by: Joe Perches --- net/batman-adv/gateway_client.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 2449afa..dfa5d2d 100644 --- a/net/ba

[B.A.T.M.A.N.] [PATCH -next 0/3] seq_printf/puts/putc: Start to convert to return void

2013-12-10 Thread Joe Perches
seq_overflow to a public function from a static function. Remove the return uses of seq_printf/seq_puts/seq_putc from net. Add a seq_overflow function call instead. Joe Perches (3): seq: Add a seq_overflow test. batman-adv: Use seq_overflow netfilter: Use seq_overflow fs/seq_file.c

[B.A.T.M.A.N.] [PATCH -next] batadv: Slight optimization of batadv_compare_eth

2013-12-06 Thread Joe Perches
Use the newly added generic routine ether_addr_equal_unaligned to test if possibly unaligned to u16 Ethernet addresses are equal. This slightly improves comparison time for systems with CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS. Signed-off-by: Joe Perches --- net/batman-adv/main.h | 2 +- 1 file

[B.A.T.M.A.N.] [PATCH -next] etherdevice: Add ether_addr_equal_unaligned

2013-12-06 Thread Joe Perches
Add a generic routine to test if possibly unaligned to u16 Ethernet addresses are equal. If CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set, this uses the slightly faster generic routine ether_addr_equal, otherwise this uses memcmp. Signed-off-by: Joe Perches --- include/linux/etherdevice.h | 18

Re: [B.A.T.M.A.N.] [PATCH -next] batadv: Slight optimization of batadv_compare_eth

2013-12-06 Thread Joe Perches
On Fri, 2013-12-06 at 15:39 -0500, David Miller wrote: > From: Joe Perches > Date: Fri, 06 Dec 2013 00:18:10 -0800 > > > @@ -266,7 +266,11 @@ static inline void batadv_dbg(int type __always_unused, > > */ > > static inline int batadv_compare_eth(const voi

[B.A.T.M.A.N.] [PATCH -next] batadv: Slight optimization of batadv_compare_eth

2013-12-06 Thread Joe Perches
Use CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to check if this function can be optimized by using the generic ether_addr_equal. Remove the unnecessary ?: after the unoptimized memcmp. Signed-off-by: Joe Perches --- net/batman-adv/main.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion

Re: [B.A.T.M.A.N.] [PATCH 03/16] batman-adv: add bat_orig_print API function

2013-10-23 Thread Joe Perches
On Wed, 2013-10-23 at 19:18 +0200, Antonio Quartulli wrote: > On Wed, Oct 23, 2013 at 10:00:30AM -0700, Joe Perches wrote: > > On Wed, 2013-10-23 at 18:04 +0200, Antonio Quartulli wrote: > > > Each routing protocol has its own metric and private > > > variables, therefor

Re: [B.A.T.M.A.N.] [PATCH 03/16] batman-adv: add bat_orig_print API function

2013-10-23 Thread Joe Perches
On Wed, 2013-10-23 at 18:04 +0200, Antonio Quartulli wrote: > Each routing protocol has its own metric and private > variables, therefore it is useful to introduce a new API > for originator information printing. > > This API needs to be implemented by each protocol in order > to provide its speci

[B.A.T.M.A.N.] [PATCH] batman: Remove reference to compare_ether_addr

2013-09-01 Thread Joe Perches
This function is being removed, rename the reference. Signed-off-by: Joe Perches --- net/batman-adv/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index 5e9aebb..7333cf8 100644 --- a/net/batman-adv/main.h +++ b/net/batman

Re: [B.A.T.M.A.N.] [PATCH 15/15] batman-adv: unbloat batadv_priv if debug is not enabled

2013-01-14 Thread Joe Perches
On Mon, 2013-01-14 at 09:41 +1000, Antonio Quartulli wrote: > diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h [] > @@ -284,12 +284,16 @@ struct batadv_priv { > atomic_t gw_bandwidth; /* gw bandwidth */ > atomic_t orig_interval; /* uint */ > atomic_t h

[B.A.T.M.A.N.] [PATCH net-next 02/21] net: Convert is__ether_addr uses to eth_addr_

2012-10-19 Thread Joe Perches
Convert the old ether_addr tests to eth_addr_. Adds api consistency. Signed-off-by: Joe Perches --- net/802/stp.c |4 +- net/8021q/vlan_dev.c |6 ++-- net/8021q/vlan_netlink.c |2 +- net/batman-adv/bat_iv_ogm.c

[B.A.T.M.A.N.] [PATCH net-next 00/21] treewide: Use consistent api style for address testing

2012-10-19 Thread Joe Perches
*) ipv4_addr_(__be32) ipv6_addr_(const struct in6_addr *) Add temporary backward compatibility #defines for the old names too. Joe Perches (21): etherdevice: Rename is__ether_addr tests to eth_addr_ net: Convert is__ether_addr uses to eth_addr_ arch: Convert is__ether_addr uses to eth_addr_

[B.A.T.M.A.N.] [PATCH 00/24] net: Remove unnecessary OOM logging messages

2011-08-29 Thread Joe Perches
-in.o.old.allyesconfig Joe Perches (24): 802: Remove unnecessary OOM logging messages 9p: Remove unnecessary OOM logging messages atm: Remove unnecessary OOM logging messages ax25: Remove unnecessary OOM logging messages batman-adv: Remove unnecessary OOM logging messages netfilter: Remove unnecessary

[B.A.T.M.A.N.] [PATCH 05/24] batman-adv: Remove unnecessary OOM logging messages

2011-08-29 Thread Joe Perches
Removing unnecessary messages saves code and text. Site specific OOM messages are duplications of a generic MM out of memory message and aren't really useful, so just delete them. Signed-off-by: Joe Perches --- net/batman-adv/hard-interface.c |5 + net/batman-adv/m

Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_ macro helpers

2010-06-16 Thread Joe Perches
On Wed, 2010-06-16 at 00:37 +0200, Sven Eckelmann wrote: > Sven Eckelmann wrote: Hi Sven. > > The problem seems to be that dev_printk is used by netdev_printk (which is > > used by netdev_info). netdev_printk will add (netdev)->dev.parent as second > > parameter of dev_printk (and parent is NULL

Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM

2010-06-03 Thread Joe Perches
On Thu, 2010-06-03 at 01:56 +0200, Sven Eckelmann wrote: > see sys.c -> log_print > and read_file -> read_file Yuck. The patch changes the prefix from "batman-adv:" to "batman_adv: " so yes, it would break as-is. I think the concept is broken though, I believe dmesg output specifically is not gu

Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM

2010-06-03 Thread Joe Perches
On Thu, 2010-06-03 at 01:33 +0200, Sven Eckelmann wrote: > Joe Perches wrote: > > On Thu, 2010-06-03 at 01:23 +0200, Sven Eckelmann wrote: > > > You've also changed the output. So you may partly broke batctl too (have > > > to check that first). > > Ther

Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM

2010-06-03 Thread Joe Perches
On Thu, 2010-06-03 at 01:23 +0200, Sven Eckelmann wrote: > You've also changed the output. So you may partly broke batctl too (have to > check that first). There was no change in output. MAC_FMT output is the same as %pM cheers, Joe

[B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_ macro helpers

2010-06-02 Thread Joe Perches
Compile tested only Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove "batman-adv:" from format strings Use pr_ Use netdev_ Signed-off-by: Joe Perches --- drivers/staging/batman-adv/aggregation.c |2 + drivers/staging/batman-adv/bat_sy

[B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM

2010-06-02 Thread Joe Perches
Remove the last uses of MAC_FMT Signed-off-by: Joe Perches --- drivers/staging/batman-adv/main.c |3 +- drivers/staging/batman-adv/translation-table.c | 25 --- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/drivers/staging/batman-adv