From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbbIKCvN (ORCPT ); Thu, 10 Sep 2015 22:51:13 -0400 Received: from smtprelay0161.hostedemail.com ([216.40.44.161]:50874 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751904AbbIKCvL (ORCPT ); Thu, 10 Sep 2015 22:51:11 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3351:3622:3865:3867:3868:3870:3872:3873:4250:4321:5007:6261:10004:10400:10848:11026:11232:11657:11658:11914:12043:12296:12517:12519:12740:13069:13071:13255:13311:13357:13972:21060:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: order32_7e669ec86943f X-Filterd-Recvd-Size: 1786 Message-ID: <1441939867.15135.2.camel@perches.com> Subject: Re: [PATCH 10/16] Staging: lustre: obdclass: genops.c: Remove explicit NULL comparison From: Joe Perches To: Shraddha Barke Cc: Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , Julia Lawall , HPDD-discuss@ml01.01.org, linux-kernel@vger.kernel.org Date: Thu, 10 Sep 2015 19:51:07 -0700 In-Reply-To: <1441937051-2546-4-git-send-email-shraddha.6596@gmail.com> References: <1441937051-2546-1-git-send-email-shraddha.6596@gmail.com> <1441937051-2546-4-git-send-email-shraddha.6596@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 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 On Fri, 2015-09-11 at 07:34 +0530, Shraddha Barke wrote: > Remove explicit NULL comparison and write it in its simpler form. > Replacement done with coccinelle: Hi Shraddha. If you are going to do these conversions, please also do the equivalent != NULL conversions: - e != NULL + e > diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c [] > @@ -178,9 +178,9 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, > - if (type->typ_dt_ops == NULL || > - type->typ_md_ops == NULL || > - type->typ_name == NULL) > + if (!type->typ_dt_ops || > + !type->typ_md_ops || > + !type->typ_name)