Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp269387pxb; Thu, 2 Sep 2021 03:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/g5tlW4qxIcHQ3wxNtlmBUFWnda88sKL38BK1ZOaMaXK1iqVm3N6raDCd/cegAG74F66c X-Received: by 2002:a92:cb4d:: with SMTP id f13mr1939090ilq.220.1630580030113; Thu, 02 Sep 2021 03:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630580030; cv=none; d=google.com; s=arc-20160816; b=He6/xGJO2LG/BKhuhWdqBj1lKyD8pj02qZAxSHcVEO2b1meFzAmTaBfaNjkGe6F2co ELfedMO+Zo0tIofof3p3sBohyQLypN6g70stt8XFXtEG81qH7ZnVrjKZT4bS0Us7KKIR /h7S/3jE4sZI5688b9LTTn1g5R+dpbZW08OsCNYevCiFHHTZ2eG/u++At4IV+8N/f52l pbryNhr7e+GX3McwcqOZ/TVjxbCG7DKiI1DlzmAHVQAoJ5jXPC/FH57DDrwo/BlDuHsk QQE9Bqm86I5oVRnicwoPk1VOs7Ki1exFg9EltwDfw3P8RnwYLJS/Sa5ICLtMSm4xE7MQ Sx8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wv3yG8UonDy2C4uqmvlaNx323WtksVFXoFNswtxsVYo=; b=TDWt4JKiOyv7ExXzmx0L8eHiMITg4XTVJsMcxZIaPcmD5FaGqRLMT+hg+HO1VNkjiM FNBHK74r9hzJu9vuRzNFgEhZDaX+3QuFaMaPNWyuIfCUjLRFaQHUYnZMf/6nvONQcc9+ Wm1BbrJOcS6nn8lL4vGcLxmKRDBvFJYEsjb2p8HeQ7LpBMGTqqH/V3TYvfvE2XiUpZSA QOjQZe14KLk4io5Umzjo4ZJxnGV77lTdDSwtjO/SBNgjo3HnKR9X4siGRpku8G0yZ1rd z8ZqoVaXN6rC0NSWnqoQYM2xjGmy2+wUtiD5RU6l2HuvwD9gWn/6dkHAD/NVid6iXpsB TgTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mko8j91K; 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 s14si1820115iln.136.2021.09.02.03.53.37; Thu, 02 Sep 2021 03:53:50 -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=@linaro.org header.s=google header.b=Mko8j91K; 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 S233756AbhIBKfd (ORCPT + 99 others); Thu, 2 Sep 2021 06:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233714AbhIBKfb (ORCPT ); Thu, 2 Sep 2021 06:35:31 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE70AC061575 for ; Thu, 2 Sep 2021 03:34:32 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id n5so2090579wro.12 for ; Thu, 02 Sep 2021 03:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wv3yG8UonDy2C4uqmvlaNx323WtksVFXoFNswtxsVYo=; b=Mko8j91K9w3jzTvp/k1lQBtZGMhGwDuY4cJRhKuSj25A0k+y9tZqD8tQg6FNrO/VlR SOfSGFKbEfzCCH34WdDMZSgLb+dEdHWb5xRlCFKrEgp2llsiWqY54pbyLOlfTcKvptrC 167GOyjDQDkTWb5+5UCn9ojwYdQu3mkBAhvuVTx6MmI7Ukl/IbJ2zXZviIUMp+/uhUyW aPzfZKLa6sgh0adSMKqG3fFG+evqOkiasO5iymtHk/2sijwfkOojjicBVDT1VGlEfoma LZwLMHRtEcrQn3+hbfAD2ealCxsPvH24qVX+X3RJwnhUUrgCLRyWwreQFcuKOcOgkB4w 3evQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wv3yG8UonDy2C4uqmvlaNx323WtksVFXoFNswtxsVYo=; b=oQlipPyGx7iARMhp9PnfNkaSt7Cmx281PtWJmuy5hzF53nGNnpgjXJe8V4pQ8iYay5 E7eTRIJ77Q6wizU7TPB3KSZ0Yzo7ynDp5FvsJ23lnlwKh303EAnx7ZJCKInj/9uJlIVg 7ITcYhKfIO5uMTpVEBu329hMK+99sJc4JeEnKjzlVfN33j37V3E9wPSuieoHO2g9ivdF oPSOJFDi+X0Nkh7/CQAq9VPHdU3eYzRqtlCNjNRV5W88qi+gXCRMfo5LpepU0cVaXEQO DODxOrfB51d3zTTJDmXQAU/MQzOItT+PJ0z95Enh6iNi9YwBaUgBIaypUp8MC1IVRTfo vc6A== X-Gm-Message-State: AOAM530UpFPcSDtA6mLNrL4FLkWj1WkBo9mDtYG7xMw5rNLgYK7sF57E ilZtW9ZS4yRhUey2H5Bwz2MA0Q== X-Received: by 2002:adf:edc2:: with SMTP id v2mr2860902wro.255.1630578871371; Thu, 02 Sep 2021 03:34:31 -0700 (PDT) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id g1sm1516409wmk.2.2021.09.02.03.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 03:34:30 -0700 (PDT) Date: Thu, 2 Sep 2021 11:34:28 +0100 From: Daniel Thompson To: CGEL Cc: Jens Wiklander , Sumit Garg , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, jing yangyang , Zeal Robot Subject: Re: [PATCH linux-next] tee/optee/shm_pool: fix application of sizeof to pointer Message-ID: <20210902103428.bdbkybvi6he6mgy2@maple.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 19, 2021 at 08:21:27PM -0700, CGEL wrote: > From: jing yangyang > > sizeof when applied to a pointer typed expression gives the size of > the pointer. > > ./drivers/tee/optee/shm_pool.c:38:28-34: ERROR application of sizeof to pointer > > This issue was detected with the help of Coccinelle. > > Reported-by: Zeal Robot > Signed-off-by: jing yangyang This should not affect code generation since both pages and *pages are pointers but the change looks good to me. Reviewed-by: Daniel Thompson > --- > drivers/tee/optee/shm_pool.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tee/optee/shm_pool.c b/drivers/tee/optee/shm_pool.c > index c41a9a5..d167039 100644 > --- a/drivers/tee/optee/shm_pool.c > +++ b/drivers/tee/optee/shm_pool.c > @@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, > unsigned int nr_pages = 1 << order, i; > struct page **pages; > > - pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL); > + pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); > if (!pages) { > rc = -ENOMEM; > goto err; > -- > 1.8.3.1