Thread (44 messages) flat view 44 messages, 5 authors, 2015-03-23

Re: [v2 PATCH 2/10] rhashtable: Eliminate unnecessary branch in rht_key_hashfn

From: Thomas Graf <tgraf@suug.ch>
Date: 2015-03-22 11:07:57

On 03/22/15 at 07:04pm, Herbert Xu wrote:
When rht_key_hashfn is called from rhashtable itself and params
is equal to ht->p, there is no point in checking params.key_len
and falling back to ht->p.key_len.

For some reason gcc couldn't figure out that params is the same
as ht->p.  So let's help it by only checking params.key_len when
it's a constant.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
A comment to document this gcc hack would be nice as it's not
obvious from just reading the code. Shouldn't hold up this series
though.

Acked-by: Thomas Graf <tgraf@suug.ch>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help