Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758117AbYCZMIy (ORCPT ); Wed, 26 Mar 2008 08:08:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753396AbYCZMIq (ORCPT ); Wed, 26 Mar 2008 08:08:46 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:53001 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbYCZMIq (ORCPT ); Wed, 26 Mar 2008 08:08:46 -0400 Subject: Re: why so many unexported headers checking __KERNEL__? From: David Woodhouse To: "Robert P. J. Day" Cc: Linux Kernel Mailing List In-Reply-To: References: Content-Type: text/plain Date: Wed, 26 Mar 2008 12:08:44 +0000 Message-Id: <1206533324.9540.268.camel@pmac.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.22.0 (2.22.0-1.fc9) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 29 On Sun, 2008-03-23 at 02:31 -0400, Robert P. J. Day wrote: > > as an unintended side effect of checking for proper exporting to > user space and unifdef'ing, i noticed that there are literally > hundreds of kernel header files that check the value of __KERNEL__ in > some way, but are never exported to user space. what's the point of > that? thanks. There's no point -- we just haven't got round to removing it yet. We should probably make headers_check or some other automated check catch these two cases: If a header is exported by header-y or not exported at all, it shouldn't contain any #ifdef __KERNEL__. And if it's exported and doesn't contain any #ifdef __KERNEL__, it should be header-y not unifdef-y (and that's the case we should be moving towards, by cleaning up headers to have separate files for the user-visible parts). -- dwmw2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/