From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759314AbYBATY1 (ORCPT ); Fri, 1 Feb 2008 14:24:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757945AbYBATYO (ORCPT ); Fri, 1 Feb 2008 14:24:14 -0500 Received: from mail1.sea5.speakeasy.net ([69.17.117.3]:56130 "EHLO mail1.sea5.speakeasy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757594AbYBATYM (ORCPT ); Fri, 1 Feb 2008 14:24:12 -0500 Date: Fri, 1 Feb 2008 11:24:09 -0800 (PST) From: Trent Piepho X-X-Sender: xyzzy@shell2.speakeasy.net To: Jan Engelhardt cc: Adrian Bunk , Mauro Carvalho Chehab , Hans Verkuil , v4l-dvb-maintainer@linuxtv.org, Marcin Slusarz , linux-kernel@vger.kernel.org Subject: Re: [v4l-dvb-maintainer] 2.6.25 regression: VIDEO_DEV=y/m, I2C=n compile error In-Reply-To: Message-ID: References: <20080127185216.GB13300@does.not.exist> <20080127223334.696fce6e@gaivota> <20080128084001.GB1001@does.not.exist> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Jan 2008, Jan Engelhardt wrote: > On Jan 28 2008 01:05, Trent Piepho wrote: > > >Maybe the kernel headers should provide a couple macros for testing > >configs, since people get it wrong over and over again? > > > >#define CONFIG_ON(x) (defined(CONFIG_##x) || defined(CONFIG_##x##_MODULE)) > >#define CONFIG_AVAIABLE(x) (defined(CONFIG_##x) || (defined(MODULE) && defined(CONFIG_##x##_MODULE))) > ^AVAILABLE(x) > > What's the difference between these two? > > CONFIG_x_MODULE will never be defined if MODULE is not, so defined(MODULE) > seems redundant. You're probably thinking of CONFIG_MODULES, which indicates the kernel supports module loading. MODULE indicates the current code is being compiled as a module. The idea is that code compiled in the kernel can't call modules. Generally what you would see is: #if CONFIG_ON(x) code that will be _used by_ x probably want x to depend on us in Kconfig #endif #if CONFIG_AVAILABLE(x) code that wants _to use_ x #endif