Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1407259imu; Sat, 26 Jan 2019 02:08:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN4PojQdsWIRz4xwrnaCByeO/OyQdVqjO55UdjOvIP74iPuJ4T9Zi70LJ/LFZWbJ1MhHpk++ X-Received: by 2002:a63:a91a:: with SMTP id u26mr12788821pge.349.1548497289158; Sat, 26 Jan 2019 02:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548497289; cv=none; d=google.com; s=arc-20160816; b=sRROKpQdrqG7c/u0PoXD5bjj1W8ObIDyonsDECDI6BpRRAiK3nENGPQHx2J0Ua1u8/ 4Fh7rajaGoX24h/hcQYcvAJA7dVWQ6f6/xdGb9Kr7TYcv09r1ZTdanuL9+oCr26QjLsG XAVqtFCqenH/k0dc2NiCB3oO438FuE8EstxfHr1y30EBImVc3BYYZKweKoZDLazZapfX YEsK+4sKEcMAzb/sOSh/Y6UJ+Af6XbErT6hnSo4Bfy/UPbZg1zfi7quGLmSg+pFM9j5a WoBKYzVr8E0uOcxjCh1gXSuhevmUjGJHIliDaL/XkmNSYRnQZbQXSC80H7nIm9tWUAFR y62w== 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 :dkim-signature; bh=hGABzpxf87xqj1J5a4HISflWxhrzYZIE+Yzs8V3eyso=; b=aSdfd6KNd6jEYsIrsF7B2Fu4Cb5/U7PhgdCvZamtzmkXzSoju1OuDP2J5bWTBdTcSA ZBIzrKf8NvcCGrHbqOkeIuvxqajTaJYYuYRFbvHcNl0ugDidOmRSuu2l4PmLFDpDWHtQ avEPJK5Tykn7V+Fupr4tmMuctO1Kow69lWFyf+wzasq17eE6dyPTIkvw+qkzA+hAq1kv 43GfhACkpsAx/+7IxWmDV8beW0J8KAtAlgpkSA38L8kBHZnL4Csg3Xp8ACVCOSVsNDFI AoMI/kjnP9pGHV33J2JbU7+L6ghEKcbDrJKYYZMEnycWQOLMEdTps5C/DjBuuSeUsAdE hlBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2nZEvRXn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si6436385pgv.499.2019.01.26.02.07.53; Sat, 26 Jan 2019 02:08:09 -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; dkim=pass header.i=@kernel.org header.s=default header.b=2nZEvRXn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729404AbfAZKG7 (ORCPT + 99 others); Sat, 26 Jan 2019 05:06:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:37806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbfAZKG7 (ORCPT ); Sat, 26 Jan 2019 05:06:59 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EB66217D7; Sat, 26 Jan 2019 10:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548497218; bh=I2UcX859a4p55FonVWiR9JFyMZvsSmLxRbyEao2efyY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2nZEvRXnhu32abNeMUHz2YKMqp39/ftDImfo5vijGKKyYIfehnR6l3KTxIUZAvxn4 nIXKOpC56RcbCaOPCVMP7vhnADwX6/777YICLbQzN0s4Dg8yqEC2OxBJg9F+ZTgaF1 r2i8ZTkeT1Af1mIxqRzX36yKyUa9XLjcmeMTnqHs= Date: Sat, 26 Jan 2019 11:06:48 +0100 From: Boris Brezillon To: Geert Uytterhoeven Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-mtd@lists.infradead.org, Nguyen An Hoan , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: Re: [PATCH v2 2/2] eeprom: at25: Use spi_message_init_with_transfers() instead of open coding Message-ID: <20190126110639.4717ec0e@bbrezillon> In-Reply-To: <20190118140525.29189-3-geert+renesas@glider.be> References: <20190118140525.29189-1-geert+renesas@glider.be> <20190118140525.29189-3-geert+renesas@glider.be> 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 Fri, 18 Jan 2019 15:05:25 +0100 Geert Uytterhoeven wrote: > Reduce code duplication in at25_ee_read() by using the > spi_message_init_with_transfers() helper. > > Signed-off-by: Geert Uytterhoeven > Acked-by: Arnd Bergmann Reviewed-by: Boris Brezillon > --- > v2: > - Add Acked-by. > --- > drivers/misc/eeprom/at25.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c > index 2d8e5388e574710d..18a093e14517ab45 100644 > --- a/drivers/misc/eeprom/at25.c > +++ b/drivers/misc/eeprom/at25.c > @@ -103,16 +103,15 @@ static int at25_ee_read(void *priv, unsigned int offset, > *cp++ = offset >> 0; > } > > - spi_message_init(&m); > memset(t, 0, sizeof(t)); > > t[0].tx_buf = command; > t[0].len = at25->addrlen + 1; > - spi_message_add_tail(&t[0], &m); > > t[1].rx_buf = buf; > t[1].len = count; > - spi_message_add_tail(&t[1], &m); > + > + spi_message_init_with_transfers(&m, t, ARRAY_SIZE(t)); > > mutex_lock(&at25->lock); >