From patchwork Mon Oct 21 08:07:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13843712 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 E42B3D0E6C1 for ; Mon, 21 Oct 2024 08:09:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B31F6B0083; Mon, 21 Oct 2024 04:09:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 564016B0088; Mon, 21 Oct 2024 04:09:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 451C96B0089; Mon, 21 Oct 2024 04:09:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2A0A86B0083 for ; Mon, 21 Oct 2024 04:09:05 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 43DB8416A7 for ; Mon, 21 Oct 2024 08:08:56 +0000 (UTC) X-FDA: 82696883052.09.D5E737E Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by imf17.hostedemail.com (Postfix) with ESMTP id B4B8E4000E for ; Mon, 21 Oct 2024 08:08:51 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bimxO+A6; spf=pass (imf17.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729498067; 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=MgLMq6LBoZI6oopSlHmO6YDXt32997TqTP5A06Xl6xg=; b=OnDfStZiQxzJ5U/1y7YaMVWrMF02zcqfGqJLKTPSyhtng1UbCK2oR1066/opF4OJZp3djS KDIN+pOa2FUptGrqFe55QRVVIdmT2iEh8bmwGe6/FtezLd+xkABgtnbtu1wFbGG7vE75xE DOGTS+CmOfbM7jnC5zKzhfOorGbrrAc= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bimxO+A6; spf=pass (imf17.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729498067; a=rsa-sha256; cv=none; b=jcCpXMgXFog2voUZgw0FYCMdG0wxbdgvVkjbqQRBJZfdzKw7nTQNmwRjuCkKY9YssuWGFg 7i+iDWTLpKuxqGmvRqEht5M700iRqpCEd5ZOOPr7CKDFbLA3t1yJ5g8D6WiQyTpgrBCp9L GWl0viVh/I7Ebpdkwlt0tTwlvuVZhes= Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-53a0c160b94so2110347e87.2 for ; Mon, 21 Oct 2024 01:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729498140; x=1730102940; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MgLMq6LBoZI6oopSlHmO6YDXt32997TqTP5A06Xl6xg=; b=bimxO+A6ACHCocUrmGfS3K5lq0w7/jdvlGYvmAPLJfwVBAonP0zqoBJ/dKerQqnEFI U6n8ryrYTGqSwDQr24ptWSMnMlOO1nackduXpRIB18/EwvRXtQ2z+FxcT3BocRW4YA0h 3JFIom2mwkwkRVChHKYgWCM6QYmBBGfy94hsBKy1jTtqOWjljETWPVLPY5KIPG21nnqm m+EZwVSkVmZ5QBVygm4M+T+CJb+7nhMOA2LA1+aDeGfay3JW4MwF1j1PaA2AtEYtRfah Y7NOR81YdGo5gbyNC6UbwepbB381fe7ImFhyqEimuf+CZezYUrVOf030kobMbSdlqffO T/eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729498140; x=1730102940; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MgLMq6LBoZI6oopSlHmO6YDXt32997TqTP5A06Xl6xg=; b=YTh9TbxWYvTxMkbpJWQY/MDVZIWLGIY15VtozFDakf1bnLCcJKpMKejoZuo4cBKSl/ /kD0hQqlDppCKSvN4+268ZCaRgcj0XnBTSRNHzrT9ynDAPCu19IwWIbpMT/kxTdUpYUh /s/cJT/HCTNAAOsUsvW9JC08kG8qJBQPfiEwVRcjIpyXAeZTUUBhEq9nD7ElVRSOKDuS TEiZTknY+rUVeTAsoCQQZW24KmGk3yrtp7V61Tdt9DskSZyWmHwWP/Am1QrDVBEc02h3 T1xkJ8TRcL/mN8yCuisnrpQQebNE/p7tzoIGFuTYMgIdUWp1jelMLry+qo2taSGGbPqf yg2w== X-Gm-Message-State: AOJu0YwXorQOG9P33lBoKq/ZUT7m3ar7vktWIgHSzTSwfDlrN6KukCdQ /YgzdcwdmIfdTzAqHF3hLEZccx5irdT0jdzOiSVdpqJdzkm09Yp8Zk4o3Byg X-Google-Smtp-Source: AGHT+IGm0I9oGoA3OhrkX1KUADo64ViH/3eQUSQekHaiP/bGYrIQVdLkfV11y0l2rlbfKlc95r5Daw== X-Received: by 2002:a05:6512:3da2:b0:536:54df:bff2 with SMTP id 2adb3069b0e04-53a1546fda4mr5124132e87.54.1729498140061; Mon, 21 Oct 2024 01:09:00 -0700 (PDT) Received: from fedora.iskraemeco.si ([193.77.86.230]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a913706a7sm175925366b.141.2024.10.21.01.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 01:08:59 -0700 (PDT) From: Uros Bizjak To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Dennis Zhou , Tejun Heo , Christoph Lameter , Andrew Morton Subject: [PATCH 1/3] percpu: Merge VERIFY_PERCPU_PTR() into its only user Date: Mon, 21 Oct 2024 10:07:36 +0200 Message-ID: <20241021080856.48746-1-ubizjak@gmail.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: B4B8E4000E X-Stat-Signature: q5wox6twnphejwdbb7memqkquc8xpcw6 X-HE-Tag: 1729498131-22086 X-HE-Meta: U2FsdGVkX18abezQlycR0k+CQZvzL/WMIlLP1D1/+MmIXJvlzvhGYmghV7DvSk87LWgWLBUFnf49CDCZ0yfCZCUBW1Qf4mMsHNvQqPQtDHrlTdbFOA8E0j6KAGktzG7ozU0rBfWhA5ob4P8tZ9FXyqOSCuK6FnjF+ECuuabycMr9vu8CbZ9zeZXQD7IRAryPWvLRSCDVHP8e+sNZ1lS0y4hrFIMozSybQEzDf2kyz75AjUpTXBDM2oepeSTJ6ikYKwTTSPqgossloIOuRiD21vcRDU7JW0JT6XiosceKv0ZsdPzAbnT3BtZ51UCOvR0gN5MMmSHAK4e0dRsdZqIK847cbHcO6E51zDR3RwbMWcoLZU4+j5AjAz9U8sL+UU90DmB6iU9pbfVK1Qpbf0DtwbOSJ4Mt/pvQ884v5n3wskmP3iBe3eSr2SQma0D6+xjlzqhNabPAM08Rj3Pm2UlZIKQK04X6K+ak9TUEFn6kMviKJKeGOshejWdZw+jvtWjm1O6V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ner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Merge VERIFY_PERCPU_PTR() into non-CONFIG_SMP per_cpu_ptr() to make macro similar to CONFIG_SMP per_cpu_ptr(). This will allow a follow-up patch to refactor common code to a macro. No functional changes, non-CONFIG_SMP per_cpu_ptr() was the only user of VERIFY_PERCPU_PTR(). Signed-off-by: Uros Bizjak Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Andrew Morton --- include/linux/percpu-defs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 8efce7414fad..7fa88c5f4b26 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -254,13 +254,13 @@ do { \ #else /* CONFIG_SMP */ -#define VERIFY_PERCPU_PTR(__p) \ +#define per_cpu_ptr(ptr, cpu) \ ({ \ - __verify_pcpu_ptr(__p); \ - (typeof(*(__p)) __kernel __force *)(__p); \ + (void)(cpu); \ + __verify_pcpu_ptr(ptr); \ + (typeof(*(ptr)) __kernel __force *)(ptr); \ }) -#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); }) #define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)