From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935606Ab3BOIpj (ORCPT ); Fri, 15 Feb 2013 03:45:39 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:48906 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932895Ab3BOIpf (ORCPT ); Fri, 15 Feb 2013 03:45:35 -0500 Date: Fri, 15 Feb 2013 11:45:17 +0300 From: Dan Carpenter To: Peter Huewe Cc: Rupesh Gujare , devel@driverdev.osuosl.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer Message-ID: <20130215084517.GB6802@mwanda> References: <1360905935-20601-1-git-send-email-peterhuewe@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1360905935-20601-1-git-send-email-peterhuewe@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2013 at 06:25:29AM +0100, Peter Huewe wrote: > This patch fixes the warning "Using plain integer as NULL pointer", > generated by sparse, by replacing the offending 0s with NULL. > > Signed-off-by: Peter Huewe Don't send 7 patches with the same subject. > @@ -455,7 +455,7 @@ int oz_prepare_frame(struct oz_pd *pd, int empty) > */ > static struct sk_buff *oz_build_frame(struct oz_pd *pd, struct oz_tx_frame *f) > { > - struct sk_buff *skb = 0; > + struct sk_buff *skb = NULL; This initialization could just be removed. > struct net_device *dev = pd->net_dev; > struct oz_hdr *oz_hdr; > struct oz_elt *elt; > @@ -464,8 +464,8 @@ static struct sk_buff *oz_build_frame(struct oz_pd *pd, struct oz_tx_frame *f) > * as the space we need. > */ > skb = alloc_skb(f->total_size + OZ_ALLOCATED_SPACE(dev), GFP_ATOMIC); > - if (skb == 0) > - return 0; > + if (skb == NULL) > + return NULL; regards, dan carpenter