Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp622695pxk; Wed, 23 Sep 2020 11:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGULMPH8HOrEMfNwXYRKdDanhqUUmWGvqHkoPEPC84vwDvSo7VWRTLGzvbb/gqFw1JjaK3 X-Received: by 2002:a17:906:2659:: with SMTP id i25mr986169ejc.16.1600885930714; Wed, 23 Sep 2020 11:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600885930; cv=none; d=google.com; s=arc-20160816; b=duLOWriua0T8hmg0gcVA1hflvBOAuRpkOeQfKlFnUsNbLd4Y7eQspVmSSkaoFI6l1b bxitEs91tYSE182dg0v011s7fqJHUMzlsYZm/14UDyzXUPZacOYGBukpatAwtVD9Ttkq JrTppLOKVxb425mliZy9ucsdhqHYqmyVlsIWzLEf3SDZwRkolImgXoTwyYAoZZ50kz8W 9KEBL29j3BBeLv7Ndssvr/e5YwSVp8xKaTYAiSQw9LSUpdhoIORbU+/+bZYaF+ltC6+/ V3myA2zUrfV8076cnW4h/78I8iHOjyVKP+fjLT8cnpvljWir7JPQXCZlO9ZX5FBzlRdV uaZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=34Ih9w3V3dAmVMWJ0F9tervcqRn3iMtIRxvzMPjtLl8=; b=uf8ShHbDkxl2+gdEfESOF3HMYaKdGvFbqp72JptIqyXGpfsg89XQKzh7uisEjDLRio ncsrxX+js+ARqiEDfWkbnbefBGbi8pOryagYsG/iwEKPr3ETI00AbEFej0SB7FHtKn/0 IfgHDaoUxiSSwwJ82k7mFpi9jmVDkBL8tocQp6QKy7BulO2TABYufEq9PKQjQRDFx5fg CCbXrIDtLxfbPGsJh24OqcxIxQ1yqrlxLo+8awMPRz9lbkS37MSUKgCTXp4oJLwhfdDW AzCC0bQoKwx03iXsfFQvF20fXhCmr+5ymBvKIVecwVbDwKEllvUVCbdDB3ONy5iPWLVb SAnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs4si503707edb.261.2020.09.23.11.31.47; Wed, 23 Sep 2020 11:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbgIWSat (ORCPT + 99 others); Wed, 23 Sep 2020 14:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgIWSas (ORCPT ); Wed, 23 Sep 2020 14:30:48 -0400 X-Greylist: delayed 563 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 23 Sep 2020 11:30:48 PDT Received: from agrajag.zerfleddert.de (agrajag.zerfleddert.de [IPv6:2a01:4f8:bc:1de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7455C0613CE for ; Wed, 23 Sep 2020 11:30:48 -0700 (PDT) Received: by agrajag.zerfleddert.de (Postfix, from userid 1000) id 4FFAE5B20AD2; Wed, 23 Sep 2020 20:21:22 +0200 (CEST) Date: Wed, 23 Sep 2020 20:21:22 +0200 From: Tobias Jordan To: Andrew Morton , linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Jonathan Corbet , Mauro Carvalho Chehab , Jiri Kosina Subject: [PATCH] lib/crc32.c: fix trivial typo in preprocessor condition Message-ID: <20200923182122.GA3338@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Whether crc32_be needs a lookup table is chosen based on CRC_LE_BITS. Obviously, the _be function should be governed by the _BE_ define. This probably never pops up as it's hard to come up with a configuration where CRC_BE_BITS isn't the same as CRC_LE_BITS and as nobody is using bitwise CRC anyway. While skimming through some mailing lists, I learned that not only is this a safety critical bug[tm], it likely will also lead to a car crash unless fixed[1]. We can't let that happen, can we? As the safety experts are now for more than one month working on a patch already, it's maybe time to save them some effort. [1]: https://lists.elisa.tech/g/devel/message/1089 Fixes: 46c5801eaf86 ("crc32: bolt on crc32c") Signed-off-by: Tobias Jordan --- Sorry for spamming people in CC:, there doesn't seem to be a designated maintainer for lib/crc*. lib/crc32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crc32.c b/lib/crc32.c index 35a03d03f973..2a68dfd3b96c 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -331,7 +331,7 @@ static inline u32 __pure crc32_be_generic(u32 crc, unsigned char const *p, return crc; } -#if CRC_LE_BITS == 1 +#if CRC_BE_BITS == 1 u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len) { return crc32_be_generic(crc, p, len, NULL, CRC32_POLY_BE); -- 2.20.1