From: Mike Frysinger <vapier.adi@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org,
uclinux-dist-devel@blackfin.uclinux.org
Subject: Re: [PATCH] Blackfin: sync termios header changes with x86
Date: Fri, 12 Jun 2009 07:35:46 -0400 [thread overview]
Message-ID: <8bd0f97a0906120435w16a1f46ewd9ad94ee35c04e6e@mail.gmail.com> (raw)
In-Reply-To: <200906121329.33473.arnd@arndb.de>
On Fri, Jun 12, 2009 at 07:29, Arnd Bergmann wrote:
> On Friday 12 June 2009, Mike Frysinger wrote:
>> #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
>> #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
>> -
>> -#define FIOQSIZE 0x545E
>> +#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
>> +#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
>> +#define FIOQSIZE 0x5460
>
> This breaks existing applications using FIOQSIZE. You really shouldn't do that.
meh, no one uses that anyways ;)
>> diff --git a/arch/blackfin/include/asm/termbits.h b/arch/blackfin/include/asm/termbits.h
>> index f37feb7..faa569f 100644
>> --- a/arch/blackfin/include/asm/termbits.h
>> +++ b/arch/blackfin/include/asm/termbits.h
>
> This one only changes whitespace, what is the point?
makes diffing easier
>> --- a/arch/blackfin/include/asm/termios.h
>> +++ b/arch/blackfin/include/asm/termios.h
>
> This change fixes one bug but not another:
better than none at all !
>> @@ -58,37 +60,55 @@ struct termio {
>> *(unsigned short *) &(termios)->x = __tmp; \
>> }
>>
>> -#define user_termio_to_kernel_termios(termios, termio) \
>> -({ \
>> - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
>> - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
>> - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
>> - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
>> - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
>> -})
>> +static inline int user_termio_to_kernel_termios(struct ktermios *termios,
>> + struct termio __user *termio)
>> +{
>> + SET_LOW_TERMIOS_BITS(termios, termio, c_iflag);
>> + SET_LOW_TERMIOS_BITS(termios, termio, c_oflag);
>> + SET_LOW_TERMIOS_BITS(termios, termio, c_cflag);
>> + SET_LOW_TERMIOS_BITS(termios, termio, c_lflag);
>> + get_user(termios->c_line, &termio->c_line);
>> + return copy_from_user(termios->c_cc, termio->c_cc, NCC);
>> +}
>
> You correctly read termios->c_line now, which was missing previously,
> but you still don't check the return value of the get_user and
> copy_from_user functions. The code also has a very ugly property
> of working only on little-endian architectures (which includes
> blackfin AFAICT) but should not serve as an example.
Blackfin is LE which means the assumption is fine by me
> If you want a working version of this file, best copy it from avr32
> or frv. Or just wait for the asm-generic version.
is asm-generic going to be in 2.6.31 ? otherwise i'd prefer to have
Blackfin fixed now rather than 2.6.32+
-mike
next prev parent reply other threads:[~2009-06-12 11:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 10:27 [PATCH] tty: fix unused warning when TCGETX is not defined Mike Frysinger
2009-06-12 10:33 ` Alan Cox
2009-06-12 10:34 ` Mike Frysinger
2009-06-12 10:38 ` Alan Cox
2009-06-12 10:45 ` Mike Frysinger
2009-06-12 10:53 ` Arnd Bergmann
2009-06-12 11:58 ` Alan Cox
2009-06-12 10:47 ` [PATCH] blackfin: update ioctls.h Arnd Bergmann
2009-06-12 10:56 ` [PATCH] Blackfin: sync termios header changes with x86 Mike Frysinger
2009-06-12 11:29 ` Arnd Bergmann
2009-06-12 11:35 ` Mike Frysinger [this message]
2009-06-12 21:41 ` Arnd Bergmann
2009-06-13 0:02 ` Mike Frysinger
2009-06-12 11:56 ` Alan Cox
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=8bd0f97a0906120435w16a1f46ewd9ad94ee35c04e6e@mail.gmail.com \
--to=vapier.adi@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=uclinux-dist-devel@blackfin.uclinux.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®