Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 836A5C433F5 for ; Thu, 12 May 2022 19:28:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C4FD581DE9; Thu, 12 May 2022 21:28:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="IB/33UW6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4072683922; Thu, 12 May 2022 21:28:10 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6ECEA80818 for ; Thu, 12 May 2022 21:28:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6905961CE2; Thu, 12 May 2022 19:28:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6A58C385B8; Thu, 12 May 2022 19:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652383684; bh=CE95Q3y+QWE3QOeXs9lxyF125UAjd53m3rNh4oCRzzM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IB/33UW6A5mMp+MCqLAvEoyFzeE1oAsAWttHEJDsm5fKPFopxHCZhAt8VPUCyghUY roaCqx/p7teRj97K0ycNwwR8LZy748CJoBfNBg4VkSmbvJy0ZFtkHy7GgNGxJZCNJu xH7CSTkd9kyoN7p9C0e13n6cKu9/HBwVL0r9ubDwNstHXXTX8NUFDjnfHGh6Yhhz3U +cNEcnCYw2KKAe8zVBkDVR1W9y33KwGq2a51lS4iGQkv9/t7BqxJGbLS0JB0hKQ708 TidXdyNQujf7m37cnGRkFS8MimyVOCaPOVCCRAjhmtiw8MuYqHPg0c5u9MwE9qX1Q5 TYm/eLSZ/rwOA== Received: by pali.im (Postfix) id C4B69281B; Thu, 12 May 2022 21:28:01 +0200 (CEST) Date: Thu, 12 May 2022 21:28:01 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Sean Nyekjaer Cc: u-boot@lists.denx.de, Sean Nyekjaer , trini@konsulko.com, miquel.raynal@bootlin.com Subject: Re: [PATCH v2] fs/squashfs: use lldiv function for math Message-ID: <20220512192801.sseyehcxvesmi3od@pali> References: <20220512183714.2846555-1-sean@geanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220512183714.2846555-1-sean@geanix.com> User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Thursday 12 May 2022 20:37:14 Sean Nyekjaer wrote: > From: Sean Nyekjaer > > When compling for x86: > ld.bfd: fs/squashfs/sqfs.o: in function `sqfs_read': > u-boot/fs/squashfs/sqfs.c:1443: undefined reference to `__udivmoddi4' > ld.bfd: u-boot/fs/squashfs/sqfs.c:1521: undefined reference to `__udivmoddi4' > > Signed-off-by: Sean Nyekjaer > Reviewed-by: Miquel Raynal Reviewed-by: Pali Rohár > --- > Changes since v1: > - switched to the correct lldiv() instead of do_div() > > fs/squashfs/sqfs.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c > index 5d9c52af80..08414571fc 100644 > --- a/fs/squashfs/sqfs.c > +++ b/fs/squashfs/sqfs.c > @@ -8,6 +8,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -1440,7 +1441,7 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len, > } > > for (j = 0; j < datablk_count; j++) { > - start = data_offset / ctxt.cur_dev->blksz; > + start = lldiv(data_offset, ctxt.cur_dev->blksz); > table_size = SQFS_BLOCK_SIZE(finfo.blk_sizes[j]); > table_offset = data_offset - (start * ctxt.cur_dev->blksz); > n_blks = DIV_ROUND_UP(table_size + table_offset, > @@ -1516,7 +1517,7 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len, > goto out; > } > > - start = frag_entry.start / ctxt.cur_dev->blksz; > + start = lldiv(frag_entry.start, ctxt.cur_dev->blksz); > table_size = SQFS_BLOCK_SIZE(frag_entry.size); > table_offset = frag_entry.start - (start * ctxt.cur_dev->blksz); > n_blks = DIV_ROUND_UP(table_size + table_offset, ctxt.cur_dev->blksz); > -- > 2.35.1 >