Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp964184pxb; Wed, 6 Apr 2022 05:28:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydMD5E0w5bxumz6I/pL5uMPYtoL1xjfrQRmKuc0o1EsJQtnr9btTQ9eNswn3X9qI56f8hl X-Received: by 2002:a17:902:9307:b0:154:78ba:ed40 with SMTP id bc7-20020a170902930700b0015478baed40mr8405041plb.92.1649248123841; Wed, 06 Apr 2022 05:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649248123; cv=none; d=google.com; s=arc-20160816; b=RoOT0APzeCSydXQOtXjSmjLFncsEk+Zh/sl+JG8BcnE/AexEM/2gv5w8KZK5oBLSfI t8aRlJQUd0v2Ike0jGXH44gPq3UvIpPCCBlzyVym1i0wsGuQPECHPW3uvAGJNLKMazNB iXSQsHr/qzcUyoG3JbE/2aKvM83i3htI5HiqWku2emSy3wTAr14venYGq4/PMYwQ18Ua s5Oq6mz+BTIDssU34bE4abQf9BPiAyXlZ0M3uVEkp0eKEKvvuR/7ByJRZnfZ+SOumwWs 6PDypl88zBr6pjUKR66VOY4wz+39ghVqgid4AvTrKIVpgDmsSGQCjsCAR8SCmA91XWpi 7fvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tZbvD/oXr5ueGTDJUWSXp6PeuEXB4ykRlGfG3KJ54Jw=; b=KnYJ5b/q8wfQ3/Q8HTBgWVb5W2YHBTwSEtIfVc4sAEdpX+8GbWnuOmtpeVJSXni37h MTYowCQTDo9c4+DVAbBSkF6ELD7t96CcKOUtrUddBtwg+WKsRKVz+zwaaXkOYifet1lb ntlN+K5vVopKQHlaWCLHCdIdhFc0PoRii6EHmd8hPhu3eH/f7AACZYBX05+2qMPsC9Ko JQfgUPoB+hVfEJi0DAESJ7GzcfEcmpP7IP0zPrrHi7hz7Gs69xtIK+rWT0rtLFmRlX9B WYnM2O5UgsY4hWWvVSLMTqmDPWblg6htZwzUXgZp/j1T6YZsSUr0nHbFG1tt+TlXAYed gpkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NSw8/yY+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n4-20020a170902e54400b00153b2d164e4si6248069plf.236.2022.04.06.05.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NSw8/yY+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE8166F76C8; Wed, 6 Apr 2022 04:39:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1846919AbiDFCKy (ORCPT + 99 others); Tue, 5 Apr 2022 22:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349430AbiDEJtv (ORCPT ); Tue, 5 Apr 2022 05:49:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A572409D; Tue, 5 Apr 2022 02:45:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 50C89B81B76; Tue, 5 Apr 2022 09:45:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B90ACC385A1; Tue, 5 Apr 2022 09:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151940; bh=Zm16Ec5+JkAfJ2RL/XU+XJwcSvtoRmxywngEqyH/NpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NSw8/yY+GlA0vPyA/82T8KRlG22ljoiWskhLl/w/6mv+e21BgrEng/1kniJsExqGM NjmDxlV2pbV71bqP4qse1cy4VRd9tlID1mUNlE6VIpaRsjqgIZetRqWb81x8pxO7oN Jvbn8kC2AQchLfLs8Jy1fiplaObuf72J8QUECAzM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.15 596/913] pinctrl: renesas: checker: Fix miscalculation of number of states Date: Tue, 5 Apr 2022 09:27:38 +0200 Message-Id: <20220405070357.706973595@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Geert Uytterhoeven [ Upstream commit de9b861018d46af27a5edff8b6baef35c0c0ad4f ] The checker failed to validate all enum IDs in the description of a register with fixed-width register fields, due to a miscalculation of the number of described states: each register field of n bits can have "1 << n" possible states, not "1". Increase SH_PFC_MAX_ENUMS accordingly, now more enum IDs are checked (SH-Mobile AG5 has more than 4000 enum IDs defined). Fixes: 12d057bad683b1c6 ("pinctrl: sh-pfc: checker: Add check for enum ID conflicts") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6d8a6a05564f38f9d20464c1c17f96e52740cf6a.1645460429.git.geert+renesas@glider.be Signed-off-by: Sasha Levin --- drivers/pinctrl/renesas/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c index f29130957e49..bc17f3131de5 100644 --- a/drivers/pinctrl/renesas/core.c +++ b/drivers/pinctrl/renesas/core.c @@ -739,7 +739,7 @@ static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; } #ifdef DEBUG #define SH_PFC_MAX_REGS 300 -#define SH_PFC_MAX_ENUMS 3000 +#define SH_PFC_MAX_ENUMS 5000 static unsigned int sh_pfc_errors __initdata = 0; static unsigned int sh_pfc_warnings __initdata = 0; @@ -851,7 +851,8 @@ static void __init sh_pfc_check_cfg_reg(const char *drvname, sh_pfc_check_reg(drvname, cfg_reg->reg); if (cfg_reg->field_width) { - n = cfg_reg->reg_width / cfg_reg->field_width; + fw = cfg_reg->field_width; + n = (cfg_reg->reg_width / fw) << fw; /* Skip field checks (done at build time) */ goto check_enum_ids; } -- 2.34.1