Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5644142rwr; Tue, 9 May 2023 04:36:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4r7gegL33GCVn3JDvpY49hRlpuRV6tJvIkzIIXIgWVUhwLY3KVIdgX4Fmk+39PVY0kDhMX X-Received: by 2002:a17:90b:1d02:b0:24d:fb2c:1ae0 with SMTP id on2-20020a17090b1d0200b0024dfb2c1ae0mr13723409pjb.17.1683632197718; Tue, 09 May 2023 04:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683632197; cv=none; d=google.com; s=arc-20160816; b=cAtjob5VthA3ftZwKjpKKbejxaaQylmVBmrQJkjdMAQiEG0F6fS1zKgpgkhCyls2QM 7UebA8jxTBPFpQjtlz9j0GkMo4uDAYFJ/5AdVc3CNDi1ERuAl2x4ftK/LiE7UOkkTw2G ZEB6ObUeQx0EtpxtNGON9Un+fotBcGneQtlbIh3pJSaPwL1/03tOgQzjocdV4GlV+IK0 BndUovmrxYKGvl2zVJ1DQAQ/vnKF4Zv+aXT2qyHMzJMzJXdzrE+xpIGqV6hfI3ksxoSA FtzF3QRQ1aK87mDskskLN/ePKUDOchly/s9KWr+WxZEnMn8CGee9PjNpjIqBL8W6JID2 qSyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Vkk5DCy0z8eSEQJVhraU0gyt2AdUF96RHlpvGnmt4l8=; b=K38IRQ4Oj6pGuBj0KLAnZ56G4u1arEA/czBMT2zclYnKEJvzSdpLoLnGBwyqzfoQ0F Q5XYnnwdbOMsA+qewaLe5Y1W40TREbA7DKv9Jj2WJ3zaQ2BNXiviGMK/iHsmanSWac+C PqVaYcWmni/YxSfZPnosS7Kl0IOx/WByFLvOUqjBEzDywueB6cLgGLufBQEAG7aaeP6P G6suZgX4+o96aZhq89QfzYP6298UgxOYbaNiKto2npIFItucqbWMHkQGawL1pDCvhsa8 rWTPyDvB3V2Tr5anhmwn4MmtGf1F0fy4Er8HiC+vCD0zWatBpqyM0yw5kcBl7qt+qZbj 88qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=jWHqrlv1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a633714000000b005031abe8d8bsi1277521pga.745.2023.05.09.04.36.25; Tue, 09 May 2023 04:36:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=jWHqrlv1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235433AbjEILLI (ORCPT + 99 others); Tue, 9 May 2023 07:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233624AbjEILLH (ORCPT ); Tue, 9 May 2023 07:11:07 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCD1019AF; Tue, 9 May 2023 04:11:06 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-b9e2b65d006so8677447276.3; Tue, 09 May 2023 04:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683630665; x=1686222665; 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=Vkk5DCy0z8eSEQJVhraU0gyt2AdUF96RHlpvGnmt4l8=; b=jWHqrlv1baM2RFyMyWnFWvRvQzJwzy1tI//qEiBRlo7NtLAkNSSADCHP1qXq2HKOXw 4ylVczxZLkaVP5CHkls7q1hHxLD9XQlHp2eObYN2YwWNBhhumPVdMc60Fe0yZcD+TBKL fATB2lmJZK+t/B+KdFaQ1eBX7oo6DrSMhiRAegBaPghSGt9y0PI8jusxxywFJA8/XEG0 UUD/6hRxCrT7bNkKCmwmb53CsaiENjSM4KedxejCfcAE3JmR3Ga7lj0MWT9W5Wsp89fr AINQdsIMhgWTgeVny665E9o666cv3Fu3un2KgJ0M9BzavlnFZq2WM71Uxia4rsnaA1oA QtEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683630665; x=1686222665; 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=Vkk5DCy0z8eSEQJVhraU0gyt2AdUF96RHlpvGnmt4l8=; b=TZUTYYTkmeQ7IuR7CL+XISk2Rx3ndu+FiZsCIi8m+s4CSiU1idriBwvMzKQeko3IRf JQSS7TioZkl7wmXbHrJfvsfLmSNb8yrvOuEzovps7f96QQOspKQQwipa49p9dotJueEL DspVKSJot78+kHjLG/1sgn8OLZ2bBzN0aJbxrSgkGga/FKrC2pistg+cV2Gpwfp4jG8o jkJGHCG1BWFek356bbzUfbG7YDSosQrDZ8g4GdBwDwKzohsHadIzJCjRjDoHVPFn5u5k ph0QNMOfMAr2fh8JKeNfecIL6VDhkBoAII7u5ytHYypDI7hpPfzDNWi2IE7TS8jrR7PH A3nw== X-Gm-Message-State: AC+VfDzv55D7PF9YmuLnmYPwo/F6P4ptukUMrEA8HGSQb8dIGxl4kMgw uWl3ILJEnZCIN6NrUXpl0gZe+BdGfGyvDCS/3j0= X-Received: by 2002:a25:2d4:0:b0:b9e:7896:63a0 with SMTP id 203-20020a2502d4000000b00b9e789663a0mr14839271ybc.54.1683630665536; Tue, 09 May 2023 04:11:05 -0700 (PDT) MIME-Version: 1.0 References: <20230508124701.443ba331.gary@garyguo.net> <20230509080700.1608146-1-aliceryhl@google.com> <2023050937-scouring-truck-d7c0@gregkh> In-Reply-To: <2023050937-scouring-truck-d7c0@gregkh> From: Miguel Ojeda Date: Tue, 9 May 2023 13:10:54 +0200 Message-ID: Subject: Re: [PATCH v2] rust: error: add missing error codes To: Greg KH Cc: Alice Ryhl , gary@garyguo.net, alex.gaynor@gmail.com, benno.lossin@proton.me, bjorn3_gh@protonmail.com, boqun.feng@gmail.com, linux-kernel@vger.kernel.org, ojeda@kernel.org, patches@lists.linux.dev, rust-for-linux@vger.kernel.org, wedsonaf@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 9, 2023 at 10:46=E2=80=AFAM Greg KH wrote: > > It depends on which arch you are building for. That's why we have > per-platform errno.h files, the values are different for different ones. > So you need to handle them all properly somehow. How is rust going to > handle per-arch stuff like this? We can do conditional compilation in the same file, possibly with a Rust macro which takes a nice table that shows all arches at once. We can also split into files like C and move it to each `arch/`, there are a couple of approaches for this. This is best for `MAINTAINERS`, although these headers almost never change, so it is not a big advantage. We could also automatically do everything based on the C headers, too. Back then it felt to me like too much complexity for little gain, given those C headers almost never change, but now it may be worth it. Or, instead, having a test that verifies they are the same instead, and that way we don't introduce complexity for the build itself. Alice only needs `ERESTARTSYS` so far, as far as I understand, so perhaps it is simplest to only add the rest of the non-generic ones for the moment; and gather opinions on the approaches above meanwhile. Cheers, Miguel