Thread (17 messages) 17 messages, 4 authors, 2016-10-29

Re: [PATCH 17/17] batman-adv: Avoid precedence issues in macros

From: Joe Perches <joe@perches.com>
Date: 2016-10-29 01:56:30
Also in: batman

On Fri, 2016-10-28 at 23:27 +0200, Sven Eckelmann wrote:
On Freitag, 28. Oktober 2016 14:13:06 CEST Joe Perches wrote:
quoted
On Thu, 2016-10-27 at 21:01 +0200, Simon Wunderlich wrote:
quoted
From: Sven Eckelmann <sven@narfation.org>

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_meter.c
[...]
quoted
	orig_node = batadv_orig_hash_find(bat_priv, tp_vars->other_end);
	if (unlikely(!orig_node)) {
		err = BATADV_TP_REASON_DST_UNREACHABLE;
		tp_vars->reason = err;
		goto out;
	}

	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (unlikely(!primary_if)) {
		err = BATADV_TP_REASON_DST_UNREACHABLE;
		goto out;
	}

err is not used in the out block

Is the last if block supposed to set tp_vars->reason to err?
This seems to be unrelated to this patch.
Kinda.  I was looking at how the one instance of
batadv_tp_is_error was used and it's in this file.
But yes, looks to me like it is missing. Do you want to propose a patch or
should I do?
As you are working on this file, perhaps you should.

cheers, Joe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help