Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1225480iog; Tue, 14 Jun 2022 01:39:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUTxuozzKyV2RJ1qL+l3RVML7ORiNNERFXD1RktQE9xhR/ueIcHOzzZiwr37JzgOtli4eV X-Received: by 2002:a05:6a02:10a:b0:3fd:da84:8859 with SMTP id bg10-20020a056a02010a00b003fdda848859mr3553900pgb.412.1655195988878; Tue, 14 Jun 2022 01:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655195988; cv=none; d=google.com; s=arc-20160816; b=HR6toCV1SQiLxUdI+24OZF9B8/2zqGDFXkp0moK6xvVmUYIV9otDNd65R6WJ5834Fc aRwmGfHSVLop9hzY3SIOlPasZK32aPxOUca8sGFxVqNkA2oQ0Uh+srTkASD2s2txIawy +XMJlcVbgGLB55PAip1RuPIKN8D5lVz+jOu25+GEShhgLrViLLa2U3ABOJbZrnelVy+1 Y5orO0IHnBZ18qNtyUlEVfHhmWy4YLyNUoKrPOXwAKaSGJ7n+JuprsYRg9g7bcPa8FYw QNX3gthVRAGpGOs0JLFiEL9EhbxhvR3BNXj1UUiQtLPeC73HOZkSayYe9LV7j1wPjYWG q92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=b336L/DPMqL4Wv1oj7IQU05ECjadIfm20NxSLOPQ+EE=; b=Dmvg+0LHzsYH34o0whxamv/u1CmmcOzIKuDC5Sz+vQ7CaQpwjZe0fS+QtekTd20ni+ KbOvM3vfPAFPwSWhP/0bGIos2FTUhyVfOmheDWBZRMQpWrdMpZsW+yl7cLEtu/WSTwLP pxnIreJNx22w29APmoHO0DZ0JswEJTwpAkFdiSR/0oy2gwtrdyE9Kk/d69GVDzwTq40C 7JjEqt61q9x6T3zJyDLTMP4Tmt0Nt3WH0iqnb5stke3uWR7Lo/f0F6gBtm+uju32JGTs nyYkvPRTZXKJ2+bSsSAYM9MogR28NA7rcO78nsK8Z09wPJ5QBwYHgV6lS3Kp7NYpQTwS 79pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mrneGVgo; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e68-20020a621e47000000b00518c3e572e3si11888787pfe.295.2022.06.14.01.39.36; Tue, 14 Jun 2022 01:39:48 -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=@intel.com header.s=Intel header.b=mrneGVgo; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbiFNIcn (ORCPT + 99 others); Tue, 14 Jun 2022 04:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiFNIcl (ORCPT ); Tue, 14 Jun 2022 04:32:41 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A7764D4; Tue, 14 Jun 2022 01:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655195559; x=1686731559; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=f+zHCUo+wuXk7wCEBaujL4BGoT/2SLJqxdPfbepFi1I=; b=mrneGVgoFQ9RkmPHo28sZuQCwzUt1F+xMp8JJOF6h5IGD0EaLihRR809 yJV3UNVlb0mOm82shHeEbDZwG2dJLKO/gaHHSBimiz9qZc8rWv4+/ZXZi FVQqXsM7WrNx2Ph2bDNguzm+saV/+ysnFWZrGnbTaL/FlGz3RAJu6905w +9Tka63onWe4rZ51dlAP0AOHBHlEP1v86mEgKmqDrq0bvCCEqmQb/3Oy7 B+AB9oV8l5ja89NdJNPVwnQSwOYGsEUpoXjw8vEuzzqjRFxkugslnK87K Dj/lO7Qb37Qz9k122aphWMHjj0yhj27/UxsDmtGhYq6f+VlULq1qFe/Ts A==; X-IronPort-AV: E=McAfee;i="6400,9594,10377"; a="278588652" X-IronPort-AV: E=Sophos;i="5.91,299,1647327600"; d="scan'208";a="278588652" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 01:32:37 -0700 X-IronPort-AV: E=Sophos;i="5.91,299,1647327600"; d="scan'208";a="830287005" Received: from jlaghzal-mobl1.ger.corp.intel.com ([10.252.32.175]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 01:32:35 -0700 Date: Tue, 14 Jun 2022 11:32:33 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Jiri Slaby , Greg Kroah-Hartman cc: linux-serial , LKML Subject: Re: [PATCH 1/7] tty/vt: consolemap: use ARRAY_SIZE(), part II. In-Reply-To: <68107f11-58bb-5c55-8f45-891717d08d33@linux.intel.com> Message-ID: References: <20220614075713.32767-1-jslaby@suse.cz> <68107f11-58bb-5c55-8f45-891717d08d33@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-711606469-1655195556=:1605" X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-711606469-1655195556=:1605 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT Hi all, Err, I take my Reviewed-by back. I just found an issue with this commit while reviewing a later patch in the series that undos that error. On Tue, 14 Jun 2022, Ilpo J?rvinen wrote: > On Tue, 14 Jun 2022, Jiri Slaby wrote: > > > The code still uses constants (macros) as bounds in loops after commit > > 17945d317a52 (tty/vt: consolemap: use ARRAY_SIZE()). The contants are at > > least macros used also in the definition of the arrays. But use > > ARRAY_SIZE() on two more places to ensure the loops never run out of > > bounds even if the array definition change. > > > > Signed-off-by: Jiri Slaby > > --- > > drivers/tty/vt/consolemap.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c > > index fff97ae87e00..8aa7a48b3647 100644 > > --- a/drivers/tty/vt/consolemap.c > > +++ b/drivers/tty/vt/consolemap.c > > @@ -232,7 +232,7 @@ static void set_inverse_transl(struct vc_data *conp, struct uni_pagedict *p, > > } > > memset(q, 0, MAX_GLYPH); > > > > - for (j = 0; j < E_TABSZ; j++) { > > + for (j = 0; j < ARRAY_SIZE(translations[i]); j++) { There's no i variable in this function. > Any particular reason why you left its definition to have 256 instead of > E_TABSZ (even after the patch series I mean): > > static unsigned short translations[][256] = { > > > > glyph = conv_uni_to_pc(conp, t[j]); > > if (glyph >= 0 && glyph < MAX_GLYPH && q[glyph] < 32) { > > /* prefer '-' above SHY etc. */ > > @@ -367,7 +367,7 @@ int con_get_trans_old(unsigned char __user * arg) > > unsigned char outbuf[E_TABSZ]; > > > > console_lock(); > > - for (i = 0; i < E_TABSZ ; i++) > > + for (i = 0; i < ARRAY_SIZE(outbuf); i++) > > { > > ch = conv_uni_to_pc(vc_cons[fg_console].d, p[i]); > > outbuf[i] = (ch & ~0xff) ? 0 : ch; > > > > Reviewed-by: Ilpo J?rvinen This patch is not fine so I take my rev-by back. -- i. --8323329-711606469-1655195556=:1605--