From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161061AbcA1WNc (ORCPT ); Thu, 28 Jan 2016 17:13:32 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47563 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966782AbcA1WNa (ORCPT ); Thu, 28 Jan 2016 17:13:30 -0500 Date: Thu, 28 Jan 2016 14:13:29 -0800 From: Greg Kroah-Hartman To: Peter Hurley Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v2 9/9] tty: Use test_bit() with tty->flags Message-ID: <20160128221329.GA6427@kroah.com> References: <1452486976-7594-1-git-send-email-peter@hurleysoftware.com> <1452486976-7594-10-git-send-email-peter@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452486976-7594-10-git-send-email-peter@hurleysoftware.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 10, 2016 at 08:36:16PM -0800, Peter Hurley wrote: > tty->flags are handled with atomic bit ops; use test_bit() treewide. > > Signed-off-by: Peter Hurley > --- > arch/ia64/hp/sim/simserial.c | 2 +- > drivers/char/pcmcia/synclink_cs.c | 2 +- > drivers/isdn/i4l/isdn_tty.c | 6 +++--- > drivers/s390/char/tty3270.c | 4 ++-- > drivers/staging/dgap/dgap.c | 2 +- > drivers/staging/dgnc/dgnc_tty.c | 2 +- > drivers/tty/amiserial.c | 6 +++--- > drivers/tty/serial/68328serial.c | 2 +- > drivers/tty/serial/crisv10.c | 4 ++-- > drivers/tty/serial/serial_core.c | 6 +++--- > drivers/tty/synclink.c | 4 ++-- > drivers/tty/synclink_gt.c | 4 ++-- > drivers/tty/synclinkmp.c | 4 ++-- > drivers/tty/tty_port.c | 2 +- > net/irda/ircomm/ircomm_tty_ioctl.c | 6 +++--- > 15 files changed, 28 insertions(+), 28 deletions(-) > > diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c > index e70cade..2ab9ba6 100644 > --- a/arch/ia64/hp/sim/simserial.c > +++ b/arch/ia64/hp/sim/simserial.c > @@ -300,7 +300,7 @@ static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) > if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && > (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && > (cmd != TIOCMIWAIT)) { > - if (tty->flags & (1 << TTY_IO_ERROR)) > + if (test_bit(TTY_IO_ERROR, &tty->flags)) I thought you were going to wrap these up in a tty_*() macro instead of open-coding it everywhere? That way you can change how those bits/features are represented in the future, which is what I thought you wanted to do? Even if you don't want to do that, something like: static inline int tty_is_io_error(struct tty_struct *tty) { return test_bit(TTY_IO_ERROR, &tty->flags); } and then this patch would just be: if (tty_is_io_error(tty)) Or something like that, I'm not sold on the name, I'm sure you can pick a better one :) Sound reasonable? I'll not apply this patch in the series for now. thanks, greg k-h