public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH v8 05/14] batman-adv: netlink: add translation table query
Date: Thu, 26 May 2016 06:39:14 +0200	[thread overview]
Message-ID: <20160526043914.GJ3453@otheros> (raw)
In-Reply-To: <1464019185-8381-6-git-send-email-sw@simonwunderlich.de>

On Mon, May 23, 2016 at 05:59:36PM +0200, Simon Wunderlich wrote:
> +static int
> +batadv_tt_local_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
> +			   struct batadv_priv *bat_priv,
> +			   struct batadv_tt_common_entry *common)
> +{
[...]
> +	if (!(common->flags & BATADV_TT_CLIENT_NOPURGE)) {
> +		if (nla_put_u32(msg, BATADV_ATTR_LAST_SEEN_MSECS,
> +				last_seen_msecs))
> +			goto nla_put_failure;
> +	}

Unnecessary brackets here, maybe use '&&' to skip a layer of
indention?


> +int batadv_tt_local_dump(struct sk_buff *msg, struct netlink_callback *cb)
> +{
> +	struct net *net = sock_net(cb->skb->sk);
> +	struct net_device *soft_iface = NULL;

No need to set soft_iface to NULL.


> +static int
> +batadv_tt_global_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
> +			    struct batadv_priv *bat_priv,
> +			    struct batadv_tt_common_entry *common, int *sub_s)
> +{
> +	struct batadv_tt_orig_list_entry *orig_entry, *best_entry;
> +	struct batadv_tt_global_entry *global;
> +	struct hlist_head *head;
> +	int sub = 0;
> +	bool best;
> +
> +	global = container_of(common, struct batadv_tt_global_entry, common);
> +	best_entry = batadv_transtable_best_orig(bat_priv, global);
> +	head = &global->orig_list;
> +
> +	hlist_for_each_entry_rcu(orig_entry, head, list) {

Either add an explicit rcu-lock or keep to the doc style to add a
line in the kerneldoc about caller needing to hold it?


> +int batadv_tt_global_dump(struct sk_buff *msg, struct netlink_callback *cb)
> +{
> +	struct net *net = sock_net(cb->skb->sk);
> +	struct net_device *soft_iface = NULL;

No need to set soft_iface to NULL.

  reply	other threads:[~2016-05-26  4:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 15:59 [B.A.T.M.A.N.] [PATCH v8 00/14] netns and netlink support Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 01/14] batman-adv: Handle parent interfaces in a different netns Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 02/14] batman-adv: Suppress debugfs entries for netns's Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 03/14] batman-adv: netlink: add routing_algo query Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 04/14] batman-adv: netlink: hardif query Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 05/14] batman-adv: netlink: add translation table query Simon Wunderlich
2016-05-26  4:39   ` Linus Lüssing [this message]
2016-05-26  8:30     ` Sven Eckelmann
2016-05-26  8:42       ` Antonio Quartulli
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 06/14] batman-adv: Provide TTVN in the mesh_info netlink msg Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 07/14] batman-adv: netlink: add originator and neighbor table queries Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 08/14] batman-adv: add B.A.T.M.A.N. IV bat_{orig, neigh}_dump implementations Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 09/14] batman-adv: add B.A.T.M.A.N. V " Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 10/14] batman-adv: add B.A.T.M.A.N. Dump gateways via netlink Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 11/14] batman-adv: add B.A.T.M.A.N. Dump BLA claims " Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 12/14] batman-adv: Provide bla group in the mesh_info netlink msg Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 13/14] batman-adv: add backbone table netlink support Simon Wunderlich
2016-05-23 15:59 ` [B.A.T.M.A.N.] [PATCH v8 14/14] batman-adv: Indicate netlink socket can be used with netns Simon Wunderlich
2016-05-23 16:03 ` [B.A.T.M.A.N.] [PATCH v8 00/14] netns and netlink support Simon Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160526043914.GJ3453@otheros \
    --to=linus.luessing@c0d3.blue \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox