From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754091AbcHZUMP (ORCPT ); Fri, 26 Aug 2016 16:12:15 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:43174 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbcHZUMN (ORCPT ); Fri, 26 Aug 2016 16:12:13 -0400 Date: Fri, 26 Aug 2016 22:12:02 +0200 From: Pavel Machek To: Rob Herring Cc: Greg Kroah-Hartman , Marcel Holtmann , Jiri Slaby , Sebastian Reichel , Arnd Bergmann , "Dr . H . Nikolaus Schaller" , Alan Cox , Loic Poulain , Peter Hurley , NeilBrown , Linus Walleij , linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Message-ID: <20160826201202.GA27227@amd> References: <20160824232437.9446-1-robh@kernel.org> <20160824232437.9446-6-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160824232437.9446-6-robh@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > @@ -133,26 +133,29 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c > if (!test_bit(SERPORT_ACTIVE, &serport->flags)) > goto out; > > - for (i = 0; i < count; i++) { > - if (fp) { > - switch (fp[i]) { > - case TTY_FRAME: > - ch_flags = SERIO_FRAME; > - break; > - > - case TTY_PARITY: > - ch_flags = SERIO_PARITY; > - break; > - > - default: > - ch_flags = 0; > - break; > + if (serio_buffered_mode_enabled(serport->serio)) { > + serio_receive_buf(serport->serio, cp, count); Elsewhere: + /* Use buffer receive if the driver provides a callback */ + if (drv->receive_buf) + set_bit(SERIO_MODE_BUFFERED, &drv->flags); Could we use if (drv->receive_buf) above directly, and not require the bitfield? Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html