Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2616172lqt; Mon, 22 Apr 2024 16:53:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2Ulo9n9z3CESo1L6BZkj0lhtJH2/O8wwGuuuzDsLZ3RbljTSZ7l6hxfvoiyB66YGgBo6XY6Tl6VjhpMXUJZtjcjFSIy9lagL6++vUFg== X-Google-Smtp-Source: AGHT+IEeKe3lghPn5uAfgetcwb4auYFxD1WfTcA3WlobnJRgYreWVbQJ7xDLSx5cLxkozTsco4Hn X-Received: by 2002:a05:6870:3324:b0:239:3cc:57d with SMTP id x36-20020a056870332400b0023903cc057dmr14667858oae.53.1713829990850; Mon, 22 Apr 2024 16:53:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713829990; cv=pass; d=google.com; s=arc-20160816; b=N3A4dImJQOfhgj42O09a75kPxiiHEYXcyaHQnCPp16dY5VRn00mFRiTA1KaGT3X+Cy tp7HYPsW27ptCCZV9nT6Uij1+rG1RWu7H+vt5fuiTkWQ99KOlb+ozbX104pKwrjgdPmz 0+NfyYSeujBfxg8/3bVXqJlZ7dMIhKb1MvAYnrRpW0L+Bob123Lrv60KdMk9uKCcNyCw XNG6Ns2rC1lmU/69r3GcLFo+xpPcnLllHDdbdmjH7v5slk4KmjYnekB0LL3GZ4g2f5mI 0JSQ6M9bL5jnVZ2MwpKkulJKGqZz6nPQ7ToGK1UruMfjcUqLpenLjd6petKVY+bhYfIf ivCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ZL2SDfOIVdnh5qofXf2kW8VQZSFUt39QV7Ink+MGMfQ=; fh=qUU8iY4OGA07zYwrBXZ07qdTSmroOukO8P5gdlae4jo=; b=D+hnZPY99A2mmsP66TXOC9UhahDNixsHyI6/TaXDq32iD9wae94IIP/h9GhuBIR+Vy OZJlQmu0BBZ1GTL/A6B784JOahIgurdUh3bZCaYmUY6FzMJ2hwWs9AAuryY+4BQjOrhA 5KYT4EvYSGHMFEac5kfxAWqmCnRiii9SynXoiegD6oBuZDHCTFEb5aj51d5cqtHg8XjF Sng3w0TqQLmUQ+Dod5CiIxpX1Vw8zYP3j1x0oN+jVsehD9aF7G8stydcjwpER9HiYomu zEhR6Hvpm8t3Si8F/4+8hMFL2sseDtWnlQ1z+uHbfYOBwMOsgh5wFTLADPyYfoVoxsh/ 1WCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NmOAB25G; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-154214-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x22-20020a634a16000000b005f42737fa1dsi8426815pga.790.2024.04.22.16.53.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 16:53:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154214-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NmOAB25G; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-154214-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 75006287CCA for ; Mon, 22 Apr 2024 23:53:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BA3C45BE6; Mon, 22 Apr 2024 23:52:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NmOAB25G" Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FE9244366 for ; Mon, 22 Apr 2024 23:52:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713829967; cv=none; b=nep8XZe5I0w7sgf7HLP+dZIqZgnmFzb8vZPMwgR/Yes6/SOQzfKS4PTXYr3PBk8twLtPviTty1I0Ox5mETtXBl5cj2iXgC/lI4WxdZGNssgCuCDjIpcFdU0Pv5SOu2zofG3HZrZNJszOWW08e2UeAxUDTTzAjT/xiPeIz+dHy4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713829967; c=relaxed/simple; bh=Jc5aknRuDoomxHjp8opKPk+0rkF4Bv+5R6HHAmccbDM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=VreS8ncKi5J+x9aUgZMy3S1VIQkH8m1QWaUCjh+B45+lPMWH9V08v6LzQ4CnZxXLJEkysnTT8NAATcFqgGGhYpYSL3gVpg6VueR8zcjRmYv/YVOLSnNDH539e1OvLnnUZNNnWAuUKpV++YR2IHXV9EuSx693Fmw+aPWgBxh4Wb4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=NmOAB25G; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3c74ff209f6so1902806b6e.0 for ; Mon, 22 Apr 2024 16:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713829964; x=1714434764; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZL2SDfOIVdnh5qofXf2kW8VQZSFUt39QV7Ink+MGMfQ=; b=NmOAB25G52oTf2q5nCuj0VZyV2cQenixsI1QP/BFVmKmNnQxsP8Kjfw8c/TO3ExXBm ailL+3JIYtQ8/CU6L6zpOJN1o7ID7TwuztGxR/JqrYlpdav3WDQIy9N8JAkKdtf77D5n BOpsy/T1rTNXPmKEAED4RXP9+vz0Rb3dDuTog= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713829964; x=1714434764; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZL2SDfOIVdnh5qofXf2kW8VQZSFUt39QV7Ink+MGMfQ=; b=m+sUltS7wi1/TakfFdM80YfrI3fef79bfYMAOVk/04WEslslDkSnli+4xx0dlmHE8R YL/fDq2fPacnwX6ahtT+3KVWdnLIfJRb4pvDdX7sgHLOIDm4Y5Mb91LGQDPxnJcrNULN wFrwXnuePVTD+OesouZrRLseGM6Tx/C7quxgrYOA7nTrpTBh/29mOEqAR2rMFr+Sr1fk HcPJEQzVQ4rg12BHD+P9E3CNg26I3vbsj2reAowJHta5O7YtuvACJpu5yCr+Vl2bmdcc P/wKUoIDkXVGU2iHZbNZ1S0Cypv99Ei7QwlwCHcAdto7hKNSQryFfjrM2KNflbaOgt17 a4zQ== X-Forwarded-Encrypted: i=1; AJvYcCW3RZ7q1R2uNKTziT6QFeHb4B/UsSl4yg5IWCcA/LnrHWFZ5VKeXq8DNGl1mR4xkw042/6LD78uVv6V4b+MZyWObl2bWeZZVBNpJDt+ X-Gm-Message-State: AOJu0Yy5Pw1q+YfVNgfTt6UIe7c/wNItJRuI8hCMTZSi7BAnsT0S3JDt Rae1TSPpmZz3jtKO3+VF0eh9Vo3/z742sxpaH9zXAaZ3u0VabfpImL+roeBaccA2bJw9qbtfq/A gR3cf X-Received: by 2002:a05:6808:1450:b0:3c6:fa20:6c04 with SMTP id x16-20020a056808145000b003c6fa206c04mr18101735oiv.38.1713829964018; Mon, 22 Apr 2024 16:52:44 -0700 (PDT) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com. [209.85.160.171]) by smtp.gmail.com with ESMTPSA id q7-20020a0c9a47000000b006a08a7e14c2sm103501qvd.25.2024.04.22.16.52.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Apr 2024 16:52:43 -0700 (PDT) Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-434ffc2b520so79151cf.0 for ; Mon, 22 Apr 2024 16:52:43 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXQcHZdzSG/a2vsygMKl4GOqfGMQWQr84njSJC+cBGE+/c36IV6QEOtP8yjEL/pCF/J3YlNttscgPghHkyuRo8vaJ5nTfc54js9ixsu X-Received: by 2002:ac8:550d:0:b0:439:9aa4:41ed with SMTP id j13-20020ac8550d000000b004399aa441edmr126829qtq.16.1713829962719; Mon, 22 Apr 2024 16:52:42 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240422-kgdb_read_refactor-v2-0-ed51f7d145fe@linaro.org> <20240422-kgdb_read_refactor-v2-5-ed51f7d145fe@linaro.org> In-Reply-To: <20240422-kgdb_read_refactor-v2-5-ed51f7d145fe@linaro.org> From: Doug Anderson Date: Mon, 22 Apr 2024 16:52:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 5/7] kdb: Use format-specifiers rather than memset() for padding in kdb_read() To: Daniel Thompson Cc: Jason Wessel , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Mon, Apr 22, 2024 at 9:38=E2=80=AFAM Daniel Thompson wrote: > > Currently when the current line should be removed from the display > kdb_read() uses memset() to fill a temporary buffer with spaces. > The problem is not that this could be trivially implemented using a > format string rather than open coding it. The real problem is that > it is possible, on systems with a long kdb_prompt_str, to write pas nit: s/pas/past > the end of the tmpbuffer. > > Happily, as mentioned above, this can be trivially implemented using a > format string. Make it so! > > Cc: stable@vger.kernel.org > Signed-off-by: Daniel Thompson > --- > kernel/debug/kdb/kdb_io.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) Reviewed-by: Douglas Anderson