From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753615Ab1HTNFL (ORCPT ); Sat, 20 Aug 2011 09:05:11 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:46403 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314Ab1HTNFH (ORCPT ); Sat, 20 Aug 2011 09:05:07 -0400 Subject: [PATCH] ASoC: soc-cache: Avoid a redundant test for codec->reg_def_copy From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org, Dimitris Papastamos Content-Type: text/plain; charset="UTF-8" Date: Sat, 20 Aug 2011 21:04:58 +0800 Message-ID: <1313845498.2619.1.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Axel Lin --- sound/soc/soc-cache.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index fdfd488..d620147 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -727,13 +727,11 @@ static int snd_soc_lzo_cache_init(struct snd_soc_codec *codec) * and remember to free it afterwards. */ tofree = 0; - if (!codec->reg_def_copy) - tofree = 1; - if (!codec->reg_def_copy) { codec->reg_def_copy = kzalloc(codec->reg_size, GFP_KERNEL); if (!codec->reg_def_copy) return -ENOMEM; + tofree = 1; } blkcount = snd_soc_lzo_block_count(); -- 1.7.4.1