[PATCH 1/2] rust: error: Add EOVERFLOW

Abdiel Janulgue posted 2 patches 1 month ago
There is a newer version of this series
[PATCH 1/2] rust: error: Add EOVERFLOW
Posted by Abdiel Janulgue 1 month ago
Trivial addition for missing EOVERFLOW error.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@gmail.com>
---
 rust/kernel/error.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 7cd3bbab52f2..92bfdaaedb02 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -63,6 +63,7 @@ macro_rules! declare_err {
     declare_err!(EPIPE, "Broken pipe.");
     declare_err!(EDOM, "Math argument out of domain of func.");
     declare_err!(ERANGE, "Math result not representable.");
+    declare_err!(EOVERFLOW, "Value too large for defined data type.");
     declare_err!(ERESTARTSYS, "Restart the system call.");
     declare_err!(ERESTARTNOINTR, "System call was interrupted by a signal and will be restarted.");
     declare_err!(ERESTARTNOHAND, "Restart if no handler.");
-- 
2.43.0
Re: [PATCH 1/2] rust: error: Add EOVERFLOW
Posted by Alice Ryhl 1 month ago
On Wed, Oct 23, 2024 at 1:34 PM Abdiel Janulgue
<abdiel.janulgue@gmail.com> wrote:
>
> Trivial addition for missing EOVERFLOW error.
>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@gmail.com>
> ---
>  rust/kernel/error.rs | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
> index 7cd3bbab52f2..92bfdaaedb02 100644
> --- a/rust/kernel/error.rs
> +++ b/rust/kernel/error.rs
> @@ -63,6 +63,7 @@ macro_rules! declare_err {
>      declare_err!(EPIPE, "Broken pipe.");
>      declare_err!(EDOM, "Math argument out of domain of func.");
>      declare_err!(ERANGE, "Math result not representable.");
> +    declare_err!(EOVERFLOW, "Value too large for defined data type.");
>      declare_err!(ERESTARTSYS, "Restart the system call.");
>      declare_err!(ERESTARTNOINTR, "System call was interrupted by a signal and will be restarted.");
>      declare_err!(ERESTARTNOHAND, "Restart if no handler.");

The commit message should explain why you're adding it. What will you
use it for?

Alice
Re: [PATCH 1/2] rust: error: Add EOVERFLOW
Posted by Abdiel Janulgue 1 month ago

On 23/10/2024 14:39, Alice Ryhl wrote:
> On Wed, Oct 23, 2024 at 1:34 PM Abdiel Janulgue
> <abdiel.janulgue@gmail.com> wrote:
>>
>> Trivial addition for missing EOVERFLOW error.
>>
>> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@gmail.com>
>> ---
>>   rust/kernel/error.rs | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
>> index 7cd3bbab52f2..92bfdaaedb02 100644
>> --- a/rust/kernel/error.rs
>> +++ b/rust/kernel/error.rs
>> @@ -63,6 +63,7 @@ macro_rules! declare_err {
>>       declare_err!(EPIPE, "Broken pipe.");
>>       declare_err!(EDOM, "Math argument out of domain of func.");
>>       declare_err!(ERANGE, "Math result not representable.");
>> +    declare_err!(EOVERFLOW, "Value too large for defined data type.");
>>       declare_err!(ERESTARTSYS, "Restart the system call.");
>>       declare_err!(ERESTARTNOINTR, "System call was interrupted by a signal and will be restarted.");
>>       declare_err!(ERESTARTNOHAND, "Restart if no handler.");
> 
> The commit message should explain why you're adding it. What will you
> use it for?

Yup I forgot to include the intent of the change, which is needed in the 
next patch. But will fix in next update.

/Abdiel