From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B90D9C55179 for ; Tue, 27 Oct 2020 16:21:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6677221655 for ; Tue, 27 Oct 2020 16:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603815664; bh=ZJqjsdKlIez/izupHcMQW/SuMX9IgbuRMm3o5iN5rcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=X0lS1G6YbQZJlh4Tg4v4gtddH6AbEehvqo5/QiOVglzI41lMeRO9E564upavRUUZR wvagj7d76njz6xNzUjdSdcRgCG2Zu/RJu7DmWM9rlQ1R1dzBDe6OMnw3BD5qMXT0wr Yry4hKrrsT2ZwGKkIyZr9BeOI7VnMGM2KZcSAwKQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1805219AbgJ0QAn (ORCPT ); Tue, 27 Oct 2020 12:00:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:59510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1801324AbgJ0PkC (ORCPT ); Tue, 27 Oct 2020 11:40:02 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 104DE22283; Tue, 27 Oct 2020 15:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813200; bh=ZJqjsdKlIez/izupHcMQW/SuMX9IgbuRMm3o5iN5rcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wooLhz8E8YIaKpSi/P6GuWqA025CzEWFsl0S1rXlP9hzMtZ17AN2KLmfyEnPne+BK LM4B1wbKzd78Jqu10pOIHER8Mhp9B4CORzfcbyXOJp1B4kIDpu99Scor40XoSkVl7t 6muFu7Z3Se/P7ty5zC0IDHg8GlmPoIVYWBG2GbaU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Shixin , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.9 470/757] RDMA/mlx5: Fix type warning of sizeof in __mlx5_ib_alloc_counters() Date: Tue, 27 Oct 2020 14:52:00 +0100 Message-Id: <20201027135512.558148464@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Shixin [ Upstream commit b942fc0319a72b83146b79619eb578e989062911 ] sizeof() when applied to a pointer typed expression should give the size of the pointed data, even if the data is a pointer. Fixes: e1f24a79f424 ("IB/mlx5: Support congestion related counters") Link: https://lore.kernel.org/r/20200917081354.2083293-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/counters.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/counters.c b/drivers/infiniband/hw/mlx5/counters.c index 145f3cb40ccba..aeeb14ecb3ee7 100644 --- a/drivers/infiniband/hw/mlx5/counters.c +++ b/drivers/infiniband/hw/mlx5/counters.c @@ -456,12 +456,12 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev, cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts); num_counters += ARRAY_SIZE(ext_ppcnt_cnts); } - cnts->names = kcalloc(num_counters, sizeof(cnts->names), GFP_KERNEL); + cnts->names = kcalloc(num_counters, sizeof(*cnts->names), GFP_KERNEL); if (!cnts->names) return -ENOMEM; cnts->offsets = kcalloc(num_counters, - sizeof(cnts->offsets), GFP_KERNEL); + sizeof(*cnts->offsets), GFP_KERNEL); if (!cnts->offsets) goto err_names; -- 2.25.1