From patchwork Wed Jan 27 14:09:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 43809 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 0E488B8A50 for ; Thu, 28 Jan 2010 01:10:12 +1100 (EST) Received: by ozlabs.org (Postfix) id 0CB14B7EED; Thu, 28 Jan 2010 01:09:42 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail.dev.rtsoft.ru (mail.dev.rtsoft.ru [213.79.90.226]) by ozlabs.org (Postfix) with SMTP id D0AEFB7F65 for ; Thu, 28 Jan 2010 01:09:40 +1100 (EST) Received: (qmail 12566 invoked from network); 27 Jan 2010 14:09:44 -0000 Received: from unknown (HELO localhost) (192.168.1.70) by 0 with SMTP; 27 Jan 2010 14:09:44 -0000 Date: Wed, 27 Jan 2010 17:09:38 +0300 From: Anton Vorontsov To: Andrew Morton Subject: [PATCH 3/3] kfifo: Don't use integer as NULL pointer Message-ID: <20100127140938.GC31608@oksana.dev.rtsoft.ru> References: <20100127140809.GA27906@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100127140809.GA27906@oksana.dev.rtsoft.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: linux-usb@vger.kernel.org, Stefani Seibold , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org This patch fixes following sparse warnings: include/linux/kfifo.h:127:25: warning: Using plain integer as NULL pointer kernel/kfifo.c:83:21: warning: Using plain integer as NULL pointer Signed-off-by: Anton Vorontsov --- include/linux/kfifo.h | 2 +- kernel/kfifo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 6f6c5f3..bc0fc79 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h @@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo, */ static inline bool kfifo_initialized(struct kfifo *fifo) { - return fifo->buffer != 0; + return fifo->buffer != NULL; } /** diff --git a/kernel/kfifo.c b/kernel/kfifo.c index 3b00bf8..6d58e1a 100644 --- a/kernel/kfifo.c +++ b/kernel/kfifo.c @@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask) buffer = kmalloc(size, gfp_mask); if (!buffer) { - _kfifo_init(fifo, 0, 0); + _kfifo_init(fifo, NULL, 0); return -ENOMEM; }