From patchwork Thu Aug 10 16:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 713248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4AD3C001B0 for ; Thu, 10 Aug 2023 16:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236341AbjHJQBF (ORCPT ); Thu, 10 Aug 2023 12:01:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236310AbjHJQAt (ORCPT ); Thu, 10 Aug 2023 12:00:49 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A172702; Thu, 10 Aug 2023 09:00:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 0E84B635D29A; Thu, 10 Aug 2023 18:00:46 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id i2OBkMkvY2wu; Thu, 10 Aug 2023 18:00:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id B1424635D2A8; Thu, 10 Aug 2023 18:00:45 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vNycAkqY1e7l; Thu, 10 Aug 2023 18:00:45 +0200 (CEST) Received: from foxxylove.corp.sigma-star.at (unknown [82.150.214.1]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 55000635D296; Thu, 10 Aug 2023 18:00:45 +0200 (CEST) From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: Christoph Hellwig , Stephan Wurm , Richard Weinberger , Miquel Raynal , Vignesh Raghavendra , Oliver Neukum , Ali Akcaagac , Jamie Lenehan , "James E.J. Bottomley" , "Martin K. Petersen" , Ezequiel Garcia , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 5/7] scsi: fdomain: Switch to kmap_sg Date: Thu, 10 Aug 2023 18:00:16 +0200 Message-Id: <20230810160019.16977-6-richard@nod.at> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230810160019.16977-1-richard@nod.at> References: <20230810160019.16977-1-richard@nod.at> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Switch to our new helper from scatterlist lib. No functional change, the mapped region is still used in atomic context. Signed-off-by: Richard Weinberger --- drivers/scsi/fdomain.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 504c4e0c5d17a..5d58a9ec1c66a 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -223,15 +223,14 @@ static void fdomain_read_data(struct scsi_cmnd *cmd) while ((len = inw(fd->base + REG_FIFO_COUNT)) > 0) { offset = scsi_bufflen(cmd) - scsi_get_resid(cmd); - virt = scsi_kmap_atomic_sg(scsi_sglist(cmd), scsi_sg_count(cmd), - &offset, &len); + virt = kmap_sg(scsi_sglist(cmd), scsi_sg_count(cmd), &offset, &len); ptr = virt + offset; if (len & 1) *ptr++ = inb(fd->base + REG_FIFO); if (len > 1) insw(fd->base + REG_FIFO, ptr, len >> 1); scsi_set_resid(cmd, scsi_get_resid(cmd) - len); - scsi_kunmap_atomic_sg(virt); + kunmap_sg(virt); } } @@ -250,15 +249,14 @@ static void fdomain_write_data(struct scsi_cmnd *cmd) if (len == 0) break; } - virt = scsi_kmap_atomic_sg(scsi_sglist(cmd), scsi_sg_count(cmd), - &offset, &len); + virt = kmap_sg(scsi_sglist(cmd), scsi_sg_count(cmd), &offset, &len); ptr = virt + offset; if (len & 1) outb(*ptr++, fd->base + REG_FIFO); if (len > 1) outsw(fd->base + REG_FIFO, ptr, len >> 1); scsi_set_resid(cmd, scsi_get_resid(cmd) - len); - scsi_kunmap_atomic_sg(virt); + kunmap_sg(virt); } }