Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp427777iog; Thu, 30 Jun 2022 03:36:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZlYmP7lBvsH4f3eTeYKx/B+xq1mhJaA9scUds+jmZUJRdqY/nBs7+cKKbQW6+/ieU1Rzs X-Received: by 2002:a63:b54c:0:b0:40c:7b84:4f7f with SMTP id u12-20020a63b54c000000b0040c7b844f7fmr6923721pgo.586.1656585404293; Thu, 30 Jun 2022 03:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656585404; cv=none; d=google.com; s=arc-20160816; b=o6mjTZkdFW6gt/UlANpw5BKDmXCVTu/EPrZ7bu7hdFZ2+yfP0Fq2xQzza4rwaZx5Pa aBbjN0mAYyaOjfnCfQtreNwgAr8RToOtGtUZDyqfgM5OrWvMaTI2sbI25PWgFqXyqO+8 w/2PAUWlUpOJ6WUe1sXeh+YzcY26+GV0B3/fV2RavGVtPVOENt/PcqHUgB9mzJluKdf/ +0FGEicrc3LHUrquqZaR3PwH8w69NSuCma1oZRB2IHTk3+XhTPBpMC8dAMqWa2GQ47d7 90jnDSUX1fDzt0ZitYg7eFMd66H1qxEyhPFDPq++yJLx8Yc/DdgK6aI/i1iuJcEIndpQ Wxgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aEi52rAKRZGKuKlHNzJFi9trcKiCjqJ5mBhWrvY9RWU=; b=q0DRrwJkx5qV4AOpowC/0JmpvAJ23Geui++ILc8XZCJOJU8xE+2jCUIrdjqivE5tqq N2N4bSMmeHAVIyFlAL+XGGPLrkKAiTBzk6at41kMH+qu6MrA1osTJS1DdV6FryeQT30Y +V/fzPIG7jHrhP0E15CbWU9+UFwpT29BsgkmzTxJIxA6VSgeuGODzeh95gRFCh8UEOP3 sgVxupekS6vhEPfl0hZH3ue5KKxxsTTtwTyTd4bliLB14x3yCmw6yUkHa+00mCow/qme eeJ9ywgMisD/EnX6B0jBhzIbge+07UuUFDTUDHpXaV8GaSUY8oK0r2LXsR4f3+h8D8y4 zd0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QOYuiKTo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a170902b41000b00168b5f74595si24048910plr.260.2022.06.30.03.36.31; Thu, 30 Jun 2022 03:36: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=pass header.i=@gmail.com header.s=20210112 header.b=QOYuiKTo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234746AbiF3KJx (ORCPT + 99 others); Thu, 30 Jun 2022 06:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbiF3KJw (ORCPT ); Thu, 30 Jun 2022 06:09:52 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA641273; Thu, 30 Jun 2022 03:09:51 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id q9so26520468wrd.8; Thu, 30 Jun 2022 03:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=aEi52rAKRZGKuKlHNzJFi9trcKiCjqJ5mBhWrvY9RWU=; b=QOYuiKTo/xpDNF6RQC0OLHZ7XjOmumfqnu32brFBuO91B4NyETFc0Eb9gABmnPngTe JH+sgookHLXrrEZKrKaesZXRAcYnNySeby0ml6OasS8i1zjH8coF0u6uqQOizr3IYrQs Pz54+FIRsup3ZyLbtZdmZIN/YNqVIbvVB2c3h3QLPCadQgBt/Hh7rUi7vQm5jd3G8HJj 4czLIE0lhhzOUT+YQ7TGNJnL3N5hs6o8DR41OeI+ed2VndZJYu3ruSTadTqESO0iPSW4 9rmrnqhp4/nq4QWlP1kmq7As03PlmD4mEI30Iiwey9jtNBZ17oGCIT34QmBf/bB4YW7k R3rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=aEi52rAKRZGKuKlHNzJFi9trcKiCjqJ5mBhWrvY9RWU=; b=BFA3kJkyEVdBxlxJPk1kA/qOR8AJ5o63GLZiWPp/hn7sBW5dD8c19EdIR3UTmo6KRT jVTCkKi0NOyVGs4joxmkurwafZK/XHfk8fCgnp2iYjf60ISsQ6mqpKH+xJ08Z3L97z/R ZRxkoUYkBUk6i/NBMNwwBBGYHltC6DaPSJF7/H9zR8iewclmB8mZkg8E4GxJIseBdnnm kBor2qQvfDw9djbgNYt+/LIzQkfxsxoyRe+xQhlzrOOMZJWf9orUTHjQXYs/PAU5MIhC BYLSQouJh3X+RQYsCPFlF/QeZkJw21vkgDidYoiZRnkq913kVwKxqg5z6rUBZXvUm0Nw k4Uw== X-Gm-Message-State: AJIora+CG5vUH/EbMJFPIp2bbY8VPJIl0+qmXplPkqvNXzxfcSAVXECl RnqE2PLsIagFrwkZF7ADgmc= X-Received: by 2002:a5d:526b:0:b0:21a:3c94:cf36 with SMTP id l11-20020a5d526b000000b0021a3c94cf36mr7299419wrc.535.1656583790131; Thu, 30 Jun 2022 03:09:50 -0700 (PDT) Received: from [192.168.0.14] (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c020c00b003a04b0bcb43sm5959334wmi.40.2022.06.30.03.09.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jun 2022 03:09:49 -0700 (PDT) Message-ID: <7bc81026-957e-caf9-c04b-7ad3b9b5d367@gmail.com> Date: Thu, 30 Jun 2022 11:09:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v4 1/6] media: ov5693: count num_supplies using array_size Content-Language: en-US To: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Jacopo Mondi , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220630074525.481790-1-tommaso.merciai@amarulasolutions.com> <20220630074525.481790-2-tommaso.merciai@amarulasolutions.com> From: Daniel Scally In-Reply-To: <20220630074525.481790-2-tommaso.merciai@amarulasolutions.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hello - sorry, hadn't had much time to look  at this series. On 30/06/2022 08:45, Tommaso Merciai wrote: > Instead of hardcode OV5693_NUM_SUPPLIES in a define is better use > ARRAY_SIZE function to count the number of supplies from > ov5693_supply_names array > > Signed-off-by: Tommaso Merciai > Reviewed-by: Jacopo Mondi Reviewed-by: Daniel Scally > --- > Changes since v3: > - Add reviewed-by tag, suggested by Jacopo, Krzysztof > > drivers/media/i2c/ov5693.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c > index 117ff5403312..f410333c4c67 100644 > --- a/drivers/media/i2c/ov5693.c > +++ b/drivers/media/i2c/ov5693.c > @@ -127,11 +127,15 @@ > #define OV5693_LINK_FREQ_419_2MHZ 419200000 > #define OV5693_PIXEL_RATE 167680000 > > -/* Miscellaneous */ > -#define OV5693_NUM_SUPPLIES 2 > - > #define to_ov5693_sensor(x) container_of(x, struct ov5693_device, sd) > > +static const char * const ov5693_supply_names[] = { > + "avdd", /* Analog power */ > + "dovdd", /* Digital I/O power */ > +}; > + > +#define OV5693_NUM_SUPPLIES ARRAY_SIZE(ov5693_supply_names) > + > struct ov5693_reg { > u32 reg; > u8 val; > @@ -352,11 +356,6 @@ static const s64 link_freq_menu_items[] = { > OV5693_LINK_FREQ_419_2MHZ > }; > > -static const char * const ov5693_supply_names[] = { > - "avdd", > - "dovdd", > -}; > - > static const char * const ov5693_test_pattern_menu[] = { > "Disabled", > "Random Data",