Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp271247rwi; Mon, 31 Oct 2022 00:39:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uNuPUvzoTbgBNzEQukRYxnrYy8iG4+2w5NkV88vvOLb8JwPiSKMx3y97eO/4refRDS+dp X-Received: by 2002:a17:907:7704:b0:780:da38:4480 with SMTP id kw4-20020a170907770400b00780da384480mr11866291ejc.64.1667201984723; Mon, 31 Oct 2022 00:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667201984; cv=none; d=google.com; s=arc-20160816; b=Y9SToAHNyRTLAcUEM19VC5iEkpJmeuyKCmCXzScf1VsukTaJdUkHcZ9IiSARScFEoI WP7/Xvwt06CiXlf5THAG3zzIZEM+QM7WAXg/wIlo2NcdO7vbWr+OTxEBoU3J8du+srgL 4JfQ6cngQbSmLHtZN3Dp4pRz9LsiCj00uP3wQXIJvtJh4MdoMt2duyh5+/KOuJ8WE5B8 rl7AjHjaif/Rvk1GK48mSDc1uanCc4jlagtaFYAtx/Fwo6M5XKkbmLmS/P/356iYco0i JqERq4mEcDbT9mF4hach+PozoCjmbQ9+X385bI0r8xXiCExy2Xl6B37WJ1JmvoJYT7p/ ojoA== 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=DuETVgTdcqFdoNyi9/3Y3mqFX/es9btCfO1rH6kVeQA=; b=EgtfcVtSmzcONmPA6bJgV66JUWuCY6X724RyYIcSInf1PfT947iIH2soP8mOdn0ARD rCtWmRzLuZFRL26fAPYo2VY0278evy5mkDVAeL1c7QoNEZ6dUrj2NqBaZoKygOWVGgL2 vva548cRMxX3k03s7YsxPfhjHx9FMHiSbCIMcAtiBV7HgX8oDNUTkLLi3OJgoW/CNs1H rApY8RHtWBGdfuYWrASu69BHsOm2+fmpXGlRBEhzatCIq8tTE+sHIaFYrpChv2nT26hE o9EAX4xt6VC08nz/4rjXUYnISxUeNP8QyHpR9jmg8WxY86A+FNySvpVbXYPBuO/28xwo WN7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=fT9iha+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a50eac1000000b00457263f9ee0si6809353edp.93.2022.10.31.00.39.21; Mon, 31 Oct 2022 00:39:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=fT9iha+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbiJaHWH (ORCPT + 99 others); Mon, 31 Oct 2022 03:22:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJaHWF (ORCPT ); Mon, 31 Oct 2022 03:22:05 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FE3760DB; Mon, 31 Oct 2022 00:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1667200906; bh=fEkcGv4YwJBOgvGb34R/II7LTO2Xc8lQDxRnl4xZAbQ=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=fT9iha+NV+wVMQgLXmYYJU64rPaVXitGlLxtTTyQuGnblzRH0+3ARfR5Bnr/M7woc dwuhAUny6NpdaM4ZWJMnfMtCGIyjqoOqSsuKtyU7saOPWL/a9u0JIVLJbPJTD6NdvM UJaCFByzRXgQoj8KyeTA1hayCHmcifaR4chKmEIw= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via [213.182.55.206] Mon, 31 Oct 2022 08:21:46 +0100 (CET) X-EA-Auth: OMPKm0D6NR0UfEu61VC4V3zXIgDSyaMG14J/jya0ucpUTCrwEwb+wLUV9k6tqzTYmdxtASeyttk+Bd1SMzB+Xc4ydYgQbVyz Date: Mon, 31 Oct 2022 12:41:40 +0530 From: Deepak R Varma To: Julia Lawall Cc: Greg Kroah-Hartman , outreachy@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 29, 2022 at 07:34:26PM +0200, Julia Lawall wrote: > > > On Sat, 29 Oct 2022, Deepak R Varma wrote: > > > On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote: > > > On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote: > > > > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator > > > > based computation such as sizeof(foo)/sizeof(foo[0]) for finding > > > > number of elements in an array. Issue identified using coccicheck. > > > > > > > > Signed-off-by: Deepak R Varma > > > > --- > > > > drivers/staging/fbtft/fbtft.h | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h > > > > index 2c2b5f1c1df3..5506a473be91 100644 > > > > --- a/drivers/staging/fbtft/fbtft.h > > > > +++ b/drivers/staging/fbtft/fbtft.h > > > > @@ -231,7 +231,7 @@ struct fbtft_par { > > > > bool polarity; > > > > }; > > > > > > > > -#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__}) / sizeof(int)) > > > > +#define NUMARGS(...) ARRAY_SIZE(((int[]){ __VA_ARGS__ })) > > > > > > Please please please test-build your patches before sending them out. > > > To not do so just wastes reviewer resources :( > > > > Hello Greg, > > I did build the .ko files by making the driver/staging/fbtft/ path. I verified > > .o and .ko files were built. > > > > I did a make clean just now and was again able to rebuild without any errors. > > Please see the attached log file. > > > > Is there something wrong with the way I am firing the build? > > The change is in the definition of a macro. The compiler won't help you > in this case unless the macro is actually used in code that is compiled. > Find the uses and check for any nearby ifdefs. For file foo.c you can > also do make foo.i to see the result of reducing ifdef and expanding > macros. Then you can see if the code you changed is actually included in > the build. Okay. This is helpful. I understand. Looking into the file where the macro expansion is reported to be failed. Thank you, ./drv > > julia >