Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2358825rwb; Fri, 2 Dec 2022 08:44:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6IsXdaK8DQR8Ox0tQgCCEX6HgZBRcY6ftp8nAdBeNkNN4LLFtEkJ/XqU3cp0wRsCTDeGaE X-Received: by 2002:aa7:dbd9:0:b0:461:e8c4:d21f with SMTP id v25-20020aa7dbd9000000b00461e8c4d21fmr32858070edt.186.1669999456435; Fri, 02 Dec 2022 08:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669999456; cv=none; d=google.com; s=arc-20160816; b=ybbk6TDw0mwy1Z75nDsh2rlUIX+8QNnLLhAHpS90NZow2ilyy9TDxwUioIESnmWYGz 3hMHWBZSIAY3HRdS3SDXihe/DJMGqWy8wgG2ey4mHSDpMBTWXLXDswvGm9n3NYg+Sawp Pbvq0bKWnafwMOD4wNmK7bcoTeRiiV90srnIFZhCZDRAf0vyWtnIeHKuQ0gHHL0BvtpF 5ZE5QPMh7Cl4+UGQYXuTI7F0JS+CLlb1CmqQzyJuq0nd9eKzC2hZgZWGN2aJmw+68oxy 5kopmz4Q7Jfag4ShuDM9B/BECK2+8WErpEIUX0gDPWjGdHqEf+IHobYyFjDpV4vNrU1y xJsQ== 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=h5zCuKbiH55yMkcupNhz1upwfPmTsxxE8ej8UeSomwI=; b=vU2zd/aj7zn0HLdY2/zX3IxFxsuOtJN1bJ45CGlQUre3GcVXwW6YFBbJZpBNwI4EIv GYe17TjumCiJo/bcF9ucsJpK4WzJd/fVUIJSrrw0jFItiJLvigcD9WhiQywBK94x8Y1R II0NDl9v/a6iFlZ/LRHMDlT38Tb60Msdi9iAV0DvmPgNNTtqLoW+OAQS+Tc3Q4dvq9zH Yii8seN4aqOQ5fKjbdtaPeuee4HuO5zG60F0iFQBWgOPizhCtoYsYQ3sw3LXuZ+D5hfr /Lh7H6z/09ZjQzucPUUZTCuCcZ2YsKB4gAjgAjOQn7gKlKrdxhHcUqMum4JRzsqRZ9Z+ EoFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YYwF93ZC; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id er25-20020a056402449900b004593671898esi6603218edb.611.2022.12.02.08.43.56; Fri, 02 Dec 2022 08:44:16 -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=@kernel.org header.s=k20201202 header.b=YYwF93ZC; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233950AbiLBQQt (ORCPT + 83 others); Fri, 2 Dec 2022 11:16:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233941AbiLBQQX (ORCPT ); Fri, 2 Dec 2022 11:16:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0C83DFB59; Fri, 2 Dec 2022 08:15:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7085262333; Fri, 2 Dec 2022 16:15:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2F36C43146; Fri, 2 Dec 2022 16:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669997754; bh=8fgcMdAohdJYjCkWzYvRkRAqAWDQxKAVkDLoxRdowB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYwF93ZCf7UzzXELsUSmRSnkfBJntXg8aLS8HuPV3a2J+ECFCY4+zLfWSyTjUBbV9 mZu5WpsHUtugXp36Jntkp3lfpE9LfC2GoSA9wID41WKDBmeNor1D8dm5lDkqEOjn71 x7fESbWVL3HkGd/xljpCodYSqtujtN16IbAID2aPCoPT2/PuMEqtF/Yj4DJcKCUZZL Qk7cXQf7FiwsrgXAaWpWyOPvTJx2COYvaGQXhyHiwnGsAP+HQyAUZ9JSDBpN8lQb+8 IZJ4pBSL2MDljf1Pvo0z4TfbWyBDCzvtNexWqV8QHlrbFEn4wyLl+MNx9eOCCBOLZW rSvYxHlQuZ8yA== From: ojeda@kernel.org To: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Viktor Garske Subject: [PATCH v2 09/28] rust: error: add codes from `errno-base.h` Date: Fri, 2 Dec 2022 17:14:40 +0100 Message-Id: <20221202161502.385525-10-ojeda@kernel.org> In-Reply-To: <20221202161502.385525-1-ojeda@kernel.org> References: <20221202161502.385525-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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 --- 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