Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp239064imm; Tue, 15 May 2018 00:36:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrjv+CsgDefCJe6zYLA90FTdYQKTwlorpCA0/aUwzF9JDnyuG6rpNOjAJcWZ7uO34I/71UM X-Received: by 2002:a65:6188:: with SMTP id c8-v6mr11278288pgv.131.1526369775182; Tue, 15 May 2018 00:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526369775; cv=none; d=google.com; s=arc-20160816; b=s5GVGGieF0+oBj6GAUIM7pdBFWLVzty7iDEl8pPPYBxrgEaZJmhskC1dlXVPsvVriL LjWIHohgiAZZvKENg5S1u3zKpSSw8FuTrjM9VSxARfj0V3Iu+G5kp5jKDCzYa2xkZZKm Sl1eCPxwhto/cZatYQzRTApJ1ohNMiH3LQyBcBHgW3AMQc3AvXDK59pwD32ThvaQKnkL gEuDaPEuKjZnIqLZj9pE1bCRJCW4ftFKb7aCLcx7elYpJJWiFyvhxH7QG9CENNwwlWGF VSKH/6RaVreSTv+R6nFKanITkHPn5yxbt8E5K7hE1uODKg+hRoBeGpZH4RuS1AFbs+Gq Q8lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=bUD2pBTWVLeNh3OHVEwHBAo3tJ57wXoxsgQS5FIY6Fk=; b=Ro//oTWSbDPppLlbqykFfrWsEbnwO6tTjqP41GTi7yLuxqSJf+YSx48KqeSYwChKFT ZuTZKEQDYJSejatkn5vry07tPrn0BRPg0FJyYLI1Ob74EVPZUHiKb6myrCnUu9S0kZBa NJI8d/o+vEc3ArZOO3CInq6g1o8pSXuaX+I/9hb6cbFZxTygArshRU25MdhjHEc5vlIK DFxpJi0SLYSyrVmEF7zmkkxvRP1wtRQtgzQxypNh/La8AgJFn1yEMoTxkzyS1MU7szs/ 8hxDIRGlm45beS02ZRIPaRqWzH6IFWNgUX7TiXxqLiUOyZYez+pOi70R4ILaHASNYd/G buhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11-v6si6731895pgq.501.2018.05.15.00.36.01; Tue, 15 May 2018 00:36:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbeEOHfm (ORCPT + 99 others); Tue, 15 May 2018 03:35:42 -0400 Received: from mail.bootlin.com ([62.4.15.54]:47442 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbeEOHfk (ORCPT ); Tue, 15 May 2018 03:35:40 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 91BC9208BF; Tue, 15 May 2018 09:35:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.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 bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 8D6AA20737; Tue, 15 May 2018 09:35:25 +0200 (CEST) Date: Tue, 15 May 2018 09:35:25 +0200 From: Boris Brezillon To: Andy Shevchenko Cc: Shreeya Patel , Masahiro Yamada , Jane Wan , Miquel Raynal , Linux Kernel Mailing List , Marek Vasut , ties.bos@nokia.com, prabhakar.kushwaha@nxp.com, "open list:MEMORY TECHNOLOGY..." , jagdish.gediya@nxp.com, Richard Weinberger , Shawn Guo , Brian Norris , David Woodhouse Subject: Re: [PATCH v5 2/2] mtd: rawnand: use bit-wise majority to recover the contents of ONFI parameter Message-ID: <20180515093525.051856dd@bbrezillon> In-Reply-To: References: <1525920400-11392-1-git-send-email-Jane.Wan@nokia.com> <20180510140311.02805561@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 May 2018 20:54:36 +0300 Andy Shevchenko wrote: > On Thu, May 10, 2018 at 3:03 PM, Boris Brezillon > wrote: > > >> +#define GET_BIT(bit, val) (((val) >> (bit)) & 0x01) > > > > Not sure we need that macro, see below. > > +1. We have too many nice helpers for bit manipulations > (for_each_set_bit() as an example). > > > > for (k = 0; k < nbufs; k++) { > > const u8 *srcbuf = srcbufs[j]; > > > > if (srcbuf[i] & BIT(k)) > > m++; > > } > > ...which is effectively hweightXX(). No it's not.