Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262192AbTFFTAP (ORCPT ); Fri, 6 Jun 2003 15:00:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262202AbTFFTAP (ORCPT ); Fri, 6 Jun 2003 15:00:15 -0400 Received: from wohnheim.fh-wedel.de ([195.37.86.122]:21949 "EHLO wohnheim.fh-wedel.de") by vger.kernel.org with ESMTP id S262192AbTFFTAN (ORCPT ); Fri, 6 Jun 2003 15:00:13 -0400 Date: Fri, 6 Jun 2003 21:13:46 +0200 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Linus Torvalds Cc: Steven Cole , linux-kernel@vger.kernel.org Subject: Re: [Patch] 2.5.70-bk11 zlib cleanup #3 Z_NULL Message-ID: <20030606191346.GF10487@wohnheim.fh-wedel.de> References: <20030606183920.GC10487@wohnheim.fh-wedel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.3.28i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1262 Lines: 36 On Fri, 6 June 2003 11:54:45 -0700, Linus Torvalds wrote: > On Fri, 6 Jun 2003, J?rn Engel wrote: > > > > How do you feel about "if (z->state->blocks != NULL)"? Remove the > > pointless !=NULL or keep it? > > I don't mind it, but it doesn't buy much. > > It's actually in some other cases where I think there is a readability > issue, ie in more complex conditionals I personally prefer the simpler > cersion, ie I much prefer something like > > if (ptr && ptr->ops && ptr->ops->shutdown) > ptr->ops->shutdown(ptr, xxxx); > > over the pointless NULL-masturbation in something like > > if (ptr != NULL && ptr->ops != NULL && ptr->ops->shutdown != NULL) > ptr->ops->shutdown(ptr, xxxx) > > which I just is much less readable than the simple version. Good example. The ones I found in the zlib are not that bad and I am lazy, so I'll leave them for someone else. J?rn -- Courage is not the absence of fear, but rather the judgement that something else is more important than fear. -- Ambrose Redmoon - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/