Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1379364imm; Sun, 2 Sep 2018 21:33:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY+vCCHuSe71KLPtCbBnl+bR3WolS453H7222Jnu6RWu2PqVbbk9q2247q//aY8vbcTc+Yh X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr26902873plp.212.1535949195595; Sun, 02 Sep 2018 21:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535949195; cv=none; d=google.com; s=arc-20160816; b=H02hik+4F1vAMfsv7ik/rHeYimVvLPlT47TquOjtcAE+po2Q/rQuIRY6wbTz1NZiWU 6tWDTRftJT73LdIMLWof7tlcr3wgUTfxxo36eCN5CL/rmmQVW/mzJZe/f+CKPe3y6UHP TAu8FUlzEYFCm+UDhwXJIRpQeAdwpcMxbIZrQOjFa5hRZoPr4nkrqsZL4vAgpTNuS8im aC/n9EcWX0rUFD6VdqtBkHN+17u9igvtaVElJvJuXYz+CEVcJ2+bp6KFMNRjLx/vU4CA mparNIpvrxDm1pyTRXQBdBIbAzt5zRAEJCmEwkBlSr5jHgX1HvYCxQ/bwQyq76oK4/LG VJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ogoiR0/3aNqNVfLK4e66ESmPUII43RF0TuXmuQ4BhXQ=; b=0DpafjXi/sstkRMn53dkUUpcHfhuQq/iGF96xLTnVf4OHkV1wCciCcHd5e8/e0N+96 nC1qxjATlFgQX8sgFi4LctWo22v8dIOzaHA26AkcuXJy7pSCuLKXL03xq6RRqQ50JssA 2Vi6QR11yF4IUFQc2RzFsa7XUyaGLM9IeKOsTYp8ZS81hnrmh1lDXrH4Orgc4Vkkrqx2 k+2X3C30ISu3J0A+Kl/sIHcQErFsqh4vcl7aDYgXDLAZJITnMQetyP5f6zLFnDKmocdb pZpbU+uloDlEi2FRytDFbBvNVzkW2UC4Vfa16WkZqVE6juQcPgb9fktEQw7bFNUtGmT9 bTqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m4H3d0+7; 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 w12-v6si16326013pld.362.2018.09.02.21.33.00; Sun, 02 Sep 2018 21:33: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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m4H3d0+7; 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 S1726167AbeICIuR (ORCPT + 99 others); Mon, 3 Sep 2018 04:50:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51150 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbeICIuR (ORCPT ); Mon, 3 Sep 2018 04:50:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ogoiR0/3aNqNVfLK4e66ESmPUII43RF0TuXmuQ4BhXQ=; b=m4H3d0+7HizxVv/kXOXq/0HGz vxp9VLMeA+aCuLPFdJSsy9oXxHL6l0b3cEQHmxTWCJPp4LFvymq8W9IZoG5H8iz/ZBwsnrv5NNipL vJ9/TeEC2hARx34r13WWhWws5BmMCmLst3cnysk7J/UEoaTrWcJmLz1WywGlhe7eM+MlyGPweATDs QMknxPgLSKCxiVN+EAzo1H3BJfaDKAkgzqbjqgyMEwyWtubULU/I2Vd4SQw3tufSYqNLm+Hws8vE9 uolEGaEP7dw0Hihz+1JeeYHFjinAmNSaGgiv+M3aImG351ST1rKMgZ1uSFrcCeoe0viAHMYZPSnwa Y2a6ckOXA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fwgWP-0007F5-K5; Mon, 03 Sep 2018 04:31:29 +0000 Date: Sun, 2 Sep 2018 21:31:29 -0700 From: Matthew Wilcox To: Janusz Krzysztofik Cc: Linus Walleij , Jonathan Corbet , Miguel Ojeda Sandonis , Peter Korsgaard , Peter Rosin , Ulf Hansson , Andrew Lunn , Florian Fainelli , "David S. Miller" , Dominik Brodowski , Greg Kroah-Hartman , Kishon Vijay Abraham I , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Jiri Slaby , Willy Tarreau , Geert Uytterhoeven , linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-serial@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastien Bourdelin , Lukas Wunner , Rojhalat Ibrahim , Russell King , Tony Lindgren , Yegor Yefremov , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v7 1/4] gpiolib: Pass bitmaps, not integer arrays, to get/set array Message-ID: <20180903043129.GA17856@bombadil.infradead.org> References: <20180831225616.29221-1-jmkrzyszt@gmail.com> <20180902120144.6855-1-jmkrzyszt@gmail.com> <20180902120144.6855-2-jmkrzyszt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180902120144.6855-2-jmkrzyszt@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +++ b/drivers/auxdisplay/hd44780.c > @@ -62,17 +62,12 @@ static void hd44780_strobe_gpio(struct hd44780 *hd) > /* write to an LCD panel register in 8 bit GPIO mode */ > static void hd44780_write_gpio8(struct hd44780 *hd, u8 val, unsigned int rs) > { > - int values[10]; /* for DATA[0-7], RS, RW */ > - unsigned int i, n; > - > - for (i = 0; i < 8; i++) > - values[PIN_DATA0 + i] = !!(val & BIT(i)); > - values[PIN_CTRL_RS] = rs; > - n = 9; > - if (hd->pins[PIN_CTRL_RW]) { > - values[PIN_CTRL_RW] = 0; > - n++; > - } > + DECLARE_BITMAP(values, 10); /* for DATA[0-7], RS, RW */ > + unsigned int n; > + > + *values = val; > + __assign_bit(8, values, rs); > + n = hd->pins[PIN_CTRL_RW] ? 10 : 9; Doesn't this assume little endian bitmaps? Has anyone tested this on big-endian machines?