diff mbox series

sandbox: net: lwip: use EOPNOTSUPP not ENOTSUPP

Message ID 20241105102455.10141-1-jerome.forissier@linaro.org
State New
Headers show
Series sandbox: net: lwip: use EOPNOTSUPP not ENOTSUPP | expand

Commit Message

Jerome Forissier Nov. 5, 2024, 10:24 a.m. UTC
EOPNOTSUPP is the recommended SUSV4 error code that should be used
instead of ENOTSUPP.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---
 drivers/net/sandbox-lwip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilias Apalodimas Nov. 11, 2024, 12:49 p.m. UTC | #1
On Tue, 5 Nov 2024 at 12:25, Jerome Forissier
<jerome.forissier@linaro.org> wrote:
>
> EOPNOTSUPP is the recommended SUSV4 error code that should be used
> instead of ENOTSUPP.
>
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>  drivers/net/sandbox-lwip.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/sandbox-lwip.c b/drivers/net/sandbox-lwip.c
> index 3721033c310..5c9a0cb1b9f 100644
> --- a/drivers/net/sandbox-lwip.c
> +++ b/drivers/net/sandbox-lwip.c
> @@ -27,7 +27,7 @@ static int sb_lwip_eth_send(struct udevice *dev, void *packet, int length)
>  {
>         debug("eth_sandbox_lwip: Send packet %d\n", length);
>
> -       return -ENOTSUPP;
> +       return -EOPNOTSUPP;

I think we are fine without this. Isn't EOPNOTSUPP for socket use only?

Thanks
/Ilias
>  }
>
>  static int sb_lwip_eth_recv(struct udevice *dev, int flags, uchar **packetp)
> --
> 2.40.1
>
Jerome Forissier Nov. 12, 2024, 10:53 a.m. UTC | #2
On 11/11/24 12:49, Ilias Apalodimas wrote:
> On Tue, 5 Nov 2024 at 12:25, Jerome Forissier
> <jerome.forissier@linaro.org> wrote:
>>
>> EOPNOTSUPP is the recommended SUSV4 error code that should be used
>> instead of ENOTSUPP.
>>
>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
>> ---
>>  drivers/net/sandbox-lwip.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/sandbox-lwip.c b/drivers/net/sandbox-lwip.c
>> index 3721033c310..5c9a0cb1b9f 100644
>> --- a/drivers/net/sandbox-lwip.c
>> +++ b/drivers/net/sandbox-lwip.c
>> @@ -27,7 +27,7 @@ static int sb_lwip_eth_send(struct udevice *dev, void *packet, int length)
>>  {
>>         debug("eth_sandbox_lwip: Send packet %d\n", length);
>>
>> -       return -ENOTSUPP;
>> +       return -EOPNOTSUPP;
> 
> I think we are fine without this. Isn't EOPNOTSUPP for socket use only?

Indeed. I think the most appropriate and standard code here would be
ENOTSUP but we don't have such a define and it doesn't matter much
anyways. The checkpatch advice is bad IMO. I am fine with dropping this
patch.


Thanks,
diff mbox series

Patch

diff --git a/drivers/net/sandbox-lwip.c b/drivers/net/sandbox-lwip.c
index 3721033c310..5c9a0cb1b9f 100644
--- a/drivers/net/sandbox-lwip.c
+++ b/drivers/net/sandbox-lwip.c
@@ -27,7 +27,7 @@  static int sb_lwip_eth_send(struct udevice *dev, void *packet, int length)
 {
 	debug("eth_sandbox_lwip: Send packet %d\n", length);
 
-	return -ENOTSUPP;
+	return -EOPNOTSUPP;
 }
 
 static int sb_lwip_eth_recv(struct udevice *dev, int flags, uchar **packetp)