From patchwork Wed Oct 29 10:16:51 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pekka Enberg X-Patchwork-Id: 6236 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 95BF1DDDEF for ; Wed, 29 Oct 2008 21:16:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbYJ2KQy (ORCPT ); Wed, 29 Oct 2008 06:16:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752927AbYJ2KQy (ORCPT ); Wed, 29 Oct 2008 06:16:54 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:54405 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbYJ2KQx (ORCPT ); Wed, 29 Oct 2008 06:16:53 -0400 Received: from melkki.cs.helsinki.fi (melkki.cs.helsinki.fi [128.214.9.98]) (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Wed, 29 Oct 2008 12:16:51 +0200 id 0005BEBD.49083813.000020C8 Received: by melkki.cs.helsinki.fi (Postfix, from userid 54704) id 6F46418123; Wed, 29 Oct 2008 12:16:51 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by melkki.cs.helsinki.fi (Postfix) with ESMTP id 6C71D18121; Wed, 29 Oct 2008 12:16:51 +0200 (EET) Date: Wed, 29 Oct 2008 12:16:51 +0200 (EET) From: Pekka J Enberg To: Andrew Morton cc: Ingo Molnar , Thomas Gleixner , Dave Airlie , netdev@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk, Herbert Xu , Paul Moore , Takashi Iwai , xfs-masters@oss.sgi.com Subject: Re: linux-next: arm allmodconfig In-Reply-To: <20081028175604.81c31cea.akpm@linux-foundation.org> Message-ID: References: <20081028175604.81c31cea.akpm@linux-foundation.org> Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 28 Oct 2008, Andrew Morton wrote: > > include/linux/slub_def.h:231: warning: 'ret' might be used uninitialized in this function > > include/linux/slub_def.h:231: warning: 'ret' might be used uninitialized in this function > > I lost interest here. Looks like a bogus warning to me. But we might as well clean it up a bit and maybe the compiler is less confused that way. Pekka From 48724e2995a0fd292d326f79caebe61f4f115021 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 29 Oct 2008 12:13:37 +0200 Subject: [PATCH] slub: avoid bogus warning on arm Move the ret variable to where we actually need it in an attempt to avoid a bugs warning when compiling for ARM. Signed-off-by: Pekka Enberg --- include/linux/slub_def.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index dc28432..4d3de0c 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -228,14 +228,13 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) static __always_inline void *kmalloc(size_t size, gfp_t flags) { - void *ret; - if (__builtin_constant_p(size)) { if (size > PAGE_SIZE) return kmalloc_large(size, flags); if (!(flags & SLUB_DMA)) { struct kmem_cache *s = kmalloc_slab(size); + void *ret; if (!s) return ZERO_SIZE_PTR;