Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp140234lqo; Tue, 7 May 2024 15:09:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUdKUQ/a9PzhQoBjWof7KlUb9rTP4FtbLp9ptYuCZlgS79LdNAGHsu7zzbBqVaW4IblNCniH3aBxQq13FrFOzPsNRn47f7HtWSiyNcdTw== X-Google-Smtp-Source: AGHT+IHD5fkr04AhAZtCs6TqdsA5wlA/OgA9y9zCQ+VsJ7kWsgOg9ssIYQeHbOKf7zU3bkyvW9yg X-Received: by 2002:a05:6122:d95:b0:4d3:3a0f:77ce with SMTP id 71dfb90a1353d-4df6941085fmr874429e0c.13.1715119747906; Tue, 07 May 2024 15:09:07 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c5-20020ac85a85000000b0043ae6adb144si12986028qtc.666.2024.05.07.15.09.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 15:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172242-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=FGSrOErq; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-172242-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 945601C22CCC for ; Tue, 7 May 2024 22:09:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3160814B969; Tue, 7 May 2024 22:08:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FGSrOErq" Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 B73FE77658; Tue, 7 May 2024 22:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715119738; cv=none; b=rkM0AP2l+lwbc7vnY5CaomDqxxM1umhy3D3sPW0GyH/dR+RCW3VGa3wIRoNXgerepu8JJ5eXf+WTvkbv+qGcyeSbsdQvQXhmdeytdzmHZRnAopT2hOxjEDY/9F7PiI0YWkdE3y5gOMUJOh4Q2vHadsQwBJ0OSga6fXAg5CSEDj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715119738; c=relaxed/simple; bh=Qf1W05Wsq1RECY5871UQtu6YYQQ2FFsJYl+cvLY91W4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=a6+3vIdk8O0+dCrcXFm2NNJPviH6LVYtj/Cc5Y9jv+0ABjNBkLTHNJk+cGU0OeSI/0qKqPREG+opPwieAhA6AcsHT15IPiqHozYu72uFlmzEprvYhsJQJzpuaKQPOm0yRFncdg7mJBvstKqb8lhflGawZEoAdTw5M7Bz47Av1HU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FGSrOErq; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6f042ff9ddcso1803574a34.1; Tue, 07 May 2024 15:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715119735; x=1715724535; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:from:to:cc:subject:date:message-id:reply-to; bh=p3+3MfLUAKF4/pyGWC5WWqt+QStMiPGpndQCb8QPFNA=; b=FGSrOErqWJ3y/YknQR0htmTIUBSCXGJb9/03wKz0Ty0EtinjLfdOSvnxKMlYGm56Zs RYTiGmOGKiwXRtC07ZtfNXJaAburhRAQQl1hcOzHvWmQXHgjxmhTJOtIH06Nu3+N5iBR qAoLB63hoMOGX55o6Wd1BfWVCMPnZPjwMpqDUagkkyh0lwo25UmZSo/WcoZ2QPGH8rUn 1YgKeCe/F+Ki0wQVt/8Z4nf81buIMOpPwOq4MXDJYkHX5H0BXX+GGoaDFgX2N7ZMpENB x84NL6cMPoipLAHvqr7PcgJQaoAoSoFSeZ4YWAPuwxVaclsL7kGvJN+HMgfH4axgynQ6 80xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715119735; x=1715724535; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p3+3MfLUAKF4/pyGWC5WWqt+QStMiPGpndQCb8QPFNA=; b=eY2IUU4nli00TmqBsCK7sYiYSRkINVsQiLPBI/AcZeA9NUygIAYUuE4mKtgoINZNOR HIUuOcoiT02F7QMTcb3tMlB/4BGkZzsymkn4B37jP4a7u2x7yBfcjOih2k6VKEmFXtvU un9jkZl6k+SF3DmbrKed025/BBb/5uDlIU0gzgJFBLGm62wwp1sIk/bAo7dkbZwAPis/ Pk8NeSSni6hCdEqoVc23fQGvBjxtmyhnLbzp7WfQxyDcUJpvyWHZK31XJYOqrfOMUASw 3ec63FL+3jLTVytSRjQXWRjy7p7FrLI8+M++6dku39UYY88qH7/YN+Gwwru69QchIkEm kBow== X-Forwarded-Encrypted: i=1; AJvYcCU19bEcn+2VrZgaXRxbbGzR0mQpG7/ksam3+XZfIYCiDfC6gv/WxBGZ3RjXRHsK0/KSuoRhLSBo0O8wTTzFsJzsuMKshrSaKc4MujG4Kl0I2vCHBAeBizaiSnmonIu2dQrHwRp9S3IIOxgqWrZQLXvJFR4ch7iLksk0GScT+ZacJKtl+D6GMgF8aVI= X-Gm-Message-State: AOJu0YxnmOnsm+L/nC+4LV4eufmHED+ZrPrm5yCjtTmSQ/yGtvgcAoUi YHHiSNebupiJKg2YZ2NbfrQ3+OxHOIvRim9zvtcAuOxnnzyOxdlw X-Received: by 2002:a9d:6756:0:b0:6f0:45ad:24b3 with SMTP id 46e09a7af769-6f0b7e9723bmr839188a34.26.1715119734884; Tue, 07 May 2024 15:08:54 -0700 (PDT) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id po10-20020a05620a384a00b0079299933594sm2367246qkn.95.2024.05.07.15.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 15:08:53 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfauth.nyi.internal (Postfix) with ESMTP id C94FC1200032; Tue, 7 May 2024 18:08:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 07 May 2024 18:08:52 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvledgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpeeuohhq uhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrf grthhtvghrnhepuefhledtjeeijeeuudelieekudfgkeeifeethfelgfekhffffeehgffg heffhedtnecuffhomhgrihhnpeiiuhhlihhptghhrghtrdgtohhmpdhkvghrnhgvlhdroh hrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegs ohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeige dqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihig mhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 May 2024 18:08:52 -0400 (EDT) Date: Tue, 7 May 2024 15:09:00 -0700 From: Boqun Feng To: Miguel Ojeda Cc: Masahiro Yamada , Wedson Almeida Filho , Alex Gaynor , Nathan Chancellor , Nicolas Schier , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , linux-kbuild@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Sergio =?iso-8859-1?Q?Gonz=E1lez?= Collado Subject: Re: [PATCH v2] kbuild: rust: split up helpers.c Message-ID: References: <20240507210818.672517-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240507210818.672517-1-ojeda@kernel.org> On Tue, May 07, 2024 at 11:08:18PM +0200, Miguel Ojeda wrote: > From: Andreas Hindborg > > When rebasing patch sets on top of upstream Linux, merge conflicts in > helpers.c are common and time consuming [1]. Thus, split the file so > that each kernel component can live in a separate file. > > Each helper file is listed explicitly and thus conflicts in the file > list are still likely. However, they should be simpler to resolve than > the conflicts usually seen in helpers.c. > > Link: https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/Splitting.20up.20helpers.2Ec/near/426694012 [1] > Signed-off-by: Andreas Hindborg > Reviewed-by: Sergio Gonz?lez Collado > Tested-by: Sergio Gonz?lez Collado > Link: https://lore.kernel.org/r/20240416074607.1395481-1-nmi@metaspace.dk > [ Reworded message slightly and fixed nits in it. Applied commit > 84373132b831 ("rust: helpers: Fix grammar in comment") here. Added > SPDX license identifier in new Makefile. Applied Markdown formatting. > Added `.gitignore`. Included `helpers_combined.c` in the `clean` > target. - Miguel ] > Signed-off-by: Miguel Ojeda This overall looks good to me, one thing below I think should be changed.. > --- > This is a patch from Andreas that I was going to apply to `rust-next` > with the tweaks mentioned above, but I noticed Kbuild was not Cc'd, so > we decided to send this as a "v2" and thus give a chance to Kbuild to > take a look for next cycle. > > If something in the diff to v1 is wrong, it is my fault, not Andreas' :) > [...] > diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c > new file mode 100644 > index 000000000000..f3106f248485 > --- /dev/null > +++ b/rust/helpers/build_bug.c > @@ -0,0 +1,10 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +#include > +#include > + > +const char *rust_helper_errname(int err) > +{ > + return errname(err); > +} > +EXPORT_SYMBOL_GPL(rust_helper_errname); . this build_bug.c should be avoided, but this function should go into err.c. Regards, Boqun > diff --git a/rust/helpers/err.c b/rust/helpers/err.c > new file mode 100644 > index 000000000000..fba4e0be64f5 > --- /dev/null > +++ b/rust/helpers/err.c > @@ -0,0 +1,22 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +#include > +#include > + > +__force void *rust_helper_ERR_PTR(long err) > +{ > + return ERR_PTR(err); > +} > +EXPORT_SYMBOL_GPL(rust_helper_ERR_PTR); > + > +bool rust_helper_IS_ERR(__force const void *ptr) > +{ > + return IS_ERR(ptr); > +} > +EXPORT_SYMBOL_GPL(rust_helper_IS_ERR); > + > +long rust_helper_PTR_ERR(__force const void *ptr) > +{ > + return PTR_ERR(ptr); > +} > +EXPORT_SYMBOL_GPL(rust_helper_PTR_ERR); [...]