Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4430622imm; Mon, 18 Jun 2018 15:03:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLUpAeGxMof5GsCziSwmXbS3rbS5MU74btyVIcREkzG5ic16wb1+DsjpXGU1Xrm2o8u/VWi X-Received: by 2002:a17:902:1e4:: with SMTP id b91-v6mr15861378plb.155.1529359381676; Mon, 18 Jun 2018 15:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529359381; cv=none; d=google.com; s=arc-20160816; b=N5yzM1yEIWw9PWXTY9kQnCdusaZ3MvzGg2rAr81GGacC+DCZaR974YtMh6wC4JdVnf gZtk60wd2wqX7sYjwprDJTATZ06m8bC0yBM2GZvUfqMVww9OQI0aWe88sPa8PFLCW4Sp J8xMn3I2CAKclYhl+KNro3dZpY9WyUh9+WUHzSr7HUXErJfh9dBkjoXDiGBbeIjRy5Mx us+RbOZYbtZxDfLYHBMxeGO7ZXrUfWX19H1enp/Y1INO+02Bty3WuAU0lD6HFq4tdCny k3GE7/5gmaD/1aAlsls+3B0Emb3j4I/YbdzloPQdff1dhev0PyaMIZJt07JuUaB62Sy9 dS4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Kpt0o7lp2bnnKXKuQkrzYMfcBC1U5owj3U82ZrVQRrk=; b=ONvPEzT/+qQK5gfwLbpU+KLEbuphpu2cGhGmfTxXtBY9t+0mseIYSswF1jmyoZa2VW zb8ziMzqVE55QUnvxOaPSvtPAfMKlcGbDE2k8dobfFClFnuS9GoMDx19qUMzgKH4MsQQ nXYQKlisnntx/umND6D5JmXy+dx4pCLheyJpcwn0KVnVjEkRUywpsqrfIxadoELwbr6v vKVP0q9S/af0vIWqnl1zwg/akVsIqJGR/g4mhZqlDFb+AQ7ppCdHCPowkdh321nVmuem Y0fxJvk1PYZZZXhoYiVCusZrZFefuIQ53Pw/cppSGaFp4ss+3SjJf8JMOCsf0LWNnjB3 KzKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pklmfrK4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x13-v6si12892706pge.370.2018.06.18.15.02.47; Mon, 18 Jun 2018 15:03:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pklmfrK4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935350AbeFRWCE (ORCPT + 99 others); Mon, 18 Jun 2018 18:02:04 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:44339 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754256AbeFRWCB (ORCPT ); Mon, 18 Jun 2018 18:02:01 -0400 Received: by mail-vk0-f65.google.com with SMTP id x4-v6so10487767vkx.11 for ; Mon, 18 Jun 2018 15:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Kpt0o7lp2bnnKXKuQkrzYMfcBC1U5owj3U82ZrVQRrk=; b=pklmfrK4hIw8L0oxyRndz+x4SurknIV+gZ3/UZ9dib2J9asPJv328bWq/GzMj5zLB2 nXs83nAQcNFTihEnRT054T9cFogR8D3uZOJ6ymORB7y/vlB9PkjC3V1TumADGJnbDRRI Q9YdISCBTySYxEhpHLJJFruG3d4iu9y5bfIuObGqjO6ePsKwoL7FhygFn0TO7zmHtcRc eVgcyvZq6Z1caNO0PZFvLFvg8ZVr8Ai4Cs1e462y48jW0F1CYs8ktVyldm33uMy8Kvjw iYHydpQMQPrDfDrPSWcRlA642/Z5Y46iTA1yYViBxfT6ZZxdQ+gnGbWx/SGn4SHhoht5 HY8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Kpt0o7lp2bnnKXKuQkrzYMfcBC1U5owj3U82ZrVQRrk=; b=uaM+nRU+pW5L/mdONNPPW1Rw8p87R5t0/atF+X6Q16k1VvGWk9sig5jz5Z7r8UWSuT J5sjVm/V8r9tSnAsYwmX6AYpzy1TpRYF4ZowP2BMpfhbxV7LCmdHFDfQcebJbgcWL6t/ cKcxBg4CciKBVKwcdvRk1RlPQDonNJonnagw67oTSa04VrEJqCnZ8Tb+g5ehoYA7wHSQ 3wp9oSrCs0v+tGFdB350a4S1KZKjMMZ1dOFtGyKVdjGdrhKxVxZ+AMoHAJZtAXXFRysa ig5ArqP+/4Ra1L+eaqNsRYz12PqQcYsA5ozIfJg1Cb7yvLb2Hr2rGJnkV9s2EtADnAHa uDmQ== X-Gm-Message-State: APt69E0i7gnS1VoDFj3pUAhE+TF67p784VuxbshxpZSziLZHCzhP9rNh Mn5XhRIt2OZ7A7ylaHiby35B+8xwVhPqyq61dPs= X-Received: by 2002:a1f:860b:: with SMTP id i11-v6mr8154342vkd.15.1529359320164; Mon, 18 Jun 2018 15:02:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 15:01:59 -0700 (PDT) In-Reply-To: <20180617190706.14614-5-nicolas.pitre@linaro.org> References: <20180617190706.14614-1-nicolas.pitre@linaro.org> <20180617190706.14614-5-nicolas.pitre@linaro.org> From: Andy Shevchenko Date: Tue, 19 Jun 2018 01:01:59 +0300 Message-ID: Subject: Re: [PATCH v2 4/4] vt: coherence validation code for the unicode screen buffer To: Nicolas Pitre Cc: Greg Kroah-Hartman , Dave Mielke , Samuel Thibault , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 17, 2018 at 10:07 PM, Nicolas Pitre wrote: > Make sure the unicode screen buffer matches the video screen content. > This is provided for debugging convenience and disabled by default. > +#define VC_UNI_SCREEN_DEBUG 0 > + if (!VC_UNI_SCREEN_DEBUG || !uniscr) > + return; Hmm... Interesting. I would rather go with #ifdef ..._DEBUG ... #else return; #endif It will relax requirement on how to define _DEBUG. I don't recall I see something like you proposing in the kernel for the same purpose. > + > + WARN_CONSOLE_UNLOCKED(); > + > + /* > + * Make sure our unicode screen translates into the same glyphs > + * as the actual screen. This is brutal indeed. > + */ > + p = (unsigned short *)vc->vc_origin; > + mask = vc->vc_hi_font_mask | 0xff; > + for (y = 0; y < vc->vc_rows; y++) { > + char32_t *line = uniscr->lines[y]; > + for (x = 0; x < vc->vc_cols; x++) { > + u16 glyph = scr_readw(p++) & mask; > + char32_t uc = line[x]; > + int tc = conv_uni_to_pc(vc, uc); > + if (tc == -4) > + tc = conv_uni_to_pc(vc, 0xfffd); > + if (tc == -4) > + tc = conv_uni_to_pc(vc, '?'); > + if (tc != glyph) > + pr_notice("%s: mismatch at %d,%d: " > + "glyph=%#x tc=%#x\n", __func__, > + x, y, glyph, tc); Don't split format string in printk(). checkpatch will not warn on longer lines. > + } > + } -- With Best Regards, Andy Shevchenko