From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932132AbdEKI3U (ORCPT ); Thu, 11 May 2017 04:29:20 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:33500 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932092AbdEKI3S (ORCPT ); Thu, 11 May 2017 04:29:18 -0400 Date: Thu, 11 May 2017 09:29:14 +0100 From: Okash Khawaja To: Alan Cox Cc: Greg Kroah-Hartman , Samuel Thibault , linux-kernel@vger.kernel.org, William Hubbs , Chris Brannon , Kirk Reiser , speakup@linux-speakup.org, devel@driverdev.osuosl.org, John Covici Subject: Re: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control Message-ID: <20170511082914.GA599@sanghar> References: <20170509124040.816526511@gmail.com> <20170509124238.139472887@gmail.com> <20170510204151.43986689@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170510204151.43986689@alans-desktop> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alan, On Wed, May 10, 2017 at 08:41:51PM +0100, Alan Cox wrote: > > + if (!(tmp_termios.c_cflag & CRTSCTS)) { > > + tmp_termios.c_cflag |= CRTSCTS; > > + ret = tty_set_termios(tty, &tmp_termios); > > + if (ret) > > + pr_warn("speakup: Failed to set hardware flow control\n"); > > You should check the tty c_cflag after the call rather than rely on an > error code. Strictly speaking tty_set_termios should error if no tty bits > are changed by the request but it never has on Linux. Instead check the > tty gave you the result you wanted. Thanks. I will replace the check for return value with check for c_cflag. May be we should fix this in tty_set_termios?