Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3653896imm; Mon, 1 Oct 2018 02:10:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV61a/FPC2vjM3C4iiHGAh5sLWBO3kd7X/0H8DLHEtGbDzXVcfSCLvRcdEDQMnZXZBHqJa9ez X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr10596545plk.94.1538385020590; Mon, 01 Oct 2018 02:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538385020; cv=none; d=google.com; s=arc-20160816; b=Tf3rjx9/V3ZoJlsVI00Vx8nr47RWrXmH9vRZmsz9hh9E2gyjzL2fsRagTevCe2LUG6 gm8iS0XeDFB68WcrKYruvovTBsgctztlEw5cMztMuqK+/PqgZrN7Qo+vtX5hQXxRbVyK wcY1fLsSWG1+W6vJe0/s/eVSX3JR5i8udKNqXw0/Q3yFQr6WI8g2t7tIuT7HWA4an4j0 AXzRRzh1BW1mKhzaMLK1MojfsE3db8uayfoHZC4qwQsa9+KLu1yamg8FdVy90dTwatC0 oqjv1CSzaBCGLjpaun6xutX+wV2ykTUHdsccVnLYpyJFWvHaLrw8X063w/GN6LIcM079 Hx9g== 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; bh=SKXSDvSjlRz7GoPDPLRpeiXzVW8V0ttQ+Qqv53DNnkM=; b=MMnn7ebTB2sY9enzBD/Jz7aZRGoIZKh34rGQqLOI1HjRWXZwGtVSu9bIFJo6xYILWL TZ48dyrV9L/+VPQa1QPOVxfJ4TJZKc0jQIpAb/8Cu5wYj4aCccik6Rpefpe8gDvqKQVR W9zxxll/cxzSgmfonWqmhqvRsbYryKfsYpHbMO2NYttUXcs/GGRym0aMms8F+Yopu4IR vcODP/3C9FVtTNguqrS+VMeb0BtYa3DiGa5slIm8MQVo3TczesklXORMMmTsj/nAgtcj aWlRPNBzXCnXLGJRpsxLYFXnkwIWt5xNkF7VvsE+pLoZ6xZo2SSlgFePAlASrU9Vv+Lm SlqQ== 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 z12-v6si11475279pgz.665.2018.10.01.02.10.05; Mon, 01 Oct 2018 02:10:20 -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 S1729012AbeJAPqp (ORCPT + 99 others); Mon, 1 Oct 2018 11:46:45 -0400 Received: from mail.bootlin.com ([62.4.15.54]:50100 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728808AbeJAPqo (ORCPT ); Mon, 1 Oct 2018 11:46:44 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id CD25E208F4; Mon, 1 Oct 2018 11:09:55 +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 (AAubervilliers-681-1-24-95.w90-88.abo.wanadoo.fr [90.88.144.95]) by mail.bootlin.com (Postfix) with ESMTPSA id 7879C206FF; Mon, 1 Oct 2018 11:09:45 +0200 (CEST) Date: Mon, 1 Oct 2018 11:09:46 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur Cc: Frieder Schrempf , "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Message-ID: <20181001110946.5330a90e@bbrezillon> In-Reply-To: References: <1537525323-20730-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1537525323-20730-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20180929174023.51b1e284@bbrezillon> <7c10ced6-91af-187a-0c34-ce9b3e897e2e@exceet.de> 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, 1 Oct 2018 09:02:32 +0000 Yogesh Narayan Gaur wrote: > > > static void fspi_writel(struct nxp_fspi *f, u32 val, void __iomem > > > *addr) { > > > if (f->big_endian) > > > iowrite32be(val, addr); > > > else > > > iowrite32(val, addr); > > > } > > > > > > > > > static u32 fspi_readl(struct nxp_fspi *f, void __iomem *addr) { > > > if (f->big_endian) > > > return ioread32be(addr); > > > else > > > return ioread32(addr); > > > } > > > > I introduced the ->read/write() hooks in the QSPI driver because I > > was told to remove the conditional in the read/write path, but I > > can't really tell if this really makes any difference. > > > Yes, I have taken these hooks by looking into the comments received > for Frieder's QSPI patch series. For me this looks more clean and can > be decided in the controller initialization sequence which hook would > going to be invoked. Well, depending on your CPU, the indirect branch (caused by the function pointer call) might have an higher cost than the conditional branch. Not sure we care about such micro-optimizations though. Regarding the readability aspect, I still prefer my version, but I guess that's a matter of taste.