Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753929AbbK0Hmb (ORCPT ); Fri, 27 Nov 2015 02:42:31 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:36197 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853AbbK0Hm3 (ORCPT ); Fri, 27 Nov 2015 02:42:29 -0500 Date: Fri, 27 Nov 2015 08:42:24 +0100 From: Ingo Molnar To: Chris Wilson Cc: Valentin Rothberg , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Patrick Plagwitz , Andreas Ziegler , Daniel Lohmann Subject: Re: kernel: stop_machine: report (un)dead code (and feedback request) Message-ID: <20151127074224.GA23839@gmail.com> References: <20151126144559.GA19758@debian-vm> <20151126145234.GL23362@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151126145234.GL23362@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1373 Lines: 37 * Chris Wilson wrote: > On Thu, Nov 26, 2015 at 03:45:59PM +0100, Valentin Rothberg wrote: > > Hi Chris, > > > > your commit 4c477de14237 ("kernel: remove stop_machine() Kconfig > > dependency") has shown up in today's linux-next tree (20151126). > > The commit changes the #ifdef condition in kernel/stop_machine.c > > from/to: > > > > -#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) > > +#if defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU) > > > > Although this change fixes certain configs on X86, the condition now is > > a tautology since CONFIG_SMP is already required to compile the file: > > > > kernel/Makefile:65:obj-$(CONFIG_SMP) += stop_machine.o > > > > AFAIU, we can safely remove this #ifdef? > > That seems logical. The argument in favour of it would be to keep the > ifdeffery around the function defintion the same as the function > declaration in stop_machine.h. But this would introduce a bit of fragility: we could re-introduce the same regression that the commit fixes, if we ever changed the SMP dependency for stop_machine.c. Thanks, Ingo -- 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/