From patchwork Thu Jun 23 02:00:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 907712 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5N20wGl023274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 23 Jun 2011 02:01:19 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QZZE2-0006J9-Pf; Thu, 23 Jun 2011 02:00:58 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QZZE2-0006Il-7E for spi-devel-general@lists.sourceforge.net; Thu, 23 Jun 2011 02:00:58 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.83.175 as permitted sender) client-ip=74.125.83.175; envelope-from=dirk.brandewie@gmail.com; helo=mail-pv0-f175.google.com; Received: from mail-pv0-f175.google.com ([74.125.83.175]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1QZZE1-0007cc-Gu for spi-devel-general@lists.sourceforge.net; Thu, 23 Jun 2011 02:00:58 +0000 Received: by mail-pv0-f175.google.com with SMTP id 24so1239109pvf.34 for ; Wed, 22 Jun 2011 19:00:57 -0700 (PDT) Received: by 10.68.52.4 with SMTP id p4mr835268pbo.127.1308794457247; Wed, 22 Jun 2011 19:00:57 -0700 (PDT) Received: from localhost.localdomain (static-50-43-44-248.bvtn.or.frontiernet.net [50.43.44.248]) by mx.google.com with ESMTPS id u6sm846417pbh.80.2011.06.22.19.00.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2011 19:00:56 -0700 (PDT) From: dirk.brandewie@gmail.com To: linux-kernel@vger.kernel.org, spi-devel-general@lists.sourceforge.net Subject: [PATCH 11/11] spi-dw: remove noop else clause Date: Wed, 22 Jun 2011 19:00:13 -0700 Message-Id: <1308794413-11069-12-git-send-email-dirk.brandewie@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1308794413-11069-1-git-send-email-dirk.brandewie@gmail.com> References: <1308794413-11069-1-git-send-email-dirk.brandewie@gmail.com> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is freemail (dirk.brandewie[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL -0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1QZZE1-0007cc-Gu Cc: Dirk Brandewie X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 23 Jun 2011 02:01:19 +0000 (UTC) From: Dirk Brandewie The value of spi->bits_per_word is checked on function entry to be 8 or 16. The else clause has no meaning since it can never be reached. Signed-off-by: Dirk Brandewie --- drivers/spi/spi-dw.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 7b3f607..5ddd45f 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -667,17 +667,14 @@ static int spi_dw_setup(struct spi_device *spi) chip->enable_dma = chip_info->enable_dma; } - if (spi->bits_per_word <= 8) { + if (spi->bits_per_word == 8) { chip->n_bytes = 1; chip->dma_width = 1; - } else if (spi->bits_per_word <= 16) { + } else if (spi->bits_per_word == 16) { chip->n_bytes = 2; chip->dma_width = 2; - } else { - /* Never take >16b case for DW SPIC */ - dev_err(&spi->dev, "invalid wordsize\n"); - return -EINVAL; } + chip->bits_per_word = spi->bits_per_word; chip->speed_hz = spi->max_speed_hz;