From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc subsystem, use ENOIOCTLCMD where appropriate
Date: Wed, 17 May 2006 14:25:10 -0700 [thread overview]
Message-ID: <20060517142510.b3fcfb7d.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060517013033.10d08a8f@inspiron>
On Wed, 17 May 2006 01:30:33 +0200 Alessandro Zummo wrote:
>
>
> Appropriately use -ENOIOCTLCMD when
> the ioctl is not implemented by a driver.
so this return value does not go back to userspace?
Comment in linux/errno.h says:
/* Should never be seen by user programs */
and ENOTTY is the return value for "Inappropriate ioctl for device":
http://marc.theaimsgroup.com/?l=linux-fsdevel&m=106739260707476&w=2
http://marc.theaimsgroup.com/?l=lustre-devel&m=106737825024915&w=2
> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
>
> ---
> drivers/rtc/rtc-dev.c | 6 +++---
> drivers/rtc/rtc-sa1100.c | 2 +-
> drivers/rtc/rtc-test.c | 2 +-
> drivers/rtc/rtc-vr41xx.c | 2 +-
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> --- linux-rtc.orig/drivers/rtc/rtc-test.c 2006-05-17 01:21:35.000000000 +0200
> +++ linux-rtc/drivers/rtc/rtc-test.c 2006-05-17 01:22:39.000000000 +0200
> @@ -71,7 +71,7 @@ static int test_rtc_ioctl(struct device
> return 0;
>
> default:
> - return -EINVAL;
> + return -ENOIOCTLCMD;
> }
> }
>
> --- linux-rtc.orig/drivers/rtc/rtc-vr41xx.c 2006-05-17 01:21:59.000000000 +0200
> +++ linux-rtc/drivers/rtc/rtc-vr41xx.c 2006-05-17 01:22:29.000000000 +0200
> @@ -270,7 +270,7 @@ static int vr41xx_rtc_ioctl(struct devic
> epoch = arg;
> break;
> default:
> - return -EINVAL;
> + return -ENOIOCTLCMD;
> }
>
> return 0;
> --- linux-rtc.orig/drivers/rtc/rtc-sa1100.c 2006-05-17 01:18:19.000000000 +0200
> +++ linux-rtc/drivers/rtc/rtc-sa1100.c 2006-05-17 01:23:26.000000000 +0200
> @@ -247,7 +247,7 @@ static int sa1100_rtc_ioctl(struct devic
> rtc_freq = arg;
> return 0;
> }
> - return -EINVAL;
> + return -ENOIOCTLCMD;
> }
>
> static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm)
> --- linux-rtc.orig/drivers/rtc/rtc-dev.c 2006-05-17 01:18:19.000000000 +0200
> +++ linux-rtc/drivers/rtc/rtc-dev.c 2006-05-17 01:26:01.000000000 +0200
> @@ -141,13 +141,13 @@ static int rtc_dev_ioctl(struct inode *i
> /* try the driver's ioctl interface */
> if (ops->ioctl) {
> err = ops->ioctl(class_dev->dev, cmd, arg);
> - if (err != -EINVAL)
> + if (err != -ENOIOCTLCMD)
> return err;
> }
>
> /* if the driver does not provide the ioctl interface
> * or if that particular ioctl was not implemented
> - * (-EINVAL), we will try to emulate here.
> + * (-ENOIOCTLCMD), we will try to emulate here.
> */
>
> switch (cmd) {
> @@ -233,7 +233,7 @@ static int rtc_dev_ioctl(struct inode *i
> break;
>
> default:
> - err = -EINVAL;
> + err = -ENOIOCTLCMD;
> break;
> }
>
> -
---
~Randy
next prev parent reply other threads:[~2006-05-17 21:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-16 23:30 Alessandro Zummo
2006-05-17 21:25 ` Randy.Dunlap [this message]
2006-05-17 21:27 ` Alessandro Zummo
2006-05-18 20:30 ` H. Peter Anvin
2006-05-18 22:32 ` Ingo Oeser
2006-05-18 22:38 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060517142510.b3fcfb7d.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=akpm@osdl.org \
--cc=alessandro.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®