From patchwork Fri Jun 14 13:12:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 251425 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1F61F2C0040 for ; Fri, 14 Jun 2013 23:12:55 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3986F4A019; Fri, 14 Jun 2013 15:12:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PMVWqbXMfMRL; Fri, 14 Jun 2013 15:12:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C9954A01C; Fri, 14 Jun 2013 15:12:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C7954A01C for ; Fri, 14 Jun 2013 15:12:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1S7Bzz9WJdNN for ; Fri, 14 Jun 2013 15:12:35 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by theia.denx.de (Postfix) with ESMTPS id 827B74A019 for ; Fri, 14 Jun 2013 15:12:27 +0200 (CEST) Received: by mail-pb0-f51.google.com with SMTP id um15so559138pbc.10 for ; Fri, 14 Jun 2013 06:12:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :mime-version:content-transfer-encoding:x-gm-message-state; bh=T3uPlWS6NhVI3QniwABFL/sged4yGyczE4Jk0C3Dn/c=; b=DOfnJqRea/+jWqKwJIoqvNJsl/4T/jEFzj+0wI6JirvAmV5ZZ/4t+MD/iEdWJcZmTR NpusetK4KJ4Hbt0NwCJTT8Osl1dt6Yn10RAbZJ1sAZ1wVawg9frqCJdnPYpVzaKimabN rwGhqlJPG6aPoQRyT8VQIMvs6YYiO+PQIUwpHzqlzmzJTNCmVaTqMDSBwVlkOyihG7u6 VIm+Tbk4+T9u+uqQtzcAVNKQmqFMycW8cz/gwWefGle24caTsD9Guvrw4MeHoey5MTf9 LTii2rEJUsmXH/lIow8ZXmvYZk8aptY4s9TIuaJo6/QdYYa5YbkyaoYiavvHo6dHJmBm eywQ== X-Received: by 10.69.0.38 with SMTP id av6mr2592773pbd.4.1371215545598; Fri, 14 Jun 2013 06:12:25 -0700 (PDT) Received: from [114.40.9.253] (114-40-9-253.dynamic.hinet.net. [114.40.9.253]) by mx.google.com with ESMTPSA id xd2sm2413977pac.15.2013.06.14.06.12.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Jun 2013 06:12:24 -0700 (PDT) Message-ID: <1371215539.3888.1.camel@phoenix> From: Axel Lin To: Jagannadha Sutradharudu Teki Date: Fri, 14 Jun 2013 21:12:19 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQnIzwinnBtP7/N+GPsvoltOrQbcvL33ZjD5fhav3I+mP5oT31lZI9r9MiAnkqoc9HZp4Jgw Cc: Fabio Estevam , Dirk Behme , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] spi: cf_qspi: Use DIV_ROUND_UP at appropriate place X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This change slightly improves readability. Signed-off-by: Axel Lin Signed-off-by: Richard Retanubun Reviewed-by: Jagannadha Sutradharudu Teki --- drivers/spi/cf_qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c index a37ac4e..06bcf91 100644 --- a/drivers/spi/cf_qspi.c +++ b/drivers/spi/cf_qspi.c @@ -171,7 +171,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, volatile qspi_t *qspi = dev->regs; u8 *txbuf = (u8 *)dout; u8 *rxbuf = (u8 *)din; - u32 count = ((bitlen / 8) + (bitlen % 8 ? 1 : 0)); + u32 count = DIV_ROUND_UP(bitlen, 8); u32 n, i = 0; /* Sanitize arguments */