From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355AbcDAQiq (ORCPT ); Fri, 1 Apr 2016 12:38:46 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34164 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbcDAQip (ORCPT ); Fri, 1 Apr 2016 12:38:45 -0400 Subject: Re: [PATCH 3/3] staging: fwserial: (coding style) Rewriting a call to a long function To: Dominique van den Broeck References: <1459271662-14990-1-git-send-email-domdevlin@free.fr> <1459271662-14990-3-git-send-email-domdevlin@free.fr> Cc: Greg Kroah-Hartman , Shraddha Barke , Radek Dostal , linux-kernel@vger.kernel.org From: Peter Hurley Message-ID: <56FEA410.50609@hurleysoftware.com> Date: Fri, 1 Apr 2016 09:38:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1459271662-14990-3-git-send-email-domdevlin@free.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dominique, On 03/29/2016 10:14 AM, Dominique van den Broeck wrote: > Fixing a lone row exceeding 80 columns so the only remaining warnings > emitted by checkpatch.pl are missing comments on spinlocks and memory > barriers. > > Signed-off-by: Dominique van den Broeck > --- > drivers/staging/fwserial/fwserial.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c > index 4dd5304..c5f73ef 100644 > --- a/drivers/staging/fwserial/fwserial.c > +++ b/drivers/staging/fwserial/fwserial.c > @@ -1343,9 +1343,11 @@ static int fwtty_break_ctl(struct tty_struct *tty, int state) > > if (state == -1) { > set_bit(STOP_TX, &port->flags); > - ret = wait_event_interruptible_timeout(port->wait_tx, > - !test_bit(IN_TX, &port->flags), > - 10); > + ret = > + wait_event_interruptible_timeout(port->wait_tx, > + !test_bit(IN_TX, &port->flags), > + 10); > + I don't see a > 80-col line here? And even if I did, this change would be super-ugly. The preferred way to reduce this is to fold it into a helper function, like if (state == -1 && fwtty_wait_tx_complete(port)) return -EINTR; Regards, Peter Hurley > if (ret == 0 || ret == -ERESTARTSYS) { > clear_bit(STOP_TX, &port->flags); > fwtty_restart_tx(port); >