From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754442Ab2GNMBm (ORCPT ); Sat, 14 Jul 2012 08:01:42 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:43395 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971Ab2GNMBl (ORCPT ); Sat, 14 Jul 2012 08:01:41 -0400 MIME-Version: 1.0 In-Reply-To: References: <1342221125.17464.8.camel@lorien2> Date: Sat, 14 Jul 2012 15:01:40 +0300 X-Google-Sender-Auth: fuYKD_rCR4IRBUeef6DmSvq9QEU Message-ID: Subject: Re: [PATCH TRIVIAL] mm: Fix build warning in kmem_cache_create() From: Pekka Enberg To: David Rientjes Cc: Shuah Khan , cl@linux.com, glommer@parallels.com, js1304@gmail.com, shuahkhan@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 14, 2012 at 12:18 PM, David Rientjes wrote: > On Fri, 13 Jul 2012, Shuah Khan wrote: > >> diff --git a/mm/slab_common.c b/mm/slab_common.c >> index 12637ce..aa3ca5b 100644 >> --- a/mm/slab_common.c >> +++ b/mm/slab_common.c >> @@ -98,7 +98,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align >> >> s = __kmem_cache_create(name, size, align, flags, ctor); >> >> +#ifdef CONFIG_DEBUG_VM >> oops: >> +#endif >> mutex_unlock(&slab_mutex); >> put_online_cpus(); >> > > Tip: gcc allows label attributes so you could actually do > > oops: __maybe_unused > > to silence the warning and do the same for the "out" label later in the > function. I'm not exactly loving that either. It'd probably be better to reshuffle the code so that the debug checks end up in separate functions that are no-op for !CONFIG_DEBUG_VM. That way the _labels_ are used unconditionally although there's no actual code generated. Pekka