From: Timur Tabi <timur@freescale.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: konrad.wilk@oracle.com, kumar.gala@freescale.com,
linux-kernel@vger.kernel.org, cmetcalf@tilera.com,
akpm@kernel.org, linux-console@vger.kernel.org, greg@kroah.com,
virtualization@lists.linux-foundation.org,
linuxppc-dev@lists.ozlabs.org, alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH 7/7] [v5] drivers/virt: introduce Freescale hypervisor management driver
Date: Thu, 9 Jun 2011 15:18:28 -0500 [thread overview]
Message-ID: <4DF12A94.6070605@freescale.com> (raw)
In-Reply-To: <201106092213.13755.arnd@arndb.de>
Arnd Bergmann wrote:
> As mentioned, it would be easier and more readable to just do
>
> switch(cmd) {
> case FSL_HV_IOCTL_PARTITION_RESTART:
> ...
>
> case FSL_HV_IOCTL_PARTITION_GET_STATUS;
> ...
>
> There is no need to check the bits individually when you can simply
> compare the command number.
But this will break backwards compatibility with older applications that used
the union as the size parameter. Although these applications won't compile with
the new header file, older already-compiled applications still work.
I will eventually update the applications to use the new header file, and at
that point I will modify the switch statement as you suggest. But until then,
I'd like to keep the code as-is.
>> > +enum fsl_hv_ioctl_cmd {
>> > + FSL_HV_IOCTL_PARTITION_RESTART = _IOWR(0, 1, struct fsl_hv_ioctl_restart),
>> > + FSL_HV_IOCTL_PARTITION_GET_STATUS = _IOWR(0, 2, struct fsl_hv_ioctl_status),
>> > + FSL_HV_IOCTL_PARTITION_START = _IOWR(0, 3, struct fsl_hv_ioctl_start),
>> > + FSL_HV_IOCTL_PARTITION_STOP = _IOWR(0, 4, struct fsl_hv_ioctl_stop),
>> > + FSL_HV_IOCTL_MEMCPY = _IOWR(0, 5, struct fsl_hv_ioctl_memcpy),
>> > + FSL_HV_IOCTL_DOORBELL = _IOWR(0, 6, struct fsl_hv_ioctl_doorbell),
>> > + FSL_HV_IOCTL_GETPROP = _IOWR(0, 7, struct fsl_hv_ioctl_prop),
>> > + FSL_HV_IOCTL_SETPROP = _IOWR(0, 8, struct fsl_hv_ioctl_prop),
>> > +};
> Using a #define here is usually preferred because then you can use #ifdef in a user
> application to check if a given value has been assigned.
You're right -- I had enum on the brain.
> More importantly, the code you have chose (0) conflicts with existing drivers
> (frame buffer, scsi and wavefront among others). Please chose a free one and
> add it to Documentation/ioctl/ioctl-number.txt in the same patch.
Ok, I was really hoping to avoid doing this. Like I said, binary compatibility
is important, and changing the type will break my existing apps. Are you
insisting that I pick a new number?
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2011-06-09 20:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 19:13 [PATCH 7/7] [v5] drivers/virt: introduce Freescale hypervisor management driver Timur Tabi
2011-06-09 19:40 ` Randy Dunlap
2011-06-09 19:47 ` Timur Tabi
2011-06-09 19:48 ` Randy Dunlap
2011-06-09 20:25 ` Arnd Bergmann
2011-06-09 20:13 ` Arnd Bergmann
2011-06-09 20:18 ` Timur Tabi [this message]
2011-06-09 20:31 ` Greg KH
2011-06-09 20:40 ` Timur Tabi
2011-06-09 20:33 ` Arnd Bergmann
2011-06-10 10:45 ` Mark Brown
2011-06-10 8:32 ` [PATCH 7/7] [v5] drivers/virt: introduce Freescale hypervisormanagement driver David Laight
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=4DF12A94.6070605@freescale.com \
--to=timur@freescale.com \
--cc=akpm@kernel.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arnd@arndb.de \
--cc=cmetcalf@tilera.com \
--cc=greg@kroah.com \
--cc=konrad.wilk@oracle.com \
--cc=kumar.gala@freescale.com \
--cc=linux-console@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=virtualization@lists.linux-foundation.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;
as well as URLs for NNTP newsgroup(s).