From patchwork Wed Jan 15 09:03:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thorsten Blum X-Patchwork-Id: 13940076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E453C02180 for ; Wed, 15 Jan 2025 09:08:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE2F06B007B; Wed, 15 Jan 2025 04:08:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E91A26B0085; Wed, 15 Jan 2025 04:08:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCBDC6B007B; Wed, 15 Jan 2025 04:03:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 83E876B007B for ; Wed, 15 Jan 2025 04:03:20 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2F1751610ED for ; Wed, 15 Jan 2025 09:03:20 +0000 (UTC) X-FDA: 83009097360.08.4314BAB Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) by imf12.hostedemail.com (Postfix) with ESMTP id 6F3B940004 for ; Wed, 15 Jan 2025 09:03:18 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ucb1LDzD; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of thorsten.blum@linux.dev designates 91.218.175.180 as permitted sender) smtp.mailfrom=thorsten.blum@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736931798; a=rsa-sha256; cv=none; b=cStwx+ogsNNm00Y2/iv0u0fNp9By4CLitT6V+taifLMStQihOwheXGtsmNUXQuDy8dCnmA Ti+DcWhxZL33wCMw56dIqOIe4sGmSLUuIoak8T0aAfUETB+p3Bz+am8cHOfDu55ApZcZlO bsvLqmZEZ3OzMD6rcchtfSMp0MbsanM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ucb1LDzD; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of thorsten.blum@linux.dev designates 91.218.175.180 as permitted sender) smtp.mailfrom=thorsten.blum@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736931798; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=MTx6eVBRDQH0cIOXGIKWY1mU+eXC0+nsCNkZ+qhfRyU=; b=cEPEalmM8oaWIdvY4PP+usW2CprRLMdtHpcKYgkXI5o3qhI8UGtPeUKxdHM5Sb3kYacYXn Nd0EKv8hL4u0RaAEARrgwVu2jr6mRJ2/ibiKyyiJWfFpRqN/Hz7M3xyTWZ8IsVsemjVmbX bNyutSV1MpY2Z6A5tYrSeRHv28M5zUU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736931791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=MTx6eVBRDQH0cIOXGIKWY1mU+eXC0+nsCNkZ+qhfRyU=; b=ucb1LDzDV2WBBXqIeWScSoleF14oDJ8fpSemnlvalIaKNJJsQ8aXlQMCzdwWOQihXJ3E6/ zJEJhqN8heF07AMqu+oFWSQcBAE3rDYmurkrAYvGOHXP38OLQFd5VapLBNXGU8NvKk/q1J 9nxsCXMyEYr0rP0V99Gc6eHmqyJdgsw= From: Thorsten Blum To: Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton Cc: Thorsten Blum , Anshuman Khandual , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/kfence: Use str_write_read() helper in get_access_type() Date: Wed, 15 Jan 2025 10:03:03 +0100 Message-ID: <20250115090303.918192-2-thorsten.blum@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6F3B940004 X-Stat-Signature: zrnfiwkir794wqdh7gyxdwk8wp6wepz6 X-Rspam-User: X-HE-Tag: 1736931798-659549 X-HE-Meta: U2FsdGVkX19kFCtfDnl4kJgysLnFqFaEiigNbA8Ar4ONjKAsro+oLKasvuC1FwBB6J+wkC2zo+cYeDF1v3rU4mm/eJKRGHrdvyIBKuCa/4PBzn+Pc0j4j8MMBjPMgYyLCX5zPo1QN9suvx/Gk4YOeufRa1oYj7ByUERLyjiYQDYeQH6e0bRGa4wNI4jivf/8H6shxqhn5YRqEWQPV9p8q1ptVofT6XfuLVPZ6nBvAMaq+cvfzhFe/VHUAe3H0EtoY4N6opCF/rqJ1Hp92+ilFXtWzXlMP+gmq0g264ByPXmyl7/WdzaiBgojrB8FIqEnRnw47RzTNXLTUtIg7ChX6PRojahJRTrNVbdlHTf5qExYMmZGuo3sOnt8u9UG0FUWqZFs3bL1LsieZefz3xcJ8RGjfnLZH1lSnhzPAR2Pa9ppRQa9bwdapB6yXE6fOpMjQjpp3jlTbtCTRJmpbN02MgAAu+4AU8lfnKuUT9FAscXZ19GSqFcvlMY1OUxLQcaivXLte88xqmbJ43u3kRd3/h3pC9KFRTPJY/eXAq+x4dZKu9G5nTg94dyrtlekNlXlM5SYAcXPU+6QCl961KvG3aS4w6SyJNso6LSONJRVlfxniS0v8IZLGj2/X5wMofOEcG9muHjt5t/+g6fycTd1Kl17z7PNcZgu5c4aZkzqZ5dzSIvmIUNqcZ0TcNUvsSteu/AvZvQNLVnUpfY1aUHhaGVEkeoP/hb+ntb6TprJaRZUpReO0jIX1ijPn4sey8CWW5xKY26c5Hb0HINGGe2FZtTubkzT2k+Eb5XlEHGsXlon3UmEryMkcAvaGekBNzFdt9lfzvq6l0dxtgteGkgm2Hb/+h87lMSpG27utx37Muw5hdfN/Wq1MwMXIe/ahTmoscgqaFlKujJDAW4G1PTVXZuM56TaG7m7IDEwCaISnvu0xMN3yLXzkvSmSKfr/Aipm6VfFcsTnSGKe1ABn/d 2Y2VKrbM PCqI5vWitPaqxwwRekvfyXUPx7KEibgECU44ocH3jZOvNUAq2lX3pdTCFQXJg5e7igRYlrvoY0o2Dxraha4z1nrrzIlHOqtUNiKvUPJ2jfadwddOIb2py5X3gi436gn+HnCNyRa81jnNIAFNLKOAjgnpakG6ZjCWixI6Z2gx9szarsaPFQmnWB/8KUtm6CedJagP02ig3xHVt96Y/SZM0n2KGB3a+BecGVaAvUFqex5B4F1TjQNykQCNWmUSCNbULD9JqnThvOb8skSiEF9bfwBoKRw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove hard-coded strings by using the str_write_read() helper function. Suggested-by: Anshuman Khandual Signed-off-by: Thorsten Blum --- mm/kfence/kfence_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c index f65fb182466d..00034e37bc9f 100644 --- a/mm/kfence/kfence_test.c +++ b/mm/kfence/kfence_test.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -88,7 +89,7 @@ struct expect_report { static const char *get_access_type(const struct expect_report *r) { - return r->is_write ? "write" : "read"; + return str_write_read(r->is_write); } /* Check observed report matches information in @r. */