From patchwork Mon Aug 31 14:46:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 512510 X-Patchwork-Delegate: trini@ti.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 4A63A1401E7 for ; Tue, 1 Sep 2015 00:47:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 69DE14B7B6; Mon, 31 Aug 2015 16:47:02 +0200 (CEST) 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 K_P6NYHOgtu0; Mon, 31 Aug 2015 16:47:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 144A54B7D3; Mon, 31 Aug 2015 16:46:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 064144B77C for ; Mon, 31 Aug 2015 16:46:27 +0200 (CEST) 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 Td6uWOVCwRYj for ; Mon, 31 Aug 2015 16:46:26 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by theia.denx.de (Postfix) with ESMTP id 019D94B72C for ; Mon, 31 Aug 2015 16:46:23 +0200 (CEST) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1B3744965; Mon, 31 Aug 2015 16:46:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AToulouse-657-1-1058-12.w83-193.abo.wanadoo.fr [83.193.172.12]) by mail.free-electrons.com (Postfix) with ESMTPSA id D051548FA; Mon, 31 Aug 2015 16:46:22 +0200 (CEST) From: Maxime Ripard To: Hans de Goede , Ian Campbell , Marek Vasut , =?UTF-8?q?=C5=81ukasz=20Majewski?= Date: Mon, 31 Aug 2015 16:46:04 +0200 Message-Id: <1441032373-16992-5-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1441032373-16992-1-git-send-email-maxime.ripard@free-electrons.com> References: <1441032373-16992-1-git-send-email-maxime.ripard@free-electrons.com> Cc: Rob Herring , u-boot@lists.denx.de, Alexander Kaplan , Tom Rini Subject: [U-Boot] [PATCH 04/13] sparse: Simplify multiple logic X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" To check the alignment of the image blocks to the storage blocks, the current code uses a convoluted syntax, while a simple mod also does the work. Signed-off-by: Maxime Ripard --- common/aboot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/aboot.c b/common/aboot.c index 65e633acfcb9..c8556d9b23f4 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -269,8 +269,7 @@ void write_sparse_image(block_dev_desc_t *dev_desc, } /* verify sparse_header->blk_sz is an exact multiple of info->blksz */ - if (sparse_header->blk_sz != - (sparse_header->blk_sz & ~(info->blksz - 1))) { + if (sparse_header->blk_sz % info->blksz) { printf("%s: Sparse image block size issue [%u]\n", __func__, sparse_header->blk_sz); fastboot_fail("sparse image block size issue");