From: Arnd Bergmann <arnd@arndb.de>
To: Paul Fulghum <paulkf@microgate.com>
Cc: Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] synclink_gt add compat_ioctl
Date: Thu, 3 May 2007 00:09:11 +0200 [thread overview]
Message-ID: <200705030009.11502.arnd@arndb.de> (raw)
In-Reply-To: <1178137281.10111.8.camel@amdx2.microgate.com>
On Wednesday 02 May 2007, Paul Fulghum wrote:
> + switch (cmd) {
> +
> + case MGSL_IOCSPARAMS32:
> + rc = set_params32(info, (struct MGSL_PARAMS32 __user *)compat_ptr(arg));
> + break;
> +
> + case MGSL_IOCGPARAMS32:
> + rc = get_params32(info, (struct MGSL_PARAMS32 __user *)compat_ptr(arg));
> + break;
No need for the cast here.
> +
> + spin_lock_irqsave(&info->lock, flags);
no need for _irqsave, just use spin_{,un}lock_irq() when you know that
interrupts are enabled.
> --- a/include/linux/synclink.h 2007-04-25 22:08:32.000000000 -0500
> +++ b/include/linux/synclink.h 2007-05-02 14:59:17.000000000 -0500
> @@ -167,6 +167,24 @@ typedef struct _MGSL_PARAMS
>
> } MGSL_PARAMS, *PMGSL_PARAMS;
>
> +/* provide 32 bit ioctl compatibility on 64 bit systems */
> +struct MGSL_PARAMS32
> +{
> + unsigned int mode;
> + unsigned char loopback;
> + unsigned short flags;
> + unsigned char encoding;
> + unsigned int clock_speed;
> + unsigned char addr_filter;
> + unsigned short crc_type;
> + unsigned char preamble_length;
> + unsigned char preamble;
> + unsigned int data_rate;
> + unsigned char data_bits;
> + unsigned char stop_bits;
> + unsigned char parity;
> +};
The definition is correct, but by convention it would be better to use
compat_ulong_t instead of unsigned int for those fields that are an
unsigned long in native mode.
Arnd <><
next prev parent reply other threads:[~2007-05-02 22:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-02 20:21 Paul Fulghum
2007-05-02 22:09 ` Arnd Bergmann [this message]
2007-05-02 23:39 ` Paul Fulghum
2007-05-02 22:47 ` Arnd Bergmann
2007-05-03 0:05 ` Paul Fulghum
2007-05-03 18:01 Paul Fulghum
2007-05-04 0:53 ` Andrew Morton
2007-05-04 21:08 ` Paul Fulghum
2007-05-05 10:58 ` Arnd Bergmann
2007-05-05 13:57 ` Paul Fulghum
2007-05-06 0:27 ` Arnd Bergmann
2007-05-08 21:14 ` Paul Fulghum
2007-05-08 22:07 ` Arnd Bergmann
2007-05-08 23:19 ` Paul Fulghum
2007-05-05 0:48 ` Andrew Morton
2007-05-04 19:08 ` Paul Fulghum
2007-05-09 16:19 Paul Fulghum
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=200705030009.11502.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulkf@microgate.com \
/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
Powered by JetHome