Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7386804rwb; Tue, 6 Dec 2022 05:15:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf6j1NXlsk9B87aRWpCN5L6mLvlA7XWMJJ2xOrOz1XacvqTveveyg9BnDr4C03rDgrTmDCoe X-Received: by 2002:a63:4d09:0:b0:477:7dc8:57a8 with SMTP id a9-20020a634d09000000b004777dc857a8mr59254143pgb.506.1670332512249; Tue, 06 Dec 2022 05:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670332512; cv=none; d=google.com; s=arc-20160816; b=gIahJvK27QuVIcN2aRQNSZFrcsdNCHUMDYllDtIc9erRt6vSiUQlNnGwC5zha0nOmQ +ttHezeQS3OiMF8qYUtZXVPta/9rAXzoDIG6CI763bbTxgmo1L8ta2z4ib2D+DgPEFgF O+bC9AWQSkTw+SaVOI3rU20DTomX0OmKsHrGQT68oFhCkozGDAx8n8bfc9ZHdSB1QxO4 qIbRASAbEeMcrFvIMCnJ6B8RbIbm0xI2gEYJSS9STiZuN3I0rhGHjftpqSVFovj6rz+2 o/EdQORqauLyuS+l4vYZdg6pa8WvyKQrUJCq/FHXR1ZuHCK5zR3AgrZrEha1oEngMW+j cqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IRHVWafY0jHFpHspwEKtI6JUKd/uH2AFkVef11b8k6E=; b=R8Ix8yTMFDsvosM+9G1xRL1b5AsmFS0OsROeOpZPtYtPK4ya20//utLHVhuy401lu8 P+EuKqDFmUNFeS4j5vddy+5jl90bafYFUEKgH7PMmM8zo/99gcrU0eBbB/4s0GQvt3Uo 6Ybiwbs/dsXe3pTav0BalSPxt5LUSQVkeWQr2QfFs+dw98sKLn/6dyNZb9i+S8eAKgtp u2kZelzhxXzoR65ZmkQjC4BkSHkZ7qSPgpfqpP+XXKNQ++h3qlYX/sZR4bBNvwirYYxx SueYlsadzeTI9pu5tMFEkISUIdOy88qv5QdzG+qWwrkiIvP7cf/vcv9UDCY3Ov/hErGE OMUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nyantec.com header.s=default header.b=N1xBqdYr; 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=REJECT sp=REJECT dis=NONE) header.from=nyantec.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a630f45000000b004785b66be7bsi11092299pgp.89.2022.12.06.05.15.01; Tue, 06 Dec 2022 05:15:12 -0800 (PST) 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=@nyantec.com header.s=default header.b=N1xBqdYr; 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=REJECT sp=REJECT dis=NONE) header.from=nyantec.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234758AbiLFNAN (ORCPT + 80 others); Tue, 6 Dec 2022 08:00:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234848AbiLFM7x (ORCPT ); Tue, 6 Dec 2022 07:59:53 -0500 Received: from mout-b-110.mailbox.org (mout-b-110.mailbox.org [IPv6:2001:67c:2050:102:465::110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B585FCF4; Tue, 6 Dec 2022 04:59:15 -0800 (PST) Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-110.mailbox.org (Postfix) with ESMTPS id 4NRL0Z5J26z9tBp; Tue, 6 Dec 2022 13:52:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nyantec.com; s=default; t=1670331134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IRHVWafY0jHFpHspwEKtI6JUKd/uH2AFkVef11b8k6E=; b=N1xBqdYrP8dXmghzKaLbcLdLpkNG0cHbYgPfiCrvtwz9ibdMcruKlyZtBPyty5mVKHwcqy pfJsynIP4ubyQGY4nqSPTJkyzhkAhscw1SRYmyIdc7oRGIk5fjr44FjSrWCgY1dgYHb1xH gcumJmjWkTPCn46i3XoJNrELOf+f/152w49VMwTXUfHL/ZJXB3F1mQFCOHeTze87OOXo/v QwEPSGjXzPKSIeV/sN1Dx++F2UTspoUue1RM278N7FKKDjqEkg/INJhewJ0XQI96v93o9Q j7wuTFiOP7ESEf2xjBhgJxuCrqJJKh7Gh4jxiTyORgH/M+D0MV4pBnoCEvQ0ug== From: Finn Behrens To: ojeda@kernel.org Cc: Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Viktor Garske Subject: Re: [PATCH v2 09/28] rust: error: add codes from `errno-base.h` Date: Tue, 06 Dec 2022 13:52:07 +0100 Message-ID: <8D86E171-0030-4A3F-BE87-9B9FB9E79213@nyantec.com> In-Reply-To: <20221202161502.385525-10-ojeda@kernel.org> References: <20221202161502.385525-1-ojeda@kernel.org> <20221202161502.385525-10-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4NRL0Z5J26z9tBp X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 2 Dec 2022, at 17:14, ojeda@kernel.org wrote: > From: Viktor Garske > > Only a few codes were added so far. With the `declare_err!` > macro in place, add the remaining ones (which is most of them) > from `include/uapi/asm-generic/errno-base.h`. > > Co-developed-by: Wedson Almeida Filho > Signed-off-by: Wedson Almeida Filho > Signed-off-by: Viktor Garske > Reviewed-by: Gary Guo > [Reworded, adapted for upstream and applied latest changes] > Signed-off-by: Miguel Ojeda Reviewed-by: Finn Behrens Regards, Finn > --- > rust/kernel/error.rs | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs > index b843f3445483..861746f2422d 100644 > --- a/rust/kernel/error.rs > +++ b/rust/kernel/error.rs > @@ -17,7 +17,40 @@ pub mod code { > }; > } > > + declare_err!(EPERM, "Operation not permitted."); > + declare_err!(ENOENT, "No such file or directory."); > + declare_err!(ESRCH, "No such process."); > + declare_err!(EINTR, "Interrupted system call."); > + declare_err!(EIO, "I/O error."); > + declare_err!(ENXIO, "No such device or address."); > + declare_err!(E2BIG, "Argument list too long."); > + declare_err!(ENOEXEC, "Exec format error."); > + declare_err!(EBADF, "Bad file number."); > + declare_err!(ECHILD, "Exec format error."); > + declare_err!(EAGAIN, "Try again."); > declare_err!(ENOMEM, "Out of memory."); > + declare_err!(EACCES, "Permission denied."); > + declare_err!(EFAULT, "Bad address."); > + declare_err!(ENOTBLK, "Block device required."); > + declare_err!(EBUSY, "Device or resource busy."); > + declare_err!(EEXIST, "File exists."); > + declare_err!(EXDEV, "Cross-device link."); > + declare_err!(ENODEV, "No such device."); > + declare_err!(ENOTDIR, "Not a directory."); > + declare_err!(EISDIR, "Is a directory."); > + declare_err!(EINVAL, "Invalid argument."); > + declare_err!(ENFILE, "File table overflow."); > + declare_err!(EMFILE, "Too many open files."); > + declare_err!(ENOTTY, "Not a typewriter."); > + declare_err!(ETXTBSY, "Text file busy."); > + declare_err!(EFBIG, "File too large."); > + declare_err!(ENOSPC, "No space left on device."); > + declare_err!(ESPIPE, "Illegal seek."); > + declare_err!(EROFS, "Read-only file system."); > + declare_err!(EMLINK, "Too many links."); > + declare_err!(EPIPE, "Broken pipe."); > + declare_err!(EDOM, "Math argument out of domain of func."); > + declare_err!(ERANGE, "Math result not representable."); > } > > /// Generic integer kernel error. > -- = > 2.38.1