Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbdLMPGM (ORCPT ); Wed, 13 Dec 2017 10:06:12 -0500 Received: from mail.CARNet.hr ([161.53.123.6]:42371 "EHLO mail.carnet.hr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbdLMPGJ (ORCPT ); Wed, 13 Dec 2017 10:06:09 -0500 From: Valentin Vidic To: Greg Kroah-Hartman Cc: =?UTF-8?q?Simon=20Sandstr=C3=B6m?= , Marcin Ciupak , Marcus Wolf , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Valentin Vidic Date: Wed, 13 Dec 2017 15:21:49 +0100 Message-Id: <20171213142156.3201-1-Valentin.Vidic@CARNet.hr> X-Mailer: git-send-email 2.15.0 X-SA-Exim-Connect-IP: 2001:b68:ff:12::131 Subject: [PATCH 1/8] staging: pi433: collapse else block after return statement X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1487 Lines: 47 Fixes checkpatch warning: WARNING: else is not generally useful after a break or return Signed-off-by: Valentin Vidic --- drivers/staging/pi433/pi433_if.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index b4e6094ad553..02887988d2ea 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -773,11 +773,11 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos) if (device->rx_active) { mutex_unlock(&device->rx_lock); return -EAGAIN; - } else { - device->rx_active = true; - mutex_unlock(&device->rx_lock); } + device->rx_active = true; + mutex_unlock(&device->rx_lock); + /* start receiving */ /* will block until something was received*/ device->rx_buffer_size = size; @@ -1117,12 +1117,12 @@ static int pi433_probe(struct spi_device *spi) if (retval) { dev_dbg(&spi->dev, "configuration of SPI interface failed!\n"); return retval; - } else { - dev_dbg(&spi->dev, - "spi interface setup: mode 0x%2x, %d bits per word, %dhz max speed", - spi->mode, spi->bits_per_word, spi->max_speed_hz); } + dev_dbg(&spi->dev, + "spi interface setup: mode 0x%2x, %d bits per word, %dhz max speed", + spi->mode, spi->bits_per_word, spi->max_speed_hz); + /* Ping the chip by reading the version register */ retval = spi_w8r8(spi, 0x10); if (retval < 0) -- 2.15.0