Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3465121imu; Mon, 10 Dec 2018 02:40:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/XrFWXaaP1/4/jK+QdYSsSBuyAz+rArRzsU2vAks7XkoVAp35qutrAXUPDF2WDEN8551H/d X-Received: by 2002:a17:902:5601:: with SMTP id h1mr11945886pli.160.1544438427374; Mon, 10 Dec 2018 02:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544438427; cv=none; d=google.com; s=arc-20160816; b=TZScBDf2Jux85+gbt5upxf+v92ibL9VX6nELjDF4PKZKVVdvCDPyMmtD+5bo+971gf ksqjwVn+vSCOize3PlOY2CQejbXkwsv7Uhex9jqpebHx+Nq78s4ryKta45rhjFZuCgpn 6tr/31eCQ+lN6o87csYOyASVjzDXLFxXUWrs82EpsGDFuYmJ1iD3dh6dD2DZQNqPBOdH XVspUmF4bmQ3gHzIklAhmI9+YNRwnOlwody/zC5j++1bcwmoxLHhfeJmim45uTfa6GGN cgEH7dYsDq7rXJN58LpY5rZP7bAxRDXPcW70hsselGFAQn9zRJe0zDs6Hs0aKUIAbBVv VMSg== 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=bAaZLRHB7EENT3Djo4/PwBeamjOYvY8HOgSkMhMkDnk=; b=hEm22BGE8AW8iqTCaMkbyfuO+IYyfwuh3eKW77p9pNMOpLV3O0ufveXX0DnDpgbWJY mqgbsHscCv1isifSp6rXHlYHbQVn9z2HcA1OQFovimSNnoPg0XGP/pw6adR8tgmz44TW n0rRT9rkZqRDVdveVhJBTw2BVch/B4XI10iyGFxxm31WTaXOiqSv3T4b2EDc7oSmyZmA vzEkbvG5gp1AhHBiEdKRQs4v6yvSxnFnqNecO9MIDuJOtXP9HBV6UO6L6VugLBcS/HUs uJWY6yxTNFVdR3xWUVhgOU2kgB/Vu2Cqf1XipiSljmsr1q4KicpBlM2hdy1/xnPRdzsk AZVQ== 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 p26si10598993pli.225.2018.12.10.02.40.11; Mon, 10 Dec 2018 02:40:27 -0800 (PST) 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 S1727104AbeLJKgW (ORCPT + 99 others); Mon, 10 Dec 2018 05:36:22 -0500 Received: from mail.bootlin.com ([62.4.15.54]:54888 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726146AbeLJKgW (ORCPT ); Mon, 10 Dec 2018 05:36:22 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 7E8C920D92; Mon, 10 Dec 2018 11:36:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 3166C20D23; Mon, 10 Dec 2018 11:36:09 +0100 (CET) Date: Mon, 10 Dec 2018 11:36:09 +0100 From: Boris Brezillon To: Schrempf Frieder Cc: Yogesh Narayan Gaur , "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "broonie@kernel.org" , "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 v5 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Message-ID: <20181210113609.59355f12@bbrezillon> In-Reply-To: References: <1542366701-16065-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1542366701-16065-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20181210111909.35384eee@bbrezillon> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; 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, 10 Dec 2018 10:31:57 +0000 Schrempf Frieder wrote: > >> Yes, I need to validate op->addr.nbytes else LUT would going to be programmed for 0 addrlen. > >> I have checked this on the target. > > > > Also agree there. Some operations have 0 address bytes. We could also > > test addr.buswidth, but I'm fine with the addr.nbytes test too. > > The "if (op->addr.nbytes)" is needed of course, but I think the default > case in the switch statement (and for other reasons the whole switch > statement) is not needed and rather a check for op->addr.nbytes > 4 > should be added to nxp_fspi_supports_op(). I wrongly assumed this check > already exists in nxp_fspi_supports_op(). Ok, then this check on the max number of address bytes should indeed be moved to the supports_op() implementation.