From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750891AbdJBHnw convert rfc822-to-8bit (ORCPT ); Mon, 2 Oct 2017 03:43:52 -0400 Received: from mga03.intel.com ([134.134.136.65]:4250 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbdJBHnv (ORCPT ); Mon, 2 Oct 2017 03:43:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,468,1500966000"; d="scan'208";a="905782077" From: Jani Nikula To: =?utf-8?B?SsOpcsOpbXk=?= Lefaure , Alex Deucher , Christian =?utf-8?Q?K=C3=B6nig?= , David Airlie , Patrik Jakobsson , Zhenyu Wang , Zhi Wang , Joonas Lahtinen , Rodrigo Vivi , Ben Skeggs Cc: =?utf-8?B?SsOpcsOpbXk=?= Lefaure , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH 06/18] drm: use ARRAY_SIZE In-Reply-To: <20171001193101.8898-7-jeremy.lefaure@lse.epita.fr> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20171001193101.8898-1-jeremy.lefaure@lse.epita.fr> <20171001193101.8898-7-jeremy.lefaure@lse.epita.fr> Date: Mon, 02 Oct 2017 10:43:18 +0300 Message-ID: <871smm6lm1.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 01 Oct 2017, Jérémy Lefaure wrote: > Using the ARRAY_SIZE macro improves the readability of the code. Also, > it is not always useful to use a variable to store this constant > calculated at compile time nor to re-invent the ARRAY_SIZE macro. > > Found with Coccinelle with the following semantic patch: > @r depends on (org || report)@ > type T; > T[] E; > position p; > @@ > ( > (sizeof(E)@p /sizeof(*E)) > | > (sizeof(E)@p /sizeof(E[...])) > | > (sizeof(E)@p /sizeof(T)) > ) > > Signed-off-by: Jérémy Lefaure Please split this up. Patch 1: > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 +++++---- > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9 +++++---- Patch 2: > drivers/gpu/drm/gma500/psb_intel_sdvo.c | 9 ++++----- Patch 3: > drivers/gpu/drm/i915/gvt/vgpu.c | 3 ++- Patch 4: > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 7 ++++--- Patch 5: > drivers/gpu/drm/via/via_verifier.c | 10 ++++------ BR, Jani. -- Jani Nikula, Intel Open Source Technology Center