From: Logan Gunthorpe Subject: [PATCH v2 06/21] crypto: hifn_795x: Make use of the new sg_map helper function Date: Tue, 25 Apr 2017 12:20:53 -0600 Message-ID: <1493144468-22493-7-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 , "James E.J. Bottomley" , Herbert Xu , "Martin K. Petersen" , Matthew Wilcox , Greg Kroah-Hartman , Sumit Semwal , "David S. Miller" , 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 Q29udmVyc2lvbiBvZiBhIGNvdXBsZSBrbWFwX2F0b21pYyBpbnN0YW5jZXMgdG8gdGhlIHNnX21h cCBoZWxwZXIKZnVuY3Rpb24uCgpIb3dldmVyLCBpdCBsb29rcyBsaWtlIHRoZXJlIHdhcyBhIGJ1 ZyBpbiB0aGUgb3JpZ2luYWwgY29kZTogdGhlIHNvdXJjZQpzY2F0dGVyIGxpc3RzIG9mZnNldCAo dC0+b2Zmc2V0KSB3YXMgcGFzc2VkIHRvIGFibGtjaXBoZXJfZ2V0IHdoaWNoCmFkZGVkIGl0IHRv IHRoZSB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