Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp113353pxk; Thu, 24 Sep 2020 00:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfDcJqXasdTidRzbcIhxMlnd7z6dqri/w1Yl1sKzwLjg2x814VCeTn0m647yID0jYOmahF X-Received: by 2002:a05:6402:21e9:: with SMTP id ce9mr3281895edb.125.1600932911097; Thu, 24 Sep 2020 00:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600932911; cv=none; d=google.com; s=arc-20160816; b=fdPaTX7BmrRHoGEuKhRRrKkW7Rv1uPG2QLbpD6cEePz5S4ue5S8HRm8LZSfRg1jET/ Jvn+5aXL89Vi4f0BwWAVbXkfnrMASqfuevXY7C5TcwniQr29bzVTe/0RvzDciyrxjUrZ KrfuxYS1SKCL/Jd0afQ411Yd3qzzq6qZOvgJ47MFnjnoszfSXJCjOJIIQFr3msV4NyBN gUV9qHr/B64Mu1SVfQ6nccCG3KzevbAkQZyeA2qyhihI8DZL4wz1GuD58fLhUKh0/bpW +25Xgryw31t4vZ7Rst25MyjFOUgUyYd4rdD4drkJTecuu/0ZhI/K0e643Exj4GnT7irn 3ePw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kiO+fgs6Ve5h4RCBGtQS8AkvVbCFKZKtQnQ6I4kNBkE=; b=QntuvxAgM3h8WGRme5G0W0HaghhYsildOwyV3JKzld47JVZGnmhHXEslz9BuiEoyVY m01owmc3vQF6G4j4g5wk+EcLwnfTOJYPtlAKVA3WOXZAsE8kVeomyzN1IgS9BYV2dRsO KdxwubNDCwTLQO7Yqkm9GKuOyiIPCQaDC1a59ulmAEcImzqTw1JF+TVXJvQbeY9R9Nip 97kkk3p8BROI9qt2bRpIMy3G7U+QjfuMv/wrmrLMot7hprUiXIFIC9P90l2dbhk2QBrh 9vp51MUVLCmukp9O0V4SukGePjBIOm51NNwiqdIVW9/R6QTZkopSr2lB8hl9YTAJVsVi F9YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WbI0mMqC; 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 g6si1739618ejx.47.2020.09.24.00.34.48; Thu, 24 Sep 2020 00:35:11 -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=WbI0mMqC; 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 S1727095AbgIXHdd (ORCPT + 99 others); Thu, 24 Sep 2020 03:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbgIXHdd (ORCPT ); Thu, 24 Sep 2020 03:33:33 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5214BC0613CE for ; Thu, 24 Sep 2020 00:33:33 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id 60so2301855otw.3 for ; Thu, 24 Sep 2020 00:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kiO+fgs6Ve5h4RCBGtQS8AkvVbCFKZKtQnQ6I4kNBkE=; b=WbI0mMqCP0hE8walnGfwhKZDWdBAz1/5/o52hFGk7GMEIoEy32qVsIwxX+lixs3lNl sayw1GABk7BUBphSajcXCMtyZp12zaOPiXNByZYLat2Amo2yQ/0+FNbt27xeP9Le9mCI QCaRgTsFcrjmZxf4PR8gKIfXP8AxBgXGCpbHineljgGHevuCvhW6obYV0yMLM9CwZR3w cuMnbfe7FEdYdZ/OfwH5p0wZUscENwDPXQ3hMaYOcbc8xUD0877qQgBJ5BPemCUeAR/h LLy10fNH84dZioQT+xn1AKEjh7Pc9t+aJNL13VrvP+McPr1eWXDGtXniT9H4MzZKjA36 rpig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kiO+fgs6Ve5h4RCBGtQS8AkvVbCFKZKtQnQ6I4kNBkE=; b=REK3hIufqRI+2eSrG79hSKNa5aqj2FEqkfQXPyM6uFVTpngPZgq4Br+cPa5HIeXKW5 rTFweKlkii6driWztaEc7MRCutv19bmzrYAEQmBg7SeGnub40O7nxLLBZEkecFQJYSe9 WPXK1aPQoEoxYIxDAjb66ID8ruj0RqodXhFIk4I5XP/uPmhppshNAmipMAxkGOAOIJqo AmFiKHaxidFI5lPHjIO0wjqDGXZX/QSe3qTcHEVuRpnGvXEQeaWr13Dp/KXGTVZWipTO wyqhQ17dkp2oTshtxAy8uLGl7R7KeuQruNaK2huTMYNYkxmWqd356yGqLieIzOPKwkRl pRVg== X-Gm-Message-State: AOAM532HLaX3LGL8MeB4BYtT3dJA5EYwDo4WDlgWNGvj7yVmQoEjBMVh 7Hyr1rg6oDmLMj1WA6+EBOI2p+ELeHLzzWGWPbdqHw== X-Received: by 2002:a9d:7c7:: with SMTP id 65mr2307574oto.268.1600932812723; Thu, 24 Sep 2020 00:33:32 -0700 (PDT) MIME-Version: 1.0 References: <20200917081356.2083345-1-liushixin2@huawei.com> In-Reply-To: <20200917081356.2083345-1-liushixin2@huawei.com> From: Jens Wiklander Date: Thu, 24 Sep 2020 09:33:21 +0200 Message-ID: Subject: Re: [PATCH -next] tee: optee: fix type warning of sizeof in pool_op_alloc() To: Liu Shixin Cc: op-tee@lists.trustedfirmware.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 9:52 AM Liu Shixin wrote: > > sizeof() when applied to a pointer typed expression should gives the > size of the pointed data, even if the data is a pointer. > > Signed-off-by: Liu Shixin > --- > 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 d767eebf30bd..9fdc667b5df0 100644 > --- a/drivers/tee/optee/shm_pool.c > +++ b/drivers/tee/optee/shm_pool.c > @@ -31,7 +31,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); In this case we want an array of pointers as you also can see in the type of "pages". Thanks, Jens > if (!pages) > return -ENOMEM; > > -- > 2.25.1 >