Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbdDNQMy (ORCPT ); Fri, 14 Apr 2017 12:12:54 -0400 Received: from ale.deltatee.com ([207.54.116.67]:41026 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbdDNQMt (ORCPT ); Fri, 14 Apr 2017 12:12:49 -0400 To: "Kershner, David A" , Christoph Hellwig , "Martin K. Petersen" , Sagi Grimberg , Jens Axboe , Tejun Heo , Greg Kroah-Hartman , Dan Williams , Ross Zwisler , Matthew Wilcox , Sumit Semwal , Ming Lin , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-media@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , "intel-gfx@lists.freedesktop.org" , "linux-raid@vger.kernel.org" , "linux-mmc@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-nvdimm@lists.01.org" , "linux-scsi@vger.kernel.org" , "fcoe-devel@open-fcoe.org" , "open-iscsi@googlegroups.com" , "megaraidlinux.pdl@broadcom.com" , *S-Par-Maintainer , "devel@driverdev.osuosl.org" , "target-devel@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "rds-devel@oss.oracle.com" References: <1492121135-4437-1-git-send-email-logang@deltatee.com> <1492121135-4437-11-git-send-email-logang@deltatee.com> Cc: Steve Wise , Stephen Bates From: Logan Gunthorpe Message-ID: Date: Fri, 14 Apr 2017 10:12:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 50.66.97.235 X-SA-Exim-Rcpt-To: sbates@raithlin.com, swise@opengridcomputing.com, rds-devel@oss.oracle.com, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, target-devel@vger.kernel.org, devel@driverdev.osuosl.org, SParMaintainer@unisys.com, megaraidlinux.pdl@broadcom.com, open-iscsi@googlegroups.com, fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org, linux-nvdimm@lists.01.org, linux-nvme@lists.infradead.org, linux-mmc@vger.kernel.org, linux-raid@vger.kernel.org, intel-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, ming.l@ssi.samsung.com, sumit.semwal@linaro.org, mawilcox@microsoft.com, ross.zwisler@linux.intel.com, dan.j.williams@intel.com, gregkh@linuxfoundation.org, tj@kernel.org, axboe@kernel.dk, sagi@grimberg.me, martin.petersen@oracle.com, hch@lst.de, David.Kershner@unisys.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH 10/22] staging: unisys: visorbus: Make use of the new sg_map helper function X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 56 Great, thanks! Logan On 14/04/17 10:07 AM, Kershner, David A wrote: > Can you add Acked-by for this patch? > > Acked-by: David Kershner > > Tested on s-Par and no problems. > > Thanks, > David Kershner > >> --- >> drivers/staging/unisys/visorhba/visorhba_main.c | 12 +++++++----- >> 1 file changed, 7 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c >> b/drivers/staging/unisys/visorhba/visorhba_main.c >> index 0ce92c8..2d8c8bc 100644 >> --- a/drivers/staging/unisys/visorhba/visorhba_main.c >> +++ b/drivers/staging/unisys/visorhba/visorhba_main.c >> @@ -842,7 +842,6 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct >> scsi_cmnd *scsicmd) >> struct scatterlist *sg; >> unsigned int i; >> char *this_page; >> - char *this_page_orig; >> int bufind = 0; >> struct visordisk_info *vdisk; >> struct visorhba_devdata *devdata; >> @@ -869,11 +868,14 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, >> struct scsi_cmnd *scsicmd) >> >> sg = scsi_sglist(scsicmd); >> for (i = 0; i < scsi_sg_count(scsicmd); i++) { >> - this_page_orig = kmap_atomic(sg_page(sg + i)); >> - this_page = (void *)((unsigned long)this_page_orig | >> - sg[i].offset); >> + this_page = sg_map(sg + i, SG_KMAP_ATOMIC); >> + if (IS_ERR(this_page)) { >> + scsicmd->result = DID_ERROR << 16; >> + return; >> + } >> + >> memcpy(this_page, buf + bufind, sg[i].length); >> - kunmap_atomic(this_page_orig); >> + sg_unmap(sg + i, this_page, SG_KMAP_ATOMIC); >> } >> } else { >> devdata = (struct visorhba_devdata *)scsidev->host- >>> hostdata; >> -- >> 2.1.4 >