public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/char/synclink_gt.c: chars don't have more than 8 bits
@ 2006-08-26  2:01 Adrian Bunk
  2006-08-26  2:49 ` Paul Fulghum
  2006-08-28 19:07 ` [PATCH] synclink_gt fix receive tty error handling Paul Fulghum
  0 siblings, 2 replies; 3+ messages in thread
From: Adrian Bunk @ 2006-08-26  2:01 UTC (permalink / raw)
  To: Paul Fulghum; +Cc: linux-kernel

The GNU C compiler (SVN version) spotted the following buggy code in 
drivers/char/synclink_gt.c:

<--  snip  -->

...
static void rx_async(struct slgt_info *info)
{
...
        unsigned char *p;
        unsigned char status;
...
                        if ((status = *(p+1) & (BIT9 + BIT8))) {
                                if (status & BIT9)
                                        icount->parity++;
                                else if (status & BIT8)
                                        icount->frame++;
                                /* discard char if tty control flags say so */
                                if (status & info->ignore_status_mask)
                                        continue;
                                if (status & BIT9)
                                        stat = TTY_PARITY;
                                else if (status & BIT8)
                                        stat = TTY_FRAME;
                        }
...

<--  snip  -->

Since there are no bits 8 or 9 in a char this code is currently
dead code.

cu
Adrian

-- 

    Gentoo kernels are 42 times more popular than SUSE kernels among
    KLive users  (a service by SUSE contractor Andrea Arcangeli that
    gathers data about kernels from many users worldwide).

       There are three kinds of lies: Lies, Damn Lies, and Statistics.
                                                    Benjamin Disraeli


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-28 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-26  2:01 drivers/char/synclink_gt.c: chars don't have more than 8 bits Adrian Bunk
2006-08-26  2:49 ` Paul Fulghum
2006-08-28 19:07 ` [PATCH] synclink_gt fix receive tty error handling Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox