Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3563232ybz; Mon, 20 Apr 2020 05:23:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIgqOmGN+WVEszKESJnGZndPQATULpHv8raOVkQZaubX5a5qg5QWnCxP2A2/rkMe6/0EevB X-Received: by 2002:a17:906:b217:: with SMTP id p23mr15309146ejz.136.1587385389454; Mon, 20 Apr 2020 05:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587385389; cv=none; d=google.com; s=arc-20160816; b=E85n8HDcIaDtWWVaZVBPgu+YScLfMpm5Xw601g6cSytQRQxlYyUcmhx0BP9iLRqBsa tabSjTTRrjopwlkUTiM2oH0ABDHaIGQ5GYQG1TMATf4K8+BY/6VGXCR4pnbEnNkzMENt 00Gywu/qgbBb+LSEvDCOh5cj1c1m0cfGmQvy/lxRHkA+AleW0RKiYqvLwHz2VEKYfUme 8MrQ20KM+6nHQAQmb+kWKVhzKDGpkXPTgks/2RFTlKza8RKNALZJijA1sEjTh2nPAlus Qd/HP1z+lv32SLZ598PfyiMMMUb1BO4AdEosqVNyUn4kB3RvoVdOJOQMrDXDhZmVTcUh /MOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aD9qpxg5CHZYZYk+gzIw6K6GXAhalYWjG3cWxhGETdA=; b=MBeg2l6SCqmaH5Vgih5XVkP/rVbYO1tC+4xAnqjOIWe2IC7oNxU1dSlaVTGHfMwSP0 ixJi9gxK2JLGkvw3bW60e4smmHelLR9kYfXk7C88/yiiETR1GrzaOF2GPSmzgwiDL+qe DVL0s2Ch1VpFh+n0d1HS168cMieGN4/z9IdUEHnc8H9drPFEpjOgCdS8Tf7k77ENPZWc zqXgSSqDeRYLN14jUNI52kM+qetyl8n1yZyMPodeFDP+H/+xSCRQnJBpZtZceGt80ug9 Bz5LA3A7VSlo+zuKEQ/4zmHITSDqStG511ggt8kjFlqYpMWLAtC87YrXCPMuSPIact6K Umsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ODWT+u1C; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q24si393856ejz.458.2020.04.20.05.22.45; Mon, 20 Apr 2020 05:23:09 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ODWT+u1C; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726435AbgDTMVc (ORCPT + 99 others); Mon, 20 Apr 2020 08:21:32 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45894 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbgDTMVb (ORCPT ); Mon, 20 Apr 2020 08:21:31 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03KCIXSG038800; Mon, 20 Apr 2020 12:21:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=aD9qpxg5CHZYZYk+gzIw6K6GXAhalYWjG3cWxhGETdA=; b=ODWT+u1CrywSLEvva6onNWjNe+MVU4zFVNEqawZ0opl1BgvuePjLbHGxIQlnqYcJfIAg ZjQDB7mMyvRJ/FaoiSUiMCowzTpF4s4Qdnb28RQlOBD6vBWR+ICofcpXfF2m8OzVQ92E pcM39t7RtQlzhGrTmB3vFryHXvXvomN+angy0g9nWC0HsFQ7GWVAt54bAakNollIYIBf 0YYTKbO/xFJRGqx3o5cIiBAttHFFmk8ePAhb2vJ9QGeA3UYmB235OuTi/k1JNf0thhE9 wzIcrrHDVYQJLNb3febbpifMaAynkTJkkSiFpqUqhfw2QaB2SWwsCJtJCGLhR9coHcLk vg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 30ft6mxt7v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Apr 2020 12:21:13 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03KCDhGo108375; Mon, 20 Apr 2020 12:19:12 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 30gb3qbnay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Apr 2020 12:19:12 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 03KCJAdh032644; Mon, 20 Apr 2020 12:19:10 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 20 Apr 2020 05:19:09 -0700 Date: Mon, 20 Apr 2020 15:19:00 +0300 From: Dan Carpenter To: Jason Yan Cc: gregkh@linuxfoundation.org, matthias.bgg@gmail.com, nishkadg.linux@gmail.com, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: mt7621-pinctrl: Use correct pointer type argument for sizeof Message-ID: <20200420121900.GD2659@kadam> References: <20200420123755.4353-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200420123755.4353-1-yanaijie@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9596 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004200108 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9596 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1011 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004200108 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? regards, dan carpenter