From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919AbYIZOqS (ORCPT ); Fri, 26 Sep 2008 10:46:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752749AbYIZOqC (ORCPT ); Fri, 26 Sep 2008 10:46:02 -0400 Received: from cantor.suse.de ([195.135.220.2]:36730 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752737AbYIZOqA (ORCPT ); Fri, 26 Sep 2008 10:46:00 -0400 Date: Fri, 26 Sep 2008 16:45:54 +0200 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Julien Brunel , Geoffrey Wossum , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] sound/soc/at32: Useless NULL test In-Reply-To: <20080926140021.GD15493@sirena.org.uk> References: <200809261523.46747.brunel@diku.dk> <20080926140021.GD15493@sirena.org.uk> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.2 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Fri, 26 Sep 2008 15:00:23 +0100, Mark Brown wrote: > > On Fri, Sep 26, 2008 at 03:23:46PM +0200, Julien Brunel wrote: > > > The test (ssc != NULL) can only be reached if the call to the function > > ssc_request, the result of which ssc is assigned, succeeds. Moreover, > > statements assign NULL to ssc just before a return, which is useless > > since it is a local variable. So, we suggest to delete the test and > > the two assignments. > > Acked-by: Mark Brown Applied now. Thanks. > For future reference if you're submitting other similar things (which I > guess you will given that you've got a tool to check for this stuff) > it'd be helpful if you could rewrite the explanation for the NULL test > to be something like: > > The test (ssc != NULL) is redundant since it can only be reached > when ssc is guaranteed to have been set to a valid ssc. > > which is much easier to parse. Agreed :) Takashi