From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755649AbcAMRad (ORCPT ); Wed, 13 Jan 2016 12:30:33 -0500 Received: from mga11.intel.com ([192.55.52.93]:18650 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755603AbcAMRaY (ORCPT ); Wed, 13 Jan 2016 12:30:24 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,290,1449561600"; d="scan'208";a="632893322" Message-ID: <1452706119.2521.3.camel@linux.intel.com> Subject: Re: [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions From: Andy Shevchenko To: Anton Wuerfel , Greg Kroah-Hartman Cc: Jiri Slaby , "James E.J. Bottomley" , Helge Deller , Peter Hurley , Heikki Krogerus , Qipeng Zha , Desmond Liu , Wang Long , Matt Redfearn , Paul Burton , Ralf Baechle , Krzysztof Kozlowski , Peter Hung , Soeren Grunewald , Adam Lee , "Maciej S. Szmigiero" , Mans Rullgard , linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@i4.cs.fau.de, Phillip Raffeck Date: Wed, 13 Jan 2016 19:28:39 +0200 In-Reply-To: <1452703171-5632-16-git-send-email-anton.wuerfel@fau.de> References: <1452703171-5632-1-git-send-email-anton.wuerfel@fau.de> <1452703171-5632-16-git-send-email-anton.wuerfel@fau.de> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote: > This patch refactors a switch case statement by merging an if > condition > in the default case into an identical condition right after the > switch > statement. > This comes with a slight change in behaviour: If > pci_netmos_9900_numports > returns 0, an additional warning is printed. > + Suggested-by: And I would recommend to put this patch before #13 in the series. > Signed-off-by: Anton Würfel > Signed-off-by: Phillip Raffeck > Cc: linux-kernel@i4.cs.fau.de > --- >  drivers/tty/serial/8250/8250_pci.c | 4 +++- >  1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250_pci.c > b/drivers/tty/serial/8250/8250_pci.c > index 1dd607f..50ab301 100644 > --- a/drivers/tty/serial/8250/8250_pci.c > +++ b/drivers/tty/serial/8250/8250_pci.c > @@ -854,8 +854,10 @@ static int pci_netmos_init(struct pci_dev *dev) >   } >   } >   > - if (num_serial == 0) > + if (num_serial == 0) { > + moan_device("unknown NetMos/Mostech device", dev); >   return -ENODEV; > + } Yep! However, you forgot to fix switch-case as well. >   >   return num_serial; >  } -- Andy Shevchenko Intel Finland Oy