Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752794AbdLGRY6 (ORCPT ); Thu, 7 Dec 2017 12:24:58 -0500 Received: from smtprelay0149.hostedemail.com ([216.40.44.149]:38892 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754944AbdLGRYy (ORCPT ); Thu, 7 Dec 2017 12:24:54 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2731:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:4250:4321:4552:5007:6119:7903:9207:10004:10400:10848:11026:11232:11657:11658:11914:12043:12296:12555:12740:12760:12895:13069:13255:13311:13357:13439:14096:14097:14181:14659:14721:14777:14915:21080:21433:21451:21627:30022:30054:30064:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: silk08_47432000b2807 X-Filterd-Recvd-Size: 2371 Message-ID: <1512667487.960.46.camel@perches.com> Subject: Re: [PATCH] staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap() From: Joe Perches To: "gregkh@linuxfoundation.org" , Andrii Vladyka Cc: "Dilger, Andreas" , "Drokin, Oleg" , "jsimmons@infradead.org" , "lustre-devel@lists.lustre.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Date: Thu, 07 Dec 2017 09:24:47 -0800 In-Reply-To: <20171206085303.GA18289@kroah.com> References: <7A48E652-421B-464B-AD2A-C3D5613B48E5@intel.com> <20171206085303.GA18289@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 27 On Wed, 2017-12-06 at 09:53 +0100, gregkh@linuxfoundation.org wrote: > On Mon, Dec 04, 2017 at 12:44:32PM +0200, Andrii Vladyka wrote: > > Change 0 to NULL in lov_object_fiemap() in order to fix warning produced by > > sparse > > > > Signed-off-by: Andrii Vladyka > > Signed-off-by: Andreas Dilger > > --- > > > > diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c > > index 105b707..897cf2c 100644 > > --- a/drivers/staging/lustre/lustre/lov/lov_object.c > > +++ b/drivers/staging/lustre/lustre/lov/lov_object.c > > @@ -1335,7 +1335,7 @@ static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj, > > int rc = 0; > > int cur_stripe; > > int stripe_count; > > - struct fiemap_state fs = { 0 }; > > + struct fiemap_state fs = { NULL }; > > lsm = lov_lsm_addref(cl2lov(obj)); > > if (!lsm) > > Patch is corrupted, and can not apply, please fix up your email client > and try it again. It would be better to use {} to clear the struct rather than any member initialization.