On Tue, Mar 07, 2017 at 05:33:08PM +1100, Tobin C. Harding wrote:
> @@ -1375,7 +1378,7 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct
> *tty)
> ushort thead;
> ushort ttail;
> uint tmask;
> - uint chars = 0;
> + uint chars;
> unsigned long flags;
>
> if (!tty)
> @@ -1397,16 +1400,14 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct
> *tty)
>
> spin_unlock_irqrestore(&ch->ch_lock, flags);
>
> - if (ttail == thead) {
> + if (ttail == thead)
> chars = 0;
> - } else {
> - if (thead >= ttail)
> - chars = thead - ttail;
> - else
> - chars = thead - ttail + WQUEUESIZE;
> - }
> + else if (thead > ttail)
> + chars = thead - ttail;
> + else
> + chars = thead - ttail + WQUEUESIZE;
>
> - return chars;
> + return (int)chars;
This cast means something suspicious is going on. Is there really
something suspicous going on? Can we fix the types? Can we just remove
the cast?
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel