Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4921765yba; Tue, 30 Apr 2019 06:33:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr6Zd5r4eJAacuH8ux6TiMbnpGUALlPfyUCD2xc2OAjyHwm52Tqqvh6DaQjAAlQaNM2LRn X-Received: by 2002:a63:5466:: with SMTP id e38mr67467895pgm.340.1556631226680; Tue, 30 Apr 2019 06:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556631226; cv=none; d=google.com; s=arc-20160816; b=FdiUWO8OcK8648/B+U1Ok9rJBaoLtDRgIdfd5RO1v6lGiyDfxjHpPfzWEVPBk8uUkp mPYLhrgaSWklOuUrXK0b9XPlsmwukU8WTIVWawdSVLq+zGMCbSTg40yDOWpawPPXUUVY wcVXx6JKWKzcPBdsYOYMBLqeKppnQ/2qCPNj9FjMDMpCcxDL/xWRwdxuiwURZe745Tmv v0XhwoxvDNfBNaDQAERU5iWlon3p9iouiRCpNRuyw4GzDZ2ziWmCnUSkXsjPZqNQhNVa eU04rNvZmF+pJVM9zrvvJyFGpogtLzrbGD3R3GCdvRijDCPc2lbKdJv1qRdRNA/HlrGX Cb+Q== 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; bh=nMPoH35x5bq7483H+91AkH1RJePV4Du6v5zOXvqkvu8=; b=Hd7foUK3ZwGDilVbsGNSWe41bl3kDzJrJfKneujMbBIPTmpJl98W7OEyYy+iZ0UDKv EqW9Pq05OFwTgl0PQcznztHzCaong9Odtitv4clDquM1GNabxBJTUvwura5eswWnos0t lNFyquucDmzHqqyQRzG5KvZH1c/QsauvNhc+gtSwljdbYGj/j7AQlyFHTatbgNMx4Y9y bgDErCOS+MoNKtQvP0K+5TpbVTG0xNwyuHxuA1HlhXB9iQXEpZGv0Si0M1VrqxIXw8Ep dRTwYlJuZg+s5lJSgC1xhEYdigxGoaujF1DxryGWbIsGjIB9ZOPd0okdNKA2CGGgWmSt wAeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P7uEODNt; 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 j91si4578210pld.298.2019.04.30.06.33.30; Tue, 30 Apr 2019 06:33:46 -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=P7uEODNt; 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 S1727470AbfD3Ncg (ORCPT + 99 others); Tue, 30 Apr 2019 09:32:36 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34736 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbfD3Nce (ORCPT ); Tue, 30 Apr 2019 09:32:34 -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=nMPoH35x5bq7483H+91AkH1RJePV4Du6v5zOXvqkvu8=; b=P7uEODNtZUFXsXvCEiyD2XZcA m+3iOXQkVYLCUmow1Fhe1Hug/sDPFGPVB5l6l+A5qTz1t/cgwg3tFyGiAsQ/sTZ/KUZfaWr/RCpyF f1N5k5LKqJiScJYPZvCSkQfQeoFag1jypQvLF8Krl8dWaqfKVkaiT4VolA5WAi/dPRJT/7I3Szai3 2BsfMhTpk5ethQuxzjaaeDm+hjoYflyP+97qgJp3bnltos7VS8W+xQof4wjvCQNnGo2EFw0zwHkDO nMgn+V1O7R76Fan6dyyReWQLrg6UdDv8nSjV485CTX+nEUr2p49hSXHC7iHC75F5wj5uGKnWcr+UG ytj/77oiA==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLSs3-0008Qf-SI; Tue, 30 Apr 2019 13:32:31 +0000 Date: Tue, 30 Apr 2019 06:32:31 -0700 From: Christoph Hellwig To: Phong Tran Cc: robh+dt@kernel.org, frowand.list@gmail.com, pantelis.antoniou@konsulko.com, natechancellor@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] of: replace be32_to_cpu to be32_to_cpup Message-ID: <20190430133231.GA5646@infradead.org> References: <20190430090044.16345-1-tranmanphong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430090044.16345-1-tranmanphong@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 30, 2019 at 04:00:44PM +0700, Phong Tran wrote: > > diff --git a/include/linux/of.h b/include/linux/of.h > index e240992e5cb6..1c35fc8f19b0 100644 > --- a/include/linux/of.h > +++ b/include/linux/of.h > @@ -235,7 +235,7 @@ static inline u64 of_read_number(const __be32 *cell, int size) > { > u64 r = 0; > while (size--) > - r = (r << 32) | be32_to_cpu(*(cell++)); > + r = (r << 32) | be32_to_cpup(cell++); > return r; This whole function looks odd. It could simply be replaced with calls to get_unaligned_be64 / get_unaligned_be32. Given that we have a lot of callers we can't easily do that, but at least we could try something like static inline u64 of_read_number(const __be32 *cell, int size) { WARN_ON_ONCE(size < 1); WARN_ON_ONCE(size > 2); if (size == 1) return get_unaligned_be32(cell); return get_unaligned_be64(cell); }