Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp942178pxb; Wed, 6 Apr 2022 04:58:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWxJ8a/pUbOs0A7f0DI3XrADaIrv7g+NYPf6Trl05+/8dMge1FLK0jkDu5wdc6lZv5yKzV X-Received: by 2002:a17:90b:3ecb:b0:1c7:74f6:ae73 with SMTP id rm11-20020a17090b3ecb00b001c774f6ae73mr9506156pjb.236.1649246280746; Wed, 06 Apr 2022 04:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246280; cv=none; d=google.com; s=arc-20160816; b=Qo0KcKhkvrDlSq+MeUwh1Gkx0ydcLixBJ/peivIhRqFNK7Dv4mwp8fuhJ9oycmJbZ8 P2pfzmLOC5WmzqLj5e3bFqHM5tiYDmjDUF3QTUIyUDAXHMYCVd3kV412H9nf3FlJju/Y QtLeLjJTs1gaUf5OSnpp67LP3bM109ZrNPIVnJM/mxkLiI+Lk3t48kbALiqI/tYvKeO7 mqXVsKMtuZKuxrrqg/zcb0BLvNzZUsoAzj3/WNRgiWOVPola6+S6PvkKJJJgClGH2IQn VsOoPeZUs3deAFMtLc4Hd0V9dYI8BxEG/5wM5KiJFqBK8lkh8WRBwMD7mi5VCg6TCzNV NjKw== 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=YHssrEnKyYuCe19eUlWzOhJSqYIuQ42mrNNeJfUbiw8=; b=qzDKw3umOXrr8lfaWPwECYtHw0i/aGUDDhjBkj8u2Zy1yFjBsCIdXEeQ3H7z03ETOw /dza9XSpn1RAN/RoZ0TvjHYG8YzLqOemmF68EIsg/mBurtLgAWc5iEURncHySrTE34CG Nu+Y6x0H3/rB7Wt6SEZu7VdJvmQ3wzHbofkqKUNAMri4DHm9LjocQQ6KZ2paWlgH8kDk qZ6d4YTXGsol436VFAJbZMr1zB2PmclLn1oJf+Z+wjno3+sBUL91XtEHKbKAp6UIKOKD Rn1Rma3l73tcab6T/nFe4SQxRqH9f8Vn6NJK87FwTVEdmWyfj9YdPAVZ47mBs0XBXxi4 4aGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZHkpCQcP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id mw11-20020a17090b4d0b00b001c361252184si5094222pjb.141.2022.04.06.04.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:58:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZHkpCQcP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56DB2658116; Wed, 6 Apr 2022 03:20:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243895AbiDEUrK (ORCPT + 99 others); Tue, 5 Apr 2022 16:47:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbiDEKax (ORCPT ); Tue, 5 Apr 2022 06:30:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C809ADD95C; Tue, 5 Apr 2022 03:18:25 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 29EBB6176C; Tue, 5 Apr 2022 10:18:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D6B3C385A1; Tue, 5 Apr 2022 10:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153904; bh=NvZ6XiU6CdBZxHhjPV1gh5NK0assn0TT6y0lGrOHRPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZHkpCQcPAzwDF6s3eeRgOOGx1kiamOp/gWMzgFqKc3Ayr0vDuPhAlQKeJMv1oAqao hOrvBeQlqiTPQy+2y5N2X8PA04//m2NH/gerCW3vuKBxpdM78mPU54fpWt1xwK9lDW 5WWfbwY388ARnRD98dh1lw4G849UXUNz4Oca6oLU= 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.10 389/599] pinctrl: renesas: checker: Fix miscalculation of number of states Date: Tue, 5 Apr 2022 09:31:23 +0200 Message-Id: <20220405070310.407053245@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@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 9d168b90cd28..258972672eda 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