Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10249473pxu; Tue, 29 Dec 2020 19:35:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzo/nnuUaSGmkHHdhXUHpAyYk4MfC+2jz5XrIRDKRZ8ojmYUUULuf1BZClA2J/HMOvO8Cfq X-Received: by 2002:aa7:c58a:: with SMTP id g10mr48212071edq.315.1609299341285; Tue, 29 Dec 2020 19:35:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609299341; cv=none; d=google.com; s=arc-20160816; b=JAjqlPBOHI7y0IfPnAyF4OFltNB+wa6W9VdjlxUmswo5f4vvleYsCH5tgV5Fi17hKI X/jd+XhjuTivs58SFvqyHVmtil9H/SOxUBxg4Pcuw+9Hg+kGJ2UyqDkgoUxIrUI5VR1C LWfISPFcKBLops/uK81e4MsvD52gyT4/3wIYbwRNPgYo+hWMaSuuxKKYTcWEBK2X4nIS 81LNbGYbVwCI0Q8WLeBjjiLy3Gj8AiXLQ8JtMiajiscBMfLCJ5T8NjRInvdDv5EdT6qL S18GEGRQxLavdkqAZ0XQU4UBSgjXo/M8XGs205/t0iF1pJuSEW9BSjK65XCQAvwjTmNF qw5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=B3Mt7Vge4rOYCuATbNhfM4ylo5AR8DxmvdDf9ze0ORs=; b=pqX7YrJuG77Dxjx5ir70qOZqZ31QdOwVTh95qvyWmMMPq3H9Per3WdE8NQ0YcSYEZG yuxVp3C1vwkogiI/uMYXC7x8XxR0JkIqkxXrko1JrSIB4s6K4tLUQtaZzZV6eew0ZuY2 ZC+kJlyQlMQiCPEdMXe/HoDhOvki1k68upbeL1hqK8ERp7Cn66YhHD945SOTwG9RqyIw vhQFv766PtpozKSXuZYhEPHY74KctBMQFlESyrvaTI/UHxY7rEXoC5V93sCRQns3asQ3 bV+TMFPMbfMCY+noso8l91ePtu5VPDFcY4qhg4Mx3BGouGsDIfRSHUrmVp/9XzHmX4h5 t3VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pLTpME5p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si21182349ejj.354.2020.12.29.19.35.17; Tue, 29 Dec 2020 19:35:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pLTpME5p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726178AbgL3DeM (ORCPT + 99 others); Tue, 29 Dec 2020 22:34:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgL3DeM (ORCPT ); Tue, 29 Dec 2020 22:34:12 -0500 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55DFC061799 for ; Tue, 29 Dec 2020 19:33:31 -0800 (PST) Received: by mail-il1-x135.google.com with SMTP id w17so13778253ilj.8 for ; Tue, 29 Dec 2020 19:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=B3Mt7Vge4rOYCuATbNhfM4ylo5AR8DxmvdDf9ze0ORs=; b=pLTpME5psErfd7pgyRN5Ufaet1tygProILi68YE97K5ERpbjMupWDA7yBpeRswlo3f rv2NsyuiE3ItWMS7A4IkTT9wM2gbfEv1kBuIwU5sL0EeTE2xrbCLPO63RXK0at/TcyQd AVvOQUTj6EPRaaBiPFDx4Eet6X5SsIqnt9MAA55HXRT4AM4SjtFdnO0659LfuB63lMeD JgM1nRpsG6H5t1FRNVd6dl4tu/Y/Mnjs8KcyGVuafPO1KdMGpn31t8x06pVSNnQP1Dcy PLHVSNvmokyMV4UjohdfV/JrVvw+cWE2mayjQ9HQdd2kMM00AsuK9Cy+Oq4grfsu9M+7 St+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=B3Mt7Vge4rOYCuATbNhfM4ylo5AR8DxmvdDf9ze0ORs=; b=NTIE9izukDd0EKfD0gyWXRaeZSt+thkfmrDrzpbez4wo3Oo0E6Qv3WCD5BE+4JWuNs ZUoEvBWY8eqFldlhjJOPHkFHhuOSK+QmSsqy+hDlqa+vibgdsKpvhamYfZhr918Nejki OiNS8vqa8jRcnkrjbuNQETbKYZniexGodkDaaBGt63fng+qgAMFGAu6wyMiWSGuoejM/ akmGyGeEujrQsmWMBd8JxRzb+Pd8YYc8bNvuIfzLyr7k+HMRCaSdK4VMpJ/xGZEs7M7K 6mDRZqAuwExhf1amg410ZtLQmzYepU19hioOKQk/spqVTQdnlzEUMncez6nbo0NUo7LL MWog== X-Gm-Message-State: AOAM533qhn0/uRqw8C80WSR2dZRhLW2fPtkZtPzzSnQBaU65PJ6ISfZU c4enIi1cMZ4t6OMttjwlWDSC9pgdT8lowQ== X-Received: by 2002:a05:6e02:20e6:: with SMTP id q6mr21255757ilv.272.1609299210959; Tue, 29 Dec 2020 19:33:30 -0800 (PST) Received: from [172.22.22.4] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id f13sm27380119iog.18.2020.12.29.19.33.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Dec 2020 19:33:30 -0800 (PST) Subject: Re: [PATCH v2 -next] staging: greybus: light: Use kzalloc for allocating only one thing To: Zheng Yongjun , rmfrfs@gmail.com, johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <20201230013706.28698-1-zhengyongjun3@huawei.com> From: Alex Elder Message-ID: Date: Tue, 29 Dec 2020 21:33:29 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201230013706.28698-1-zhengyongjun3@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/29/20 7:37 PM, Zheng Yongjun wrote: > Use kzalloc rather than kcalloc(1,...) > > The semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > @@ > > - kcalloc(1, > + kzalloc( > ...) > // > > Signed-off-by: Zheng Yongjun Looks good. Reviewed-by: Alex Elder > --- > drivers/staging/greybus/light.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c > index d2672b65c3f4..87d36948c610 100644 > --- a/drivers/staging/greybus/light.c > +++ b/drivers/staging/greybus/light.c > @@ -290,8 +290,7 @@ static int channel_attr_groups_set(struct gb_channel *channel, > channel->attrs = kcalloc(size + 1, sizeof(*channel->attrs), GFP_KERNEL); > if (!channel->attrs) > return -ENOMEM; > - channel->attr_group = kcalloc(1, sizeof(*channel->attr_group), > - GFP_KERNEL); > + channel->attr_group = kzalloc(sizeof(*channel->attr_group), GFP_KERNEL); > if (!channel->attr_group) > return -ENOMEM; > channel->attr_groups = kcalloc(2, sizeof(*channel->attr_groups), >