From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754794AbbCEJAk (ORCPT ); Thu, 5 Mar 2015 04:00:40 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:37587 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753910AbbCEJAj (ORCPT ); Thu, 5 Mar 2015 04:00:39 -0500 Message-ID: <54F81B21.3010400@st.com> Date: Thu, 5 Mar 2015 10:00:17 +0100 From: Gabriel Fernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Axel Lin , Kishon Vijay Abraham I CC: "kernel@vger.kernel.org" , Alexandre Torgue Subject: Re: [PATCH 1/2] phy: miphy28lp: Convert to devm_kcalloc and fix wrong sizof References: <1425519789.1637.4.camel@phoenix> In-Reply-To: <1425519789.1637.4.camel@phoenix> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.254.186] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-05_03:2015-03-03,2015-03-05,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Gabriel Fernandez On 03/05/2015 02:43 AM, Axel Lin wrote: > Prefer devm_kcalloc over devm_kzalloc with multiply. > In additional, use sizeof(phy) is incorrect, fix it. > > Signed-off-by: Axel Lin > --- > This patch is on top of below patch: > [PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count() multiple times > > drivers/phy/phy-miphy28lp.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c > index 4fe1755..9334352 100644 > --- a/drivers/phy/phy-miphy28lp.c > +++ b/drivers/phy/phy-miphy28lp.c > @@ -1209,9 +1209,8 @@ static int miphy28lp_probe(struct platform_device *pdev) > return -ENOMEM; > > miphy_dev->nphys = of_get_child_count(np); > - miphy_dev->phys = devm_kzalloc(&pdev->dev, > - sizeof(phy) * miphy_dev->nphys, > - GFP_KERNEL); > + miphy_dev->phys = devm_kcalloc(&pdev->dev, miphy_dev->nphys, > + sizeof(*miphy_dev->phys), GFP_KERNEL); > if (!miphy_dev->phys) > return -ENOMEM; >