Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753159AbbGBKTA (ORCPT ); Thu, 2 Jul 2015 06:19:00 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:49502 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753290AbbGBKSx (ORCPT ); Thu, 2 Jul 2015 06:18:53 -0400 Date: Thu, 2 Jul 2015 11:18:49 +0100 From: Charles Keepax To: Maninder Singh Cc: lgirdwood@gmail.com, broonie@kernel.org, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, pankaj.m@samsung.com Subject: Re: [PATCH v2] regulator: wm831x-dcdc: Use pointer after NULL check Message-ID: <20150702101849.GB16517@opensource.wolfsonmicro.com> References: <1435823829-3174-1-git-send-email-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435823829-3174-1-git-send-email-maninder1.s@samsung.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 804 Lines: 22 On Thu, Jul 02, 2015 at 01:27:09PM +0530, Maninder Singh wrote: > pdata is used before NULL check, so it looks misleading. > If pdata validation is required then we have to > first check for pdata validation, then calculate id, > and then second check for pdata->dcdc[id]. > > and it is better to use !pointer than (pointer == NULL) > > Signed-off-by: Maninder Singh > --- The patch basically looks fine, but it feels a bit like needless churn. The current code is perfectly correct and feels clear enough to me. Thanks, Charles -- 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/