From: Logan Gunthorpe Subject: [PATCH v2 20/21] mmc: tifm_sd: Make use of the new sg_map helper function Date: Tue, 25 Apr 2017 12:21:07 -0600 Message-ID: <1493144468-22493-21-git-send-email-logang@deltatee.com> References: <1493144468-22493-1-git-send-email-logang@deltatee.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: Jens Axboe , Ulf Hansson , "James E.J. Bottomley" , Alex Dubov , "Martin K. Petersen" , Matthew Wilcox , Greg Kroah-Hartman , Sumit Semwal , Ross Zwisler , Dan Williams , Stephen Bates , Logan Gunthorpe , Christoph Hellwig To: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-nvdimm@lists.01.org, linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, target-devel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, dm-devel@redhat.com Return-path: In-Reply-To: <1493144468-22493-1-git-send-email-logang@deltatee.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" List-Id: linux-crypto.vger.kernel.org VGhpcyBjb252ZXJzaW9uIGlzIGEgYml0IGNvbXBsaWNhdGVkLiBXZSBtb2RpeSB0aGUgcmVhZF9m aWZvLAp3cml0ZV9maWZvIGFuZCBjb3B5X3BhZ2UgZnVuY3Rpb25zIHRvIHRha2UgYSBzY2F0dGVy bGlzdCBpbnN0ZWFkIG9mIGEKcGFnZS4gVGh1cyB3ZSBjYW4gdXNlIHNnX21hcCBpbnN0ZWFkIG9m IGttYXBfYXRvbWljLiBUaGVyZSdzIGEgYml0IG9mCmFjY291bnRpbmcgdGhhdCBuZWVkZWQgdG8g YmUgZG9uZ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