From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbcGMUdE (ORCPT ); Wed, 13 Jul 2016 16:33:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40448 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbcGMUcz (ORCPT ); Wed, 13 Jul 2016 16:32:55 -0400 Date: Wed, 13 Jul 2016 13:32:54 -0700 From: Andrew Morton To: Luis de Bethencourt Cc: linux-kernel@vger.kernel.org, rusty@rustcorp.com.au, hidehiro.kawai.ez@hitachi.com, bp@suse.de, mina86@mina86.com, linux@rasmusvillemoes.dk, joe@perches.com Subject: Re: [RFC PATCH] dynamic_debug: only add header when used Message-Id: <20160713133254.70078c50b1af9edb8b577499@linux-foundation.org> In-Reply-To: <1468429793-16917-1-git-send-email-luisbg@osg.samsung.com> References: <1468429793-16917-1-git-send-email-luisbg@osg.samsung.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jul 2016 18:09:53 +0100 Luis de Bethencourt wrote: > kernel.h header doesn't directly use dynamic debug, instead we can include > it in module.c (which used it via kernel.h). printk.h only uses it if > CONFIG_DYNAMIC_DEBUG is on, changing the inclusion to only happen in that > case. > > Signed-off-by: Luis de Bethencourt > --- > Hi, > > While studying the problem that surfaced when adding #include > in include/linux/string.h to have access to the MAX_SIZE macro [0]. I noticed > that dynamic_debug.h is included in kernel.h even though it isn't necessary. > Which in the case of adding kernel.h to string.h would mean a circular > dependency. > > Not entirely sure if there is a reason for this beyond making dynamic debug > available to module.c. Which is why I am sending this patch as an RFC. It would be good if we can do this. What is it in kernel.h that requires dynamic_debug.h? I tried your patch along with --- a/kernel/module.c~dynamic_debug-only-add-header-when-used-fix +++ a/kernel/module.c @@ -60,7 +60,6 @@ #include #include #include -#include #include #include "module-internal.h" and module.o builds OK.