Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3575534ybz; Mon, 20 Apr 2020 05:37:33 -0700 (PDT) X-Google-Smtp-Source: APiQypL6KsPlrNcgxGXEvw17kzuhiPT/vzQ/mFKpGR1E/7Tox3WFiGUivazV0lc0Yl0MD3RyvSVy X-Received: by 2002:a17:907:214d:: with SMTP id rk13mr16262488ejb.220.1587386253428; Mon, 20 Apr 2020 05:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587386253; cv=none; d=google.com; s=arc-20160816; b=mRgjqYt4UgRaX6UZCd9u1SwOBax2ac1QkAFZabWgUL8UutISSRaKicD4uGiwjZCAzn xpKadez0SS9wj6lM9DAASvIClltd1hCVo6ii1ZuEk7XVXceJeHcfchf9Bk/qsJC3Aw8b AEtEVtTgiR1ZwkwVcyIwNRjIEEyfUgPMqTc8PORKTZSYOnyU+1zrvozMJVG0vo49XkOC vKULs3n2qRHezag1zO+DapokX2PUDPQvg53P0vWujLcUlclV0RWqLr4O+KgJyfUiABa/ wFE7nPBee2ettxjb+PwE7JrlU0n5kQ+4RCRUqU/ZD34ZPbKjuIXRu6k5p5ma9Uleeyi/ yB2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=7I+8Foz1rxpYMtyPUTAEPXJfc4sW7aYwXoYzcAbZc8s=; b=XTsv976RdbeQn9ddgwx23z1cOBcZSrhiGjU1ecnWm6yk0VL+ysiumrnv8eUi3AMfsV GwHN+MQlmai3tFJlZ/h9Ok/5oL0NLtiK7iWAfJG5qrJlk2qpUHL8pZc3XNZWhvrTOh2+ 2I0CZvs2QzXwl/DTi/T/OK2FuchMmTYU7Wb/UAwCp9EF0t2Y/qXpD63Tu+SmQW6Yvdit l1cI3weW+USw0eeXW9YMVaLbayCsc4uphVQBY2DadAm7r+0MULYBl/7yRrB4WGdvKv2s AtfE5Nfp/Y2cQ76GSyaaJJS6Ge00WKXSDma5tmiNlufwEILoFEVQZXUtBVS8xUWngm73 m1sA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs4si472433ejb.275.2020.04.20.05.37.10; Mon, 20 Apr 2020 05:37:33 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbgDTMfE (ORCPT + 99 others); Mon, 20 Apr 2020 08:35:04 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52656 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726020AbgDTMfC (ORCPT ); Mon, 20 Apr 2020 08:35:02 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 42114F8280CD990CF8CC; Mon, 20 Apr 2020 20:35:01 +0800 (CST) Received: from [127.0.0.1] (10.166.213.7) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Apr 2020 20:34:59 +0800 Subject: Re: [PATCH] staging: mt7621-pinctrl: Use correct pointer type argument for sizeof To: Dan Carpenter CC: , , , , , , References: <20200420123755.4353-1-yanaijie@huawei.com> <20200420121900.GD2659@kadam> From: Jason Yan Message-ID: Date: Mon, 20 Apr 2020 20:34:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200420121900.GD2659@kadam> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.166.213.7] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2020/4/20 20:19, Dan Carpenter ะด??: > On Mon, Apr 20, 2020 at 08:37:55PM +0800, Jason Yan wrote: >> Fix the following coccicheck warning: >> >> drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c:223:14-36: WARNING: Use >> correct pointer type argument for sizeof >> >> Signed-off-by: Jason Yan >> --- >> drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c >> index d0f06790d38f..8883f2a8ea57 100644 >> --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c >> +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c >> @@ -220,7 +220,7 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) >> /* allocate our function and group mapping index buffers */ >> f = p->func = devm_kcalloc(p->dev, >> p->func_count, >> - sizeof(struct rt2880_pmx_func), >> + sizeof(struct rt2880_pmx_func *), > > Yes. This fixes a bug. We were allocating too much data. But the > prefered style is: > > sizeof(*p->func), > > Please could you resend? > Sure, I will cook a new one. > regards, > dan carpenter > > > . >