From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932671Ab1LOWnE (ORCPT ); Thu, 15 Dec 2011 17:43:04 -0500 Received: from terminus.zytor.com ([198.137.202.10]:43537 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759632Ab1LOWnC (ORCPT ); Thu, 15 Dec 2011 17:43:02 -0500 Message-ID: <4EEA77E1.6050009@zytor.com> Date: Thu, 15 Dec 2011 14:42:41 -0800 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: David Howells , Stephen Hemminger , Alexander van Heukelum , Ingo Molnar , Thomas Gleixner CC: Linux Kernel Mailing List Subject: x86: fls64() exported to user space but not fls()? X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm trying to grok why fls64() seems to be exported to user space in on x86 by unconditional inclusion of : ... #endif /* __KERNEL__ */ #include #ifdef __KERNEL__ ... whereas fls() isn't (although __fls() is!) This is even more bizarre since contains: ... #if BITS_PER_LONG == 32 static __always_inline int fls64(__u64 x) { __u32 h = x >> 32; if (h) return fls(h) + 32; return fls(x); } #elif BITS_PER_LONG == 64 static __always_inline int fls64(__u64 x) { if (x == 0) return 0; return __fls(x) + 1; } #else #error BITS_PER_LONG not 32 or 64 #endif ... Both BITS_PER_LONG and fls() are non-user-visible symbols, so this code should fail on user space. Finally, are non-exported headers; they are not installed by make headers_install. Is the #endif..#ifdef in a bug, plain and simple? -hpa