Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ordex@autistici.org
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	simon.wunderlich@s2003.tu-chemnitz.de, siwu@hrz.tu-chemnitz.de
Subject: Re: [PATCH 01/11] batman-adv: don't rely on positions in struct for hashing
Date: Tue, 13 Nov 2012 14:24:01 -0500 (EST)	[thread overview]
Message-ID: <20121113.142401.1673481049958731174.davem@davemloft.net> (raw)
In-Reply-To: <1352798139-19458-2-git-send-email-ordex@autistici.org>

From: Antonio Quartulli <ordex@autistici.org>
Date: Tue, 13 Nov 2012 10:15:29 +0100

> @@ -37,18 +37,26 @@ static void batadv_bla_periodic_work(struct work_struct *work);
>  static void batadv_bla_send_announce(struct batadv_priv *bat_priv,
>  				     struct batadv_backbone_gw *backbone_gw);
>  
> +static inline void hash_bytes(uint32_t *hash, void *data, uint32_t size)
> +{
> +	const unsigned char *key = data;
> +	int i;
> +
> +	for (i = 0; i < size; i++) {
> +		*hash += key[i];
> +		*hash += (*hash << 10);
> +		*hash ^= (*hash >> 6);
> +	}
> +}
> +

Remove the inline tag.

Return the uint32_t resulting hash value rather than passing it by
reference.

  reply	other threads:[~2012-11-13 19:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13  9:15 pull request: batman-adv 2012-11-13 Antonio Quartulli
     [not found] ` <1352798139-19458-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
2012-11-13  9:15   ` [PATCH 01/11] batman-adv: don't rely on positions in struct for hashing Antonio Quartulli
2012-11-13 19:24     ` David Miller [this message]
2012-11-13  9:15 ` [PATCH 02/11] batman-adv: fix wrong spinlock inline comment Antonio Quartulli
2012-11-13  9:15 ` [PATCH 03/11] batman-adv: prevent using any virtual device created on batman-adv as hard-interface Antonio Quartulli
2012-11-13  9:15 ` [PATCH 04/11] batman-adv: send announcement when backbone gw is registered Antonio Quartulli
2012-11-13  9:15 ` [PATCH 05/11] batman-adv: allow bla traffic only after first worker period Antonio Quartulli
2012-11-13  9:15 ` [PATCH 06/11] batman-adv: wait multiple periods before activating bla Antonio Quartulli
2012-11-13  9:15 ` [PATCH 07/11] batman-adv: substitute tt_poss_change with a per-tt_entry flag Antonio Quartulli
2012-11-13  9:15 ` [PATCH 08/11] batman-adv: refactor code to simplify long lines Antonio Quartulli
2012-11-13  9:15 ` [PATCH 09/11] batman-adv: refactor tt_global_del_struct() Antonio Quartulli
2012-11-13  9:15 ` [PATCH 10/11] batman-adv: roaming handling mechanism redesign Antonio Quartulli
2012-11-13  9:15 ` [PATCH 11/11] batman-adv: Remove instant overwritten variable initialization Antonio Quartulli
  -- strict thread matches above, loose matches on Subject: below --
2012-11-14 20:16 pull request: batman-adv 2012-11-14 Antonio Quartulli
     [not found] ` <1352924189-18843-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
2012-11-14 20:16   ` [PATCH 01/11] batman-adv: don't rely on positions in struct for hashing Antonio Quartulli

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=20121113.142401.1673481049958731174.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=netdev@vger.kernel.org \
    --cc=ordex@autistici.org \
    --cc=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=siwu@hrz.tu-chemnitz.de \
    /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