Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4325457ybg; Mon, 8 Jun 2020 05:10:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/fLCrCf/cGAyE5WSG4zHh66DwwMdYxtcn5OybxSllfK+5Kvs0/9Rz24QuYLFTfVTZ3N6a X-Received: by 2002:a17:906:ce28:: with SMTP id sd8mr12045797ejb.280.1591618249517; Mon, 08 Jun 2020 05:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591618249; cv=none; d=google.com; s=arc-20160816; b=ShYkUNmhJbTbcWuEfI0ZNybHupUAxxC5B+6mAknMoJRxOgDxfHcKW8BwM7cWq48YJW hyQV392ZoBb7OwZ7EkYqfwIelAbQqZLxNLCYi+K/xIStvQt/ljQkPTDPJtfQNlh8l8zT cFRbGGDxd+tCm8LUb1M8L3msWE8XxSmqHdzWejOjJP3yZIU/fVID3SMVY1uSkFbZXXFb ICyz5tZOJh7k75ROPZGaSmI6mEXXKhSb1pDe7gy70C/7QD6tjyuzPxKlyTeXS2Y0Oq88 1l3ugBWeEToEXapWrSBXGHpH+mm1T6uf8gQzX1aD6CYw9BoXrb5lkKpOTgISO8kIJgrz r6mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GgBLJ7JgYkUWmLexKJuiXlhG+mT6+4JFyp/4DW8tzGE=; b=uzgZijF5CzUgESjIlhm2yBEOzS3hrXH1wEZO4BV35YBaLHUsa9fS+rYCDVmKyS6YUu ckzAl3etrYsSwyH8+/VZobheeotWWEcMBG/E78wsbCgNgpkDxs5gG60mf7yJ/vUWucq8 FM4dyQL1UyRRvp8lRf3tjreoCO/2zOeplaWIrfCtVU7HRST+6GK4pzqwlQsM/DJbeJhO e+Eak1bFfZ5DTpF5UlQthhgSSh6sCiQ4IBF7iK5xFyLSWR56Osluc2NHhCOc/3op7hGb C1OPhXktKmYKocbkfEqlYSgmlcjFLk3iIpKGSYuejZ2uhPn0bGhWhI6pp7bTTaQI89U6 mDOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="vJ/uPack"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si8809414edu.30.2020.06.08.05.10.26; Mon, 08 Jun 2020 05:10:49 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="vJ/uPack"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729724AbgFHMIf (ORCPT + 99 others); Mon, 8 Jun 2020 08:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729620AbgFHMIe (ORCPT ); Mon, 8 Jun 2020 08:08:34 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440CDC08C5C3; Mon, 8 Jun 2020 05:08:34 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id u8so625959pje.4; Mon, 08 Jun 2020 05:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GgBLJ7JgYkUWmLexKJuiXlhG+mT6+4JFyp/4DW8tzGE=; b=vJ/uPackHiPEJpZBFGnMo0PZ+sGgOm0fjmWvkr04D7egXmPEkO7765q7IUD80bf47p yNiQ1KAqLgbb/VH1WwLqld0pq6TENtx1IWKkr2R9EVrCww+3BzJqxtuN8CXfsQw33gr2 7RbgwWrYzuJ/l0x7Jz89G/3lSH3K77eXgtyDI/h/Smp6H7TUKjn/Ap/+cCcTHPRI3HSB aFD72mATaPb8OMMuAY4jvN+y6vLeCdwjNSUthRZ68UjU3TlMFIZ1jhztXa0EzqZKWamc PQWzGy7lCE6n1JbgiV/Bc2jA9k1ktjPPu5q/8gYFvH+qZRgFyT5dIsaAWKGQPFEQL+dy w82A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GgBLJ7JgYkUWmLexKJuiXlhG+mT6+4JFyp/4DW8tzGE=; b=JGUogKpZNvgEy739GNIuIgfrIPw1cMPq0ApLU40LK+oWsgmQhoydhlK1J2a2jOViTh aWUw/LEj2RglI3IMzyWGRXkhacgrK8zSnTt5Z2JHt9nADx1CepZMlVWBj13zrSlQzJzI RMtT25SKk1gv+dvgRqeZLExtMyaEL4hpoYBHtDGCfvoXBRsGzEgyS2ET0vnQ2ramtm30 UytwEncajG0nmRwEOL6/Q2hJhkqy82ZmPQJ/ZRwXRZqSvazaCxVjOSP7VJeTGswXU9Ik col1ILoKjEDxVZ1Co+IVDCsnhwyp4w+qMybWLe0/StVSU4VJ5Crz1hsOPCKtKLcLtfbW qkIQ== X-Gm-Message-State: AOAM5333GrIfAzRvihmp3OLiTvTlzqW6PSMJcNXRJIPvHOHcAfjyiIYm O99tTj1cZ3mnRFF4HA1WmVHLrgVNpNgDdW7Evz0= X-Received: by 2002:a17:90a:b30d:: with SMTP id d13mr10169919pjr.181.1591618113794; Mon, 08 Jun 2020 05:08:33 -0700 (PDT) MIME-Version: 1.0 References: <1591611829-23071-1-git-send-email-agordeev@linux.ibm.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 8 Jun 2020 15:08:22 +0300 Message-ID: Subject: Re: [PATCH RESEND2] lib: fix bitmap_parse() on 64-bit big endian archs To: Alexander Gordeev Cc: Linux Kernel Mailing List , linux-s390@vger.kernel.org, Stable , Andrew Morton , Yury Norov , Andy Shevchenko , Amritha Nambiar , Arnaldo Carvalho de Melo , Chris Wilson , Kees Cook , Matthew Wilcox , Miklos Szeredi , Rasmus Villemoes , Steffen Klassert , "Tobin C . Harding" , Vineet Gupta , Will Deacon , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 8, 2020 at 3:03 PM Andy Shevchenko wrote: > On Mon, Jun 8, 2020 at 1:26 PM Alexander Gordeev wrote: ... > Can't we simple do > > int chunk_index = 0; > ... > do { > #if defined(CONFIG_64BIT) && defined(__BIG_ENDIAN) > end = bitmap_get_x32_reverse(start, end, > bitmap[chunk_index ^ 1]); > #else > end = bitmap_get_x32_reverse(start, end, bitmap[chunk_index]); > #endif > ... > } while (++chunk_index); > > ? And moreover, we simple can replace bitmap by maskp here, and drop it from definition block. -- With Best Regards, Andy Shevchenko