From patchwork Thu Feb 1 19:06:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 195449 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp399567dyb; Thu, 1 Feb 2024 11:33:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFE9LqeaO3fp9IIvSyz6ELKdLDVp55dB5mm5Hse7DV8eY3XyTD4j8DIPvKCKnQzyNgRcrJ X-Received: by 2002:a05:6359:c86:b0:176:5d73:34ef with SMTP id go6-20020a0563590c8600b001765d7334efmr6746606rwb.24.1706815982961; Thu, 01 Feb 2024 11:33:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706815982; cv=pass; d=google.com; s=arc-20160816; b=T8Ny4V7x7GegPzeEWUxhMmt27wal9jZcAJO4DNLVpnYviTgb33eY+UuQUhYmZyLTbs 13sffA2y5H3LYzSYn92IVopWYuMxD3WCGJTiOSyyvwn4l9/NvjFKSdnNBhwasbLOCxJV /Vx4Jjohc6jyjYfYnMzb2sFNdQudjv9tZsWYtSsDq9J7oL8R4UbMYnnJODPGJ3bfznSM 0bXOLeaoPkmHpag27NVpeOrqoiMP/DUuphLUKLmpXgJtMlipFMJ36OzIeIL0xJrVas6P 8aCpy5PYSy6r2LpzTAOTKIE7zdDmsE/77ecgSK9FysUaYz3zjN6Z/0nrvBnhbIp0E0Px 1osw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=FE7btJtNkKKlj4+Acuiweg//JjBqWYQhsOXxCGd7u0o=; fh=aVdcg0+cr4O9uwxhtFtoqBTre1tGzGB6MKw62N7IEh0=; b=wrImKxZ2hLggDc9DDI2VK9ghgfVy1cZtXdbf0zNy7388rYUj2ZtZIbPxQO/9QN/2oe LwkCm1DA2i+w7caTAtxZlgX0wcVRfA1WJIdJcX2XQxO4Uw1PJ1S3vfxP3M/H7CoLG6DH IoDcTzRfbpczyCaV6MXbPhhD7psPNxpkgzUFm0ze05JH60VkJyhJcvc7UnX6fj97AZTx 2WpQIRtd9LCiVMglZ4wSVZNz/EHCi0IPU8IJXQNpZkB8Rh+biET8oZV9xRpjst2B8lc0 6zDeVIrFEuXguQtf/PMfk2gi1l8fEEeCJ4jCGwkvzoAjzeq6L+jhQBCKa+oc2ZaJWb5c 7xVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z4riNidI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48744-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXzSokqX16AAf9Zmp4PCVGTAP9uKBFntsXd+Qdse67j7PEXSw7CIExrbvceGD+y8u2EuxD6s2/tS1z7sleMsh9kh4NMGA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g10-20020a63e60a000000b005dbdcf45386si206710pgh.390.2024.02.01.11.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:33:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z4riNidI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48744-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D5D5FB28220 for ; Thu, 1 Feb 2024 19:06:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2439F8527A; Thu, 1 Feb 2024 19:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z4riNidI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61E4084FD3; Thu, 1 Feb 2024 19:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814391; cv=none; b=togpDCXSPCHhSRfIXoXEIDE1GoX0T0xr564zfsSqfCfEoC1mIvqjgxgq//trzy+v9yimSNgwnF5u+z0vX289aU+iFWrKrwfus1+F5YKlwBmKzNmU4+rstHhloolQVChGYAG3V+i6x6Te/Zg7JGh8aQ0McgkQ6bV/uQefq209tfI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814391; c=relaxed/simple; bh=UFdbdYDvAPWYwEH4H+sTZoi40RASTnVr7NExWeWKa1U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=F35IsFe0FsfrYDMQZwrVaXMp1q/CG6+bc6lFDvrSQOusP/tQHomxIFCaWZAUganb8+WOE1b/GWjgB2poGhgy4VHBtZ6FDvxUsE9B3UrQYi6QTXDZI3SFBD8EoY2IFBc92CCxIkS/4cVqnySagta6SaBwif8TDOwIdkaR1lplLbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z4riNidI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23094C433C7; Thu, 1 Feb 2024 19:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706814391; bh=UFdbdYDvAPWYwEH4H+sTZoi40RASTnVr7NExWeWKa1U=; h=From:To:Cc:Subject:Date:From; b=Z4riNidIswR8n6TXHT54Ikr2ScCpXEqZyrIJ8CiRqcwUQ/a+p+xXndyM8Tj2X3W4+ vIxSGDhVdiLH7BHuNzT6dcvSpy/SnwWTV2mG7+SueQYA8Kb8fwAxvkU0WW6yR3M79l r2xVdM9/C+bnLoneQj8eFEqhRdaAl+/pONbzRdAKFVDAliTSfmB8iQN2nS9k3lBtVH 7TDEpMbrOEza9WYDsqh+Vy5p9LYz1tbOlD5gEKOV+TECRGAbUsBzCByWK60LB3sizx 8Vwa2R+j+NbQzt5Jx0yASbufk5vMEKNnNje8hCqGIclhXrjAm/emqmszdHk+XwIHMu VE4nxwhJ5H9Fw== From: Miguel Ojeda To: Tejun Heo Cc: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH] workqueue: rust: sync with `WORK_CPU_UNBOUND` change Date: Thu, 1 Feb 2024 20:06:20 +0100 Message-ID: <20240201190620.18064-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789726024384166434 X-GMAIL-MSGID: 1789726276067985052 Commit e563d0a7cdc1 ("workqueue: Break up enum definitions and give names to the types") gives a name to the `enum` where `WORK_CPU_UNBOUND` was defined, so `bindgen` changes its output from e.g.: pub type _bindgen_ty_10 = core::ffi::c_uint; pub const WORK_CPU_UNBOUND: _bindgen_ty_10 = 64; to e.g.: pub type wq_misc_consts = core::ffi::c_uint; pub const wq_misc_consts_WORK_CPU_UNBOUND: wq_misc_consts = 64; Thus update Rust's side to match the change (which requires a slight reformat of the code), fixing the build error. Closes: https://lore.kernel.org/rust-for-linux/CANiq72=9PZ89bCAVX0ZV4cqrYSLoZWyn-d_K4KpBMHjwUMdC3A@mail.gmail.com/ Fixes: e563d0a7cdc1 ("workqueue: Break up enum definitions and give names to the types") Signed-off-by: Miguel Ojeda --- Tejun: here is the formal patch as you requested. Please feel free to either take it or to rebase to fix the old commit. Thanks! rust/kernel/workqueue.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) base-commit: 15930da42f8981dc42c19038042947b475b19f47 -- 2.43.0 diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index 498397877376..d00231e18007 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -199,7 +199,11 @@ pub fn enqueue(&self, w: W) -> W::EnqueueOutput // stay valid until we call the function pointer in the `work_struct`, so the access is ok. unsafe { w.__enqueue(move |work_ptr| { - bindings::queue_work_on(bindings::WORK_CPU_UNBOUND as _, queue_ptr, work_ptr) + bindings::queue_work_on( + bindings::wq_misc_consts_WORK_CPU_UNBOUND as _, + queue_ptr, + work_ptr, + ) }) } }