Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp139434rdb; Sun, 28 Jan 2024 18:10:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkuig5jxcRpaWWZjXAr4r48ql6ocvDbZvEwflKfskrzOCEwl0Xt5yA4UKdt3Uc2AAspY2x X-Received: by 2002:a17:907:78d7:b0:a35:c3aa:1121 with SMTP id kv23-20020a17090778d700b00a35c3aa1121mr580386ejc.38.1706494214920; Sun, 28 Jan 2024 18:10:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706494214; cv=pass; d=google.com; s=arc-20160816; b=mSWGiXUhvXyjg3JdRERSbbhYhc0wZfsNTk7zOrYNcARDQRNjbGrTwcjxZXfg3aaJUY 6l/uwJ5hQTNeEM0vI6GgDtpmO2WD9D5pnXev2gileTl8yWTXS5Q8YNh7h1iOjSZUzm+U 5gjUF1+hjGE8z7mEEz6UWN0xVdmhzb3IT8Bh8Xgb1SYidzp/jX+w5+VAqjiibvaY7DnK BSczyIPFoi3zmpk+3ZMfEOOYfBk/XOhkrsPNE9K5kEWMKQ0F0OlDafXQpE9+a0mU2ZEx ly13iuLOnemyLuigKjKHurCScj8yJ7YJLQGlEvw9u18rVttseOuRcvOuDJhc3fz9cED5 ZokQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=3mjiGLCZC5rtVXIMAirs+5VBtB3jcIfSuBZ8wAgAJ6E=; fh=FcVedUyJhZ85g/s+M9f2enFyF4K6N98KkOtzt+Wdk/w=; b=bJ8VUbHQSfISo9J302HyKnGiwCOQN3bA3cLnjFi7p4SULXL01/xQAbyhWSmCPcRi7E OFg29jw0vT0hFOpVV1Sl47lMmOick8LEnyl7xITWgirBldRkBH0wvmGp43yLFh5uHIWH +tVrwz04zLxRdQSROzvMOG8rgPPSvscosp+BmrBumZwY90pyWDv/CkJnaZUh4sJXT02R O1kna7FBByA07iXOqVuXsW7a0A24uli+hi71D1sZHcMzU0XjrzATdpElvvB+0gMPhP3F Eap2yZqkFoyMcOfhv1Zdn0qtg5PIQl3IyvuhA1m/S7921+UVyMufUlYEStLDn1saqhR4 7x6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P6JDWFOS; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-42079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gg14-20020a170906e28e00b00a34b27c17e8si2902340ejb.175.2024.01.28.18.10.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 18:10:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P6JDWFOS; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-42079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AB1521F22C7F for ; Mon, 29 Jan 2024 02:10:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60324EEA6; Mon, 29 Jan 2024 02:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P6JDWFOS" Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36089DF46; Mon, 29 Jan 2024 02:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706494204; cv=none; b=aQWNiACggOyt/KuUdRXIj9vcISG8dfPWtX2YRxlF7jgXpNNnyOyqspO6UvVGf+YaWoAI9jO9mQIaFErX3I2lDPsd3bFGJpkxkmupaMvorn71Xy7K57Ntrd5Jr8RjcKgZJBUziDS+iHxXtAU58OvuhpatItjXWEtgHHYi5Nagk1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706494204; c=relaxed/simple; bh=k7tqqEHDQfhpdfeqK4PWeV1VnbOffVVRA0WzcBwzj3U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=o9C4UoqtEkD/qEHmXLN7726NDZeC92/SX6wf//BI/VsXVJnM9inhVbC2gF1sVESSwIylIdMzZ8fi3BZqxhp2o7LUUrvXUChx4miea/4zQFicqtc42Xy3MkdlfHiAixR0cBNyLTRxYK9USAGzXgkfwIfz1BEHAtUGyvs6GLGepFs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=P6JDWFOS; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2903498ae21so1137399a91.1; Sun, 28 Jan 2024 18:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706494202; x=1707099002; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=3mjiGLCZC5rtVXIMAirs+5VBtB3jcIfSuBZ8wAgAJ6E=; b=P6JDWFOSVNrv/s1PReyeNrj4GOBBmSGqQbug+mWUUJDgsKOLcE2of18hs10wSRwKMZ Ypspof71spA3AOHfkB6COkUQHlJYRYV2fKh03uSdKx5vEX2So643HAPZJINXcVJpwuME FX/fdcUTY8EmSj0ncdP85k7uv4nvGjZMXMmB2HRREX3XRYUlzqCpaFF3lH11zvc/+9LL e84PowPcuW2Okr6XyIBjmMhWsfbn9FCQmjJCU+RyBqxYvJ2XtyGYUCqNCcrHQDjRaxr7 F1wDYeS1EWnINeu8+FolwlpyjgdtJN7SGZs1kFaPITVKmQ7RYsqZ4pMCWX2aNs2ai0Yf L+4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706494202; x=1707099002; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3mjiGLCZC5rtVXIMAirs+5VBtB3jcIfSuBZ8wAgAJ6E=; b=cpvf+I7dOO5bu7hYLCcmncaOeCS/Z0th3cRZW6B/uGrIE9Yb/EgmjFoCSzly0gN1+p yp//3xxl48w0bz+1C24/1PIMXSIYdkC0P8iTEwRZSvt1CpSLvpgptarT9i80sUA3E5nG c7WYud5F4vFl2sL7jskRPcssHyuRz0JoPzhQVhKCXiAiG+/rhuQ1HO47oeAE7yN2NFrY v5fKjj1PnmePlxL8fdKkYS0p09nk9l/XuXPPEnSwY+B37Dv0L7sxXQRwvcfuouYBPWJc bMHj4o/z6ro78u4JX4YRJcduW6a/yVLHTHFxB/UMSH6UBx6VRFWeNCs8iFjOOKjYo33T ZjCA== X-Gm-Message-State: AOJu0YyoQp9z+VIGY58faYgTxCvopPOLUHM0vV/PDOR8zBVuOac2z8CJ 7IX5B4QTZzz5+ulbA8QQ4g0Cgx374R8rDj4PdPHyoqMEfRacpHqK X-Received: by 2002:a17:90a:7f92:b0:293:bf6a:feae with SMTP id m18-20020a17090a7f9200b00293bf6afeaemr1246707pjl.18.1706494202319; Sun, 28 Jan 2024 18:10:02 -0800 (PST) Received: from [172.19.1.47] (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id g8-20020a17090a7d0800b0028bcc2a47e9sm6871980pjl.38.2024.01.28.18.10.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Jan 2024 18:10:01 -0800 (PST) Message-ID: <1aff21ed-c185-4d23-8260-fa182a592d15@gmail.com> Date: Mon, 29 Jan 2024 10:09:57 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/4] pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver Content-Language: en-US To: Linus Walleij Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, j.neuschaefer@gmx.net, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ychuang3@nuvoton.com, schung@nuvoton.com References: <20240123080637.1902578-1-ychuang570808@gmail.com> <20240123080637.1902578-5-ychuang570808@gmail.com> From: Jacky Huang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Dear Linus, Thanks for your review. On 2024/1/28 下午 11:49, Linus Walleij wrote: > Hi Jacky, > > thanks for your patch! > > this caught my eye: > > On Tue, Jan 23, 2024 at 9:06 AM Jacky Huang wrote: > >> From: Jacky Huang >> >> Add common pinctrl and GPIO driver for Nuvoton MA35 series SoC, and >> add support for ma35d1 pinctrl. >> >> Signed-off-by: Jacky Huang > (...) > >> + if (ma35_pinconf_get_power_source(npctl, pin) == MVOLT_1800) { >> + for (i = 0; i < sizeof(ds_1800mv_tbl) / sizeof(u32); i++) { > Isn't this equivalent to: > > for (i = 0; i < ARRAY_SIZE(ds_1800mv_tbl; i++) { > >> + if (ds_1800mv_tbl[i] == strength) >> + ds_val = i; >> + } >> + } else { >> + for (i = 0; i < sizeof(ds_3300mv_tbl) / sizeof(u32); i++) { > Dito > > Perhaps more cases, pls check! > > Yours, > Linus Walleij Yes, I will use ARRAY_SIZE instead. Best Regards, Jacky Huang