summaryrefslogtreecommitdiffstats
path: root/tools/include/linux
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-12-16 11:26:35 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-12-17 11:58:08 -0300
commitafcd4f6235659c611f0e62236f6a7bc0ae08af1e (patch)
treee0ee747117de6bf2fabc0d4dd1c76864288256df /tools/include/linux
parent3967278496ffa69704b941745de393223406a83d (diff)
downloadtalos-op-linux-afcd4f6235659c611f0e62236f6a7bc0ae08af1e.tar.gz
talos-op-linux-afcd4f6235659c611f0e62236f6a7bc0ae08af1e.zip
tools: Adopt fls_long and deps
Will be used when adopting rounddown_pow_of_two. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-9m0tt5300q1ygv51hejjas82@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/bitops.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h
index 5237bc9f6266..26005a15e7e2 100644
--- a/tools/include/linux/bitops.h
+++ b/tools/include/linux/bitops.h
@@ -43,4 +43,11 @@ static inline unsigned long hweight_long(unsigned long w)
return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
}
+static inline unsigned fls_long(unsigned long l)
+{
+ if (sizeof(l) == 4)
+ return fls(l);
+ return fls64(l);
+}
+
#endif
OpenPOWER on IntegriCloud