From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145Ab3KON2C (ORCPT ); Fri, 15 Nov 2013 08:28:02 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:42633 "EHLO mail-ee0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352Ab3KON15 (ORCPT ); Fri, 15 Nov 2013 08:27:57 -0500 Message-ID: <5286215A.4020009@linux.com> Date: Fri, 15 Nov 2013 14:27:54 +0100 From: Levente Kurusa Reply-To: levex@linux.com User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: =?windows-1252?Q?Geyslan_Greg=F3rio_Bem?= , Caizhiyong CC: Mark Brown , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "Wanglin (Albert)" , Levente Kurusa Subject: Re: [PATCH] regmap: Fix 'ret' would return an uninitialized value References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2013-11-15 14:00 keltezéssel, Geyslan Gregório Bem írta: > 2013/11/15 Caizhiyong : >> From: Cai Zhiyong >> Date: Mon, 11 Nov 2013 19:26:14 +0800 >> Subject: [PATCH] regmap: Fix 'ret' would return an uninitialized value >> >> This patch give a warning when calling regmap_register_patch with >> parameter num_regs <= 0. >> >> When the num_regs parameter is zero and krealloc doesn't fail, >> then the code would return an uninitialized value. However, >> calling this function with num_regs == 0, would be a waste as it >> essentially does nothing. >> >> Signed-off-by: Cai Zhiyong > Reviewed-by: Geyslan G. Bem > > Seems a good approach. > The patch doesn't apply. After manually applying this it threw a compilation error: drivers/base/regmap/regmap.c: In function ‘regmap_register_patch’: drivers/base/regmap/regmap.c:2176:6: error: expected expression before ‘)’ token Cai, You have missed the second parameter of WARN_ONCE(). Please append what you'd prefer to have outputten once the condition evaluates to true. -- Regards, Levente Kurusa