Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2795042ybk; Mon, 18 May 2020 08:06:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydN2BdBS8pVcQjkHxSES4fmPJoR8Ct78iCDiCg+pjmQEd963Z0z80leLqHo3GrvJ9mXn2H X-Received: by 2002:a50:c60c:: with SMTP id k12mr13526552edg.111.1589814397979; Mon, 18 May 2020 08:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589814397; cv=none; d=google.com; s=arc-20160816; b=0tGwYbsz421GO3Uhvw+xnC3IHb7UqMOKnqJvPa5wiyvQSqUMrnohY85prJJ5h8w8T9 zloE9/YdhJkk3X0xfexxUiAh1gsFdtoDkGkRyVAgn5Iiu/F/wvYh+qFo2ZE2qcb6QBy6 8BbWy7IdMcCKT1FGnJXHFnvKKE6Iy3Pl2GRyyEuGmbFlBG9G8NUI4MGLYffQOey/mlts zF3Zy6ndoGGC83EkZxi6/lWreBgNeIjgtCW6kIRyw8G6PR0k334XwEFvY6RzGor4sENy Sntb/DaTPhZvnK7oJ9dGD0o/IJSKMqd8PSCrx1RXJDYuYnp60nLyagMFq6lY5+dVN/uz AZHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=WgmxNih5o7lZXHfbWl9I3AtHRbIULLMSDkl7rFCTknE=; b=T+G1T71xLYgoJuuge3R/mlyFi+PlrIxQdK+gNxeCs8V0yNEpDqKOY4doZ8/wokeKva L3H7ZNX2188cpxb1uevSHjgzrfx/vR8FNzPb6cWYAyauzcm9Y1GKaJhI0AR7ZqPGzHNW 3T3gprCiEaLv7Q/p9bNeWRAjsKXyjA6NzIbBSICo3VDkAkglBaL/HDKGcw25ZTmFXE99 9H1ImUUwNXw02dw74tE2fMSVeGCWzL5znOVNPXN3heTyZ9uik9aRYJhLMjjv8T4ZdJD9 +hkbadqnwui/Fd7LbxPfGfJiLibMoDGFIYzHvUkbBIjVmBxAzCeq9fK/1rvSiGzGg6oJ hToQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s37biS52; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si7507010ejo.520.2020.05.18.08.06.12; Mon, 18 May 2020 08:06:37 -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=@gmail.com header.s=20161025 header.b=s37biS52; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728275AbgERPDx (ORCPT + 99 others); Mon, 18 May 2020 11:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbgERPDx (ORCPT ); Mon, 18 May 2020 11:03:53 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15E39C061A0C for ; Mon, 18 May 2020 08:03:51 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id z15so78915pjb.0 for ; Mon, 18 May 2020 08:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WgmxNih5o7lZXHfbWl9I3AtHRbIULLMSDkl7rFCTknE=; b=s37biS52LBSY4wjTk2uU75fo73grJe1Bprmn0WzYTdY+9jDKJUKnntDV2RhFYAu/Sw IYtmt4gYUF7Wc2sC3ZWKv8Qjq7ij33/F0YhqVmq2J24OAEZ3GnVJ/PNVvwCUzyvGSnQE 6h4tj2fhO7alMmc/2bNlGXAyKFeUmFtYmltJOhp3qJ/yfcQUKXASbXIYGGzwCwGPqTva 7DemjyYkUBCQJwHxoy7eVVIGcG9Xbi4aA0tUc+raEElr8dprKQLZ092YUuAXWckSMf+h r82jJexcn2WUIz4Q7f63qmWoeU8VMFzVgrG+QmJCLRpI4J42vjz6jzmFmDLDbkOrINZd DiXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WgmxNih5o7lZXHfbWl9I3AtHRbIULLMSDkl7rFCTknE=; b=o9LjCywsxKWU+T7EQ8GNoTg+zVknc2h7xPFa8Zt/dEaymsfTjaOyzvG7p6XP0gbGol +Zbbld1byyDiG9uuRyal93pulwmxXhXlE7FGIU0b50ja1DEEazLhSMoU5VPXp2ldWyws PELzvKnVLOjSZGYgeJqQaGH7uL6i1mWyWAwA0p3SOQsXBgteZC9s4qB1NQs8fbj+aG8v hV4DXXmc5dfkGMq4Se5IX07bJqzGLdha0HDTLW7d+xdgawm3DdRpWwEfQRbyFuJsEFk7 zNqUzzNzscQa7yNnYUdnOOJt6P2JqiTZOR5F0OBdocP6NLZejQkj1uLtIwdSIN40hUqC RN7g== X-Gm-Message-State: AOAM533yz3fhgCr7tdcECt4nVRs9NstLnXQfYvz+i5g8S/lUA/DEhAMx kVbDURo0++1HE9LGmm+2SnM= X-Received: by 2002:a17:902:7682:: with SMTP id m2mr10535509pll.281.1589814230632; Mon, 18 May 2020 08:03:50 -0700 (PDT) Received: from localhost.localdomain ([2409:4072:418:e389:dd54:a815:71b4:fdc]) by smtp.gmail.com with ESMTPSA id 7sm6329586pfc.203.2020.05.18.08.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 08:03:49 -0700 (PDT) From: Aishwarya Ramakrishnan To: Zhenyu Wang , Zhi Wang , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: aishwaryarj100@gmail.com Subject: [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types Date: Mon, 18 May 2020 20:33:36 +0530 Message-Id: <20200518150336.15265-1-aishwaryarj100@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prefer ARRAY_SIZE instead of using sizeof Fixes coccicheck warning: Use ARRAY_SIZE Signed-off-by: Aishwarya Ramakrishnan --- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c index 1d5ff88078bd..7d361623ff67 100644 --- a/drivers/gpu/drm/i915/gvt/vgpu.c +++ b/drivers/gpu/drm/i915/gvt/vgpu.c @@ -124,7 +124,7 @@ int intel_gvt_init_vgpu_types(struct intel_gvt *gvt) */ low_avail = gvt_aperture_sz(gvt) - HOST_LOW_GM_SIZE; high_avail = gvt_hidden_sz(gvt) - HOST_HIGH_GM_SIZE; - num_types = sizeof(vgpu_types) / sizeof(vgpu_types[0]); + num_types = ARRAY_SIZE(vgpu_types); gvt->types = kcalloc(num_types, sizeof(struct intel_vgpu_type), GFP_KERNEL); -- 2.17.1