From patchwork Fri Mar 16 13:25:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10287105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 700AD60386 for ; Fri, 16 Mar 2018 13:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63FCC28EC0 for ; Fri, 16 Mar 2018 13:45:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5886B28EC3; Fri, 16 Mar 2018 13:45:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 143C828EC1 for ; Fri, 16 Mar 2018 13:45:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbeCPNpQ (ORCPT ); Fri, 16 Mar 2018 09:45:16 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:46306 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753349AbeCPNop (ORCPT ); Fri, 16 Mar 2018 09:44:45 -0400 Received: from ayla.of.borg ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id Ndkg1x00E3XaVaC01dkgAu; Fri, 16 Mar 2018 14:44:44 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ewpex-0000J2-SQ; Fri, 16 Mar 2018 14:44:39 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ewpMh-0000PW-J4; Fri, 16 Mar 2018 14:25:47 +0100 From: Geert Uytterhoeven To: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Felipe Balbi , Greg Kroah-Hartman , "James E . J . Bottomley" , "Martin K . Petersen" , Andrew Morton Cc: iommu@lists.linux-foundation.org, linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 5/5] scsi: Add NO_DMA dummies for SCSI DMA mapping API Date: Fri, 16 Mar 2018 14:25:44 +0100 Message-Id: <1521206744-1504-6-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521206744-1504-1-git-send-email-geert@linux-m68k.org> References: <1521206744-1504-1-git-send-email-geert@linux-m68k.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add dummies for scsi_dma_{,un}map(), to allow compile-testing if NO_DMA=y. This prevents the following from showing up later: ERROR: "scsi_dma_unmap" [drivers/firewire/firewire-sbp2.ko] undefined! ERROR: "scsi_dma_map" [drivers/firewire/firewire-sbp2.ko] undefined! Signed-off-by: Geert Uytterhoeven Reviewed-by: Mark Brown Acked-by: Robin Murphy --- v2: - Add Reviewed-by, Acked-by, - Drop RFC state. --- include/scsi/scsi_cmnd.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 2280b2351739572c..aaf1e971c6a368d1 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -174,8 +174,13 @@ extern void scsi_kunmap_atomic_sg(void *virt); extern int scsi_init_io(struct scsi_cmnd *cmd); +#ifdef CONFIG_SCSI_DMA extern int scsi_dma_map(struct scsi_cmnd *cmd); extern void scsi_dma_unmap(struct scsi_cmnd *cmd); +#else /* !CONFIG_SCSI_DMA */ +static inline int scsi_dma_map(struct scsi_cmnd *cmd) { return -ENOSYS; } +static inline void scsi_dma_unmap(struct scsi_cmnd *cmd) { } +#endif /* !CONFIG_SCSI_DMA */ static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) {