From patchwork Mon May 11 22:53:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Streetman X-Patchwork-Id: 6384701 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E1C9BEEE1 for ; Mon, 11 May 2015 22:54:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B46F2042C for ; Mon, 11 May 2015 22:54:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE4CD203FB for ; Mon, 11 May 2015 22:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbbEKWyD (ORCPT ); Mon, 11 May 2015 18:54:03 -0400 Received: from mail-ig0-f179.google.com ([209.85.213.179]:37198 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751980AbbEKWyD (ORCPT ); Mon, 11 May 2015 18:54:03 -0400 Received: by igbsb11 with SMTP id sb11so85959361igb.0 for ; Mon, 11 May 2015 15:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=g4cduHxPber/I+sLatUgVC71xM7Fzg69z9FYBDTCkpc=; b=lqLyd4rcl9PY1/ZBHIRAl8Hx+ku3zFQWiIiVFYvrai0wISvERjIW2d21bnOD237YP3 3LZDk6/kJJ3j7imbTsOuyBTidZe8+c0KNLwmsx0wfOXJ/xb0u+v0tldmyJwEI5o8HWac G2uQmGjqEWvEceWOeW4RFzxIs5t+An84dUTV0m+a98NZCqrLXM7Uy7Hy9FAd7P9J6fXX QI0ZYubxepKpqCABX5NcT4dVKeLUGz2TPY4WX7x3CQvXmWwFMdDEGtZ9/wLLmeX4CW0G 9kWnywn24Q9rwNtPsYOR2Ui/Dt8AaHvv6REwvjxETUt5UVc50/U4RLZN0KtUHaqBhXul 644A== X-Received: by 10.43.173.70 with SMTP id ob6mr13608417icc.45.1431384842349; Mon, 11 May 2015 15:54:02 -0700 (PDT) Received: from toughbook.com (user-0c8ho8q.cable.mindspring.com. [24.136.225.26]) by mx.google.com with ESMTPSA id 9sm10677794iom.29.2015.05.11.15.54.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 15:54:01 -0700 (PDT) From: Dan Streetman To: Linux Crypto Mailing List Cc: Dan Streetman , Herbert Xu , Fengguang Wu Subject: [PATCH] crypto: correct 842 decompress for 32 bit Date: Mon, 11 May 2015 18:53:36 -0400 Message-Id: <1431384816-21606-1-git-send-email-ddstreet@ieee.org> X-Mailer: git-send-email 2.1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid 64 bit mod operation, which won't work on 32 bit systems. Simple subtraction can be used instead in this case. Reported-By: Fengguang Wu Signed-off-by: Dan Streetman --- lib/842/842_decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c index dbeb058..999b629 100644 --- a/lib/842/842_decompress.c +++ b/lib/842/842_decompress.c @@ -185,7 +185,7 @@ static int __do_index(struct sw842_param *p, u8 size, u8 bits, u64 fsize) /* this is where the current fifo is */ u64 section = round_down(total, fsize); /* the current pos in the fifo */ - u64 pos = total % fsize; + u64 pos = total - section; /* if the offset is past/at the pos, we need to * go back to the last fifo section