From patchwork Sun Apr 28 20:28:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 324 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CCDAE3F08F for ; Sun, 28 Apr 2019 22:29:26 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id g1sf6142505pfo.2 for ; Sun, 28 Apr 2019 13:29:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483365; cv=pass; d=google.com; s=arc-20160816; b=aBkf2Q93lPXKiEp+oURgqHuJN7nMeTSRSwQbOdRaPmaQdidyzrcJfv5DuebWiStb8R /SygwLYpPxMOU1fMqEnCPnQeykTQfMbIOANe78N4S85QZDgkZVyV1QQA7e2y8zsdJVt7 6PsQ2ZwnpFeAJOdQLL3woClOC0i7ohHL1q9GCB2cI5oM0cCU3Ewg6iLurfdEz0foEahg yqYE9zBJnMe/HVs2SOPJ4k/hvpyKxbdhWpPGJqnjznDRcGYWShN/PVNxDZwn+KAL+RgQ 1KNB96YxEaxEMlnXQFbULKfmls7nTwA80WO8FocidaDgUU7oeSokE+yzm2kuix3IA2SK ljgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jc7M9SxfnXIA0hRxgIT58mPu8h1amSoU6MjCzMhpBlo=; b=a2LhdcK5F8N6KPcWRb8vWk5j8wg/dk1cF12e+Ll3wU0Nniiqbq/EeuNhFrmrvd/1Bb 4ygjIgCcn880VUgSrVbXV380/Lz6OeevmP02zWbJpLGwjndyR0RM4t404DultyIUB/8U +D/YDn0HH2LOClIcenN1/b0Xq59i/gWZwE3VVBYd3AgA5EsqN8nJ/gNSZlodo/EF6RGu YBZWaQSOwVVNVGBIqhVkeITRkkFAuOFPq2UqdEktEFpBSalEzU9RdHgH/kHqFyJf3C8O MWDZccgNQP7W2h3b5Z9N5a3X8JU3ZHL8w7in4is3AIf4n2qTNgcE4GzW8uFqjiQSV/XR y+sQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AlC+hMGl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=jc7M9SxfnXIA0hRxgIT58mPu8h1amSoU6MjCzMhpBlo=; b=dYTIISZtUigWki0fLuEu7MnjIWYxbCU8swuYrtdtB6rvKu2A159xhRidVlSjcC348k /nsMikucvDrc92wb2JFygqC44izJIzY7L/SHnaHOMhBmp1qDSG3itShP5wBC6Hz4Duuf QzdTVDZ8QQH4DuR+TduJM8lAa/pA6hLKPg68o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=jc7M9SxfnXIA0hRxgIT58mPu8h1amSoU6MjCzMhpBlo=; b=EcMJNzNfGMxPVeUmE5loyFVxaD/2G3T46prOLXVZt08rz2UwhxxSSrIN15waUBR43J pp7B5xmCF0QoJGMJq0q+pjKjc8otab003R4mo07hJKedOGKvBuAHRAUTRThalx6iRxAx ZHMuk+zhIzeJABx35L8HxcwGBs3XXm2CB+xz8vwuX7ZfY8dYqm8Qa+LaqQ2YrBn5P8b3 oPI3GS1jCo3Y4oxA3es2331uJ42UJewaxxRM+ajlRiMOvciZ/Mc7qU+3DdrerSnNFZSu Gn36ZwvhczuHHK1NeJZu8MLEgNqd6Qcl1I6abMIQtw+4RfVs7QOFwdoKm19EcRBMNA5k wyEw== X-Gm-Message-State: APjAAAU22xN/umU9IU5KppRTO8+lsXhwOQ/ZMUA6z4J87o5rvmik2Mgz R4s1Yaa1WovEickZsAyr7VcxCYT4 X-Google-Smtp-Source: APXvYqzW6EtapgNpwOnmlFklGfKNyCUdOXk9Z21+kMVGtbtWRO4SzgaECkZ6+LkpwffppWajTMAAYw== X-Received: by 2002:a63:c54e:: with SMTP id g14mr55201009pgd.265.1556483365629; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:690a:: with SMTP id e10ls541262pfc.12.gmail; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) X-Received: by 2002:a63:f058:: with SMTP id s24mr1878740pgj.257.1556483365292; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483365; cv=none; d=google.com; s=arc-20160816; b=LGdRgJCIA8Ppn0mPMC2ajUb5COi9XG7EF4iv3fS2e6NGtDFAQX/a8jGz03ssUrl42h SwB3EmLAyfvg2YyuFsZLmYbiS2GYInHYLmT9YgYCYS83sxSjotHyvST1fZJzF/jk9+SI 50Tz3ky7AyTyTOLY3qYI5lyUt3z5xtnP1FoLgTV6BiaZiKDu5iimfyDkU1xun0mjAxp3 YxSa8WTk9kAZwFdXYLxbjahtQgA5H3mhqCPov7XNAK1IM1w0QT0UdWlEYrlR5LksWUXA 1U1Rllhq/1QXghfm9jueEram6du4XkRjY+/3RxDLdRCc14Rt13fs67zXGySRVkzvokzy jr/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=b6Eec9qVRXvJMUOqgwcEo2biB8N8n2ZN2Fv/Qr8PBR0=; b=nr7t7CUlE5kPndZMRieHyElzrezC1jwuZM1WOubP+AYuR8wLYhvwHY3IvMMmlNUg8F k/16Z3euhNonoYMF7HjeRimlYIdWQad9O3wu07UD0Y7Tx+zO5sFBSRmk90+CVy8VKWkU jbhc66NrW/BbGKkFEW+JFu4O8W5ot1P2Do2Nn3owgVpz7Idp8BmIjdrNCdGp0NWjHqh2 W5129VhKakVDjrh1NoSy+qdynDd345ZfXidmKUz6YbFnicSp0OZvLdXac3TvJr9vM1re JmxJagj9FRglRhlr7Kn91nuVnWKTDIm3MrPlQijiJRLxLXNtqSq1H+gwum/8UTNxTpwZ 4BqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AlC+hMGl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f23sor6981580plr.4.2019.04.28.13.29.25 for (Google Transport Security); Sun, 28 Apr 2019 13:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:86:: with SMTP id a6mr57641661pla.277.1556483365043; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:24 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 08/19] spi: mpc8xxx: Simplify if Date: Mon, 29 Apr 2019 01:58:43 +0530 Message-Id: <20190428202854.8590-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AlC+hMGl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Instead of having a nested if block, just have two branches within the overarching if block to eliminate one nesting level. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index da9e1e3f98..ca34570901 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -120,13 +120,11 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, clrbits_be32(&spi->mode, SPI_MODE_EN); - if (bitlen <= 16) { - if (bitlen <= 4) - clrsetbits_be32(&spi->mode, 0x00f00000, - (3 << 20)); - else - clrsetbits_be32(&spi->mode, 0x00f00000, - ((bitlen - 1) << 20)); + if (bitlen <= 4) { + clrsetbits_be32(&spi->mode, 0x00f00000, (3 << 20)); + } else if (bitlen <= 16) { + clrsetbits_be32(&spi->mode, 0x00f00000, + ((bitlen - 1) << 20)); } else { clrbits_be32(&spi->mode, 0x00f00000); /* Set up the next iteration if sending > 32 bits */