Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2122878iof; Tue, 7 Jun 2022 20:29:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCXcU/vIGZTgYRCgHdNSkwuBptdspSmLH1UQxjH5GPaU9REBUL9r15rPQhjS7HTCosejOu X-Received: by 2002:a17:903:124b:b0:15e:84d0:ded6 with SMTP id u11-20020a170903124b00b0015e84d0ded6mr32132205plh.141.1654658991217; Tue, 07 Jun 2022 20:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654658991; cv=none; d=google.com; s=arc-20160816; b=yVQMaKwojVfUE/uTPfd1dxCDOWSgPzPPnXVzT1KnoA8F1nasEXz3Vg9iY8py00qU3f RFfBHkVD/6k5CuL5NxyFiYdiw6byo//x6Zs9lV1ucffW+K3H1p/l4kYwzXC5bDAzemFv xqXhqc1KY/BYMOw5Bu6wIp/3o5iyTRwIhW7v1QRbyBBgWRbieuqhQIi41iH6pR+J7UjC gV14i8okqmMrZ1kwVVswJ1lACdxML1zTMDYE8WSDY9yNq+jGMDTDSRDTeV6A6Y0cEgQN EnNDunnO+X5JCIAMcPg6rxYI2e9xYU8+zToNIhUC/fGSt3CuF1OeCwtxVE1V3GIdq0Nz jc5w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=vAuvNGT8GIUBHEgm1CsQlxMPBqlOhBEQduBX+HRxYW8=; b=stFuwwEnoBmZlLjdZJ5gxgnF0VbHJuX/+QtLa5Mg9BW9EYCGlb2IxnivJifDseYbeL VK9WSKe9MBdb+/hUji5IfhPNafXB9g5T/Hzq4o+qKF9c4yPHHsuAkuffulUTo3iw8MGa LAXAvuICUeTJb3/PaANZp/X54gi71v/WXNYTZ8J4tw7vzTSadA52pE190bs9UDEfsVki DVkYHnlIDI01+x0YQ3AcORHJi8NxRhmDq8SMsrs4RAAtlwOdAgKuMMYK61ThdISawPn+ 3RJFyPTorqWi2CdJNZP/uHwatWXJFebACNTNDFwf/XCHfuDAjP/nJW6IfFtc673yy45S kSVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=e8DqGxd7; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a5-20020a170902ecc500b00162380ace44si19495414plh.463.2022.06.07.20.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:29:51 -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=@suse.cz header.s=susede2_rsa header.b=e8DqGxd7; dkim=neutral (no key) header.i=@suse.cz; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 392EB23CF40; Tue, 7 Jun 2022 19:47:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242165AbiFGKww (ORCPT + 99 others); Tue, 7 Jun 2022 06:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242336AbiFGKuN (ORCPT ); Tue, 7 Jun 2022 06:50:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76628F6888; Tue, 7 Jun 2022 03:49:56 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D74AE21B80; Tue, 7 Jun 2022 10:49:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1654598993; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vAuvNGT8GIUBHEgm1CsQlxMPBqlOhBEQduBX+HRxYW8=; b=e8DqGxd7R1I6XulkITmb9Rrvah3CUl9O+RDzQygbH8KGWu9CkKYZaXPHrp03Q6r0gGyO0V zUfNr6mHfEO/qOdt5U2crX3JSWGyUXl3zrNXDZxYUWZlfddaB1GY+inks430UU1BywBe9d TOy42Iw9nqoDoe8OR7VESCuSfgUg6vU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1654598993; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vAuvNGT8GIUBHEgm1CsQlxMPBqlOhBEQduBX+HRxYW8=; b=RW6LaxACpvuX2ZRQuxpO9zRNSXNuXkTxFKahBlfgwC3oxtZ00Di7udlUefUHBJn025Wb50 dAkiOwFGzCEjJSBw== Received: from localhost.localdomain (unknown [10.100.201.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B13742C142; Tue, 7 Jun 2022 10:49:53 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 21/36] tty/vt: consolemap: saner variable names in conv_uni_to_pc() Date: Tue, 7 Jun 2022 12:49:31 +0200 Message-Id: <20220607104946.18710-21-jslaby@suse.cz> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607104946.18710-1-jslaby@suse.cz> References: <20220607104946.18710-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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 The function uses too vague variable names like i, j, k for iterators, p, q, p1, p2 for pointers etc. Rename all these, so that it is clear what is going on: - dict: for dictionaries. - d, r, g: for dir, row, glyph iterators -- these are unsigned now. - dir, row: for directory and row pointers. - glyph: for the glyph. - and so on... Signed-off-by: Jiri Slaby --- drivers/tty/vt/consolemap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 3763a73706b2..374b1ba20635 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -852,10 +852,9 @@ int conv_uni_to_8bit(u32 uni) int conv_uni_to_pc(struct vc_data *conp, long ucs) { - int h; - u16 **p1, *p2; - struct uni_pagedict *p; - + struct uni_pagedict *dict; + u16 **dir, *row, glyph; + /* Only 16-bit codes supported at this time */ if (ucs > 0xffff) return -4; /* Not found */ @@ -874,11 +873,11 @@ conv_uni_to_pc(struct vc_data *conp, long ucs) if (!*conp->vc_uni_pagedir_loc) return -3; - p = *conp->vc_uni_pagedir_loc; - if ((p1 = p->uni_pgdir[UNI_DIR(ucs)]) && - (p2 = p1[UNI_ROW(ucs)]) && - (h = p2[UNI_GLYPH(ucs)]) < MAX_GLYPH) - return h; + dict = *conp->vc_uni_pagedir_loc; + if ((dir = dict->uni_pgdir[UNI_DIR(ucs)]) && + (row = dir[UNI_ROW(ucs)]) && + (glyph = row[UNI_GLYPH(ucs)]) < MAX_GLYPH) + return glyph; return -4; /* not found */ } -- 2.36.1