From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions Date: Wed, 26 Apr 2017 10:59:17 +0200 Message-ID: <5dfc5bf5-482c-b5bb-029c-7cee80925f37@amd.com> References: <1493144468-22493-1-git-send-email-logang@deltatee.com> <1493144468-22493-2-git-send-email-logang@deltatee.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Cc: Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Matthew Wilcox , Greg Kroah-Hartman , Christoph Hellwig To: Logan Gunthorpe , , , , , , , , , , , , , , , , , Return-path: In-Reply-To: <1493144468-22493-2-git-send-email-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" List-Id: linux-crypto.vger.kernel.org QW0gMjUuMDQuMjAxNyB1bSAyMDoyMCBzY2hyaWViIExvZ2FuIEd1bnRob3JwZToKPiBUaGlzIHBh dGNoIGludHJvZHVjZXMgZnVuY3Rpb25zIHdoaWNoIGttYXAgdGhlIHBhZ2VzIGluc2lkZSBhbiBz Z2wuCj4gVGhlc2UgZnVuY3Rpb25zIHJlcGxhY2UgYSBjb21tb24gcGF0dGVybiBvZiBrbWFwKHNn X3BhZ2Uoc2cpKSB0aGF0IGlzCj4gdXNlZCBpbiBtb3JlIHRoYW4gNTAgcGxhY2VzIHdpdGhpbiB0 aGUga2VybmVsLgo+Cj4gVGhlIG1vdGl2YXRpb24gZm9yIHRoaXMgd29yayBpcyB0byBldmVudHVh bGx5IHNhZmVseSBzdXBwb3J0IHNnbHMgdGhhdAo+IGNvbnRhaW4gaW8gbWVtb3J5LiBJbiBvcmRl ciBmb3IgdGhhdCB0byB3b3JrLCBhbnkgYWNjZXNzIHRvIHRoZSBjb250ZW50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