From patchwork Tue Aug 28 14:24:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 145332 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1253889ljw; Tue, 28 Aug 2018 07:24:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYZprOT8TC7ycHLGf2vMTodUzHfjlltnBJYHVThA+c3rfHRWKf7azJF+tSDG2oftIr50MwD X-Received: by 2002:a62:c218:: with SMTP id l24-v6mr1859855pfg.185.1535466270398; Tue, 28 Aug 2018 07:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535466270; cv=none; d=google.com; s=arc-20160816; b=R0oytUqG/cGF7KJ7gwxdeTdh3zKBwg5AIsaSJeclWqqma+6Jl5woIhWotp8d/paZEs 4U8W4Z1iOSQ21I/1oJOw3IeZWQhhNUfT2a4ZN/Y5CVp7IiLQQoVCwx997dPc2W1gfKao tSrNMenmjINR9dcnJpTywEJPWgDYaepnIdlCmrb6hnV49Mf00U0BOJbcfomDdHIZZxKd Xu0/JEPJcaPgcRIAIDQsPISmiiP7FW7kV+0F2MDhkyTQk/mh95f++SiuLe0HfQCvOEUB a6gcAnaXNg9RnOQ5e/Mft6xMbdd6UyjV1FC0DPmW+ncIo5lBzGPu07UD3iaKmVaGiqNK +ncg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=CO/Oh0cXHxt5frIpO6E72iJCcx5PqTSy+wwhzcPS/KQ=; b=dZBbPHijVrtXN1ksY1/gVEtriznF4unBUVORDm9bHFeCzpx11yb/BSz9hrc77Ut+VW hOzvkwl9pwVf/4f+hiCI+rYfQKa0c/D8VhxUUClNPGc1P/NJSt9ZxDrzzr4NEpfQSkiI E+CPXFzg/tjuSHnmlcG/7wVxt+dDywBlWg87ftroKlnXFSldkvKy+AGfzuLf4zk0ra14 /+omQDsWPB1AuYLP/OzZc4jBXmnc5Zg/pDDsVSDIKHNsrlRgHpNTL+V4VwOskwmYOfJW ad+cdSvPMRh2939/fgz+CLlOSITlC6vWzD/BfW3X9vak1zQqHdwjLramDOMDlwIPKOqw ShEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bVHsTyKb; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si1209438plb.135.2018.08.28.07.24.30; Tue, 28 Aug 2018 07:24:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bVHsTyKb; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728268AbeH1SQX (ORCPT + 1 other); Tue, 28 Aug 2018 14:16:23 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45376 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727373AbeH1SQX (ORCPT ); Tue, 28 Aug 2018 14:16:23 -0400 Received: by mail-lf1-f66.google.com with SMTP id r4-v6so1529091lff.12 for ; Tue, 28 Aug 2018 07:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CO/Oh0cXHxt5frIpO6E72iJCcx5PqTSy+wwhzcPS/KQ=; b=bVHsTyKblPQrO7HbiOgd+iX8O8RcTWpPomNut+MauAwue0f2s9bc/QiAyH5uA5RQ02 VyW2ADgFwOvpMR6MJ7o0A1MqEProhsv/mxu7/Xyu/3VGh2uiUiNCR7YdBXI9sV2goVHJ TsvJmFQu6kTmklzOcejjZ3i+4cE4O5fHHN44Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CO/Oh0cXHxt5frIpO6E72iJCcx5PqTSy+wwhzcPS/KQ=; b=noBdGFsTQAqx7yZD7OSvl+671JYYWwrZzpiNC7/mK8SDD1hNNPQt5RDI+IbVHAaJP/ 7EPHCKtoruogW7sKkcgE5x7+vq2IgDk2QTEAD34M+iQc7OsuUb/ceh8fZ0XekQPedMBn s0ZbGBXSJCuVXSwSpHTMIz16LbVDm8yhFcL6k+Y6kExicpey+R3GocG6IwtPFV/fsZqA drJ8ikRwk81jrvd0dKnuET3UB58qz7ygBHmGhZeTXatddTc9rH5/WMDQDckXMumrtNMP OaEmdjII61Jy9r3bdUHpOZfGN1/k1c7FSyAhnAwhgl3jtd8prdB+t0475GTw9+DQlPes GrJA== X-Gm-Message-State: APzg51CHskoQeM9GdHIvOwC2hdxBx5LaB8LLLGTCGH1dMM8lGxAFkDN0 6yU93fIhiHbwrYY2wK+7V7IkZw== X-Received: by 2002:a19:e51a:: with SMTP id c26-v6mr1418659lfh.78.1535466266853; Tue, 28 Aug 2018 07:24:26 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id t14-v6sm244688ljg.17.2018.08.28.07.24.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Aug 2018 07:24:26 -0700 (PDT) From: Sam Protsenko To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, codalist@coda.cs.cmu.edu, coda@cs.cmu.edu Cc: Jan Harkes , "James E.J. Bottomley" , "Martin K. Petersen" , Praneeth Bajjuri , Paul Sokolovsky , Miklos Szeredi , Sumit Semwal , Ruslan Bilovol , Andy Shevchenko Subject: [PATCH 2/2] scsi: aic7xxx: Fix build using bare-metal toolchain Date: Tue, 28 Aug 2018 17:24:21 +0300 Message-Id: <20180828142421.15335-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180828142421.15335-1-semen.protsenko@linaro.org> References: <20180828142421.15335-1-semen.protsenko@linaro.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Bare-metal toolchains don't define __linux__, so aic7xxx build with bare-metal toolchain is broken. Let's check __KERNEL__ definition instead of __linux__ (as this code won't be build for user-space anyway) in order to fix that. Signed-off-by: Sam Protsenko --- drivers/scsi/aic7xxx/aic7770.c | 2 +- drivers/scsi/aic7xxx/aic79xx.h | 4 ++-- drivers/scsi/aic7xxx/aic79xx_core.c | 12 ++++++------ drivers/scsi/aic7xxx/aic79xx_pci.c | 2 +- drivers/scsi/aic7xxx/aic7xxx.h | 4 ++-- drivers/scsi/aic7xxx/aic7xxx_93cx6.c | 2 +- drivers/scsi/aic7xxx/aic7xxx_core.c | 12 ++++++------ drivers/scsi/aic7xxx/aic7xxx_pci.c | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm.h | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm_gram.y | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm_scan.l | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h | 2 +- 15 files changed, 27 insertions(+), 27 deletions(-) -- 2.18.0 diff --git a/drivers/scsi/aic7xxx/aic7770.c b/drivers/scsi/aic7xxx/aic7770.c index 5000bd69c13f..b117992f8c04 100644 --- a/drivers/scsi/aic7xxx/aic7770.c +++ b/drivers/scsi/aic7xxx/aic7770.c @@ -42,7 +42,7 @@ * $FreeBSD$ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "aic7xxx_osm.h" #include "aic7xxx_inline.h" #include "aic7xxx_93cx6.h" diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h index 31f2bb9d7146..6226276770eb 100644 --- a/drivers/scsi/aic7xxx/aic79xx.h +++ b/drivers/scsi/aic7xxx/aic79xx.h @@ -607,7 +607,7 @@ struct scb { ahd_io_ctx_t io_ctx; struct ahd_softc *ahd_softc; scb_flag flags; -#ifndef __linux__ +#ifndef __KERNEL__ bus_dmamap_t dmamap; #endif struct scb_platform_data *platform_data; @@ -1056,7 +1056,7 @@ struct ahd_completion struct ahd_softc { bus_space_tag_t tags[2]; bus_space_handle_t bshs[2]; -#ifndef __linux__ +#ifndef __KERNEL__ bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */ #endif struct scb_data scb_data; diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 2d82ec85753e..8580cec85902 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c @@ -40,7 +40,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#250 $ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "aic79xx_osm.h" #include "aic79xx_inline.h" #include "aicasm/aicasm_insformat.h" @@ -6172,7 +6172,7 @@ ahd_free(struct ahd_softc *ahd) case 2: ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat); case 1: -#ifndef __linux__ +#ifndef __KERNEL__ ahd_dma_tag_destroy(ahd, ahd->buffer_dmat); #endif break; @@ -6180,7 +6180,7 @@ ahd_free(struct ahd_softc *ahd) break; } -#ifndef __linux__ +#ifndef __KERNEL__ ahd_dma_tag_destroy(ahd, ahd->parent_dmat); #endif ahd_platform_free(ahd); @@ -6934,7 +6934,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) for (i = 0; i < newcount; i++) { struct scb_platform_data *pdata; u_int col_tag; -#ifndef __linux__ +#ifndef __KERNEL__ int error; #endif @@ -6970,7 +6970,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) next_scb->sg_list_busaddr += sizeof(struct ahd_dma_seg); next_scb->ahd_softc = ahd; next_scb->flags = SCB_FLAG_NONE; -#ifndef __linux__ +#ifndef __KERNEL__ error = ahd_dmamap_create(ahd, ahd->buffer_dmat, /*flags*/0, &next_scb->dmamap); if (error != 0) { @@ -7091,7 +7091,7 @@ ahd_init(struct ahd_softc *ahd) if ((AHD_TMODE_ENABLE & (0x1 << ahd->unit)) == 0) ahd->features &= ~AHD_TARGETMODE; -#ifndef __linux__ +#ifndef __KERNEL__ /* DMA tag for mapping buffers into device visible space. */ if (ahd_dma_tag_create(ahd, ahd->parent_dmat, /*alignment*/1, /*boundary*/BUS_SPACE_MAXADDR_32BIT + 1, diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c index cc9bd26f5d1a..573a9aae51da 100644 --- a/drivers/scsi/aic7xxx/aic79xx_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_pci.c @@ -41,7 +41,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "aic79xx_osm.h" #include "aic79xx_inline.h" #else diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h index 4ce4e903a759..aa42f3ef79e5 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.h +++ b/drivers/scsi/aic7xxx/aic7xxx.h @@ -568,7 +568,7 @@ struct scb { ahc_io_ctx_t io_ctx; struct ahc_softc *ahc_softc; scb_flag flags; -#ifndef __linux__ +#ifndef __KERNEL__ bus_dmamap_t dmamap; #endif struct scb_platform_data *platform_data; @@ -906,7 +906,7 @@ typedef void ahc_callback_t (void *); struct ahc_softc { bus_space_tag_t tag; bus_space_handle_t bsh; -#ifndef __linux__ +#ifndef __KERNEL__ bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */ #endif struct scb_data *scb_data; diff --git a/drivers/scsi/aic7xxx/aic7xxx_93cx6.c b/drivers/scsi/aic7xxx/aic7xxx_93cx6.c index 9e85a7ef9c8e..434a4bfc6309 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_93cx6.c +++ b/drivers/scsi/aic7xxx/aic7xxx_93cx6.c @@ -64,7 +64,7 @@ * bit to be sent from the chip. */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "aic7xxx_osm.h" #include "aic7xxx_inline.h" #include "aic7xxx_93cx6.h" diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index 915a34f141e4..67aa18982c7e 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -40,7 +40,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "aic7xxx_osm.h" #include "aic7xxx_inline.h" #include "aicasm/aicasm_insformat.h" @@ -4509,7 +4509,7 @@ ahc_free(struct ahc_softc *ahc) case 2: ahc_dma_tag_destroy(ahc, ahc->shared_data_dmat); case 1: -#ifndef __linux__ +#ifndef __KERNEL__ ahc_dma_tag_destroy(ahc, ahc->buffer_dmat); #endif break; @@ -4517,7 +4517,7 @@ ahc_free(struct ahc_softc *ahc) break; } -#ifndef __linux__ +#ifndef __KERNEL__ ahc_dma_tag_destroy(ahc, ahc->parent_dmat); #endif ahc_platform_free(ahc); @@ -5005,7 +5005,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) newcount = min(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs)); for (i = 0; i < newcount; i++) { struct scb_platform_data *pdata; -#ifndef __linux__ +#ifndef __KERNEL__ int error; #endif pdata = kmalloc(sizeof(*pdata), GFP_ATOMIC); @@ -5021,7 +5021,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) next_scb->sg_list_phys = physaddr + sizeof(struct ahc_dma_seg); next_scb->ahc_softc = ahc; next_scb->flags = SCB_FREE; -#ifndef __linux__ +#ifndef __KERNEL__ error = ahc_dmamap_create(ahc, ahc->buffer_dmat, /*flags*/0, &next_scb->dmamap); if (error != 0) @@ -5325,7 +5325,7 @@ ahc_init(struct ahc_softc *ahc) if ((AHC_TMODE_ENABLE & (0x1 << ahc->unit)) == 0) ahc->features &= ~AHC_TARGETMODE; -#ifndef __linux__ +#ifndef __KERNEL__ /* DMA tag for mapping buffers into device visible space. */ if (ahc_dma_tag_create(ahc, ahc->parent_dmat, /*alignment*/1, /*boundary*/BUS_SPACE_MAXADDR_32BIT + 1, diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c index 673e826d7adb..83b72efbb6a6 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c @@ -42,7 +42,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "aic7xxx_osm.h" #include "aic7xxx_inline.h" #include "aic7xxx_93cx6.h" diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.h b/drivers/scsi/aic7xxx/aicasm/aicasm.h index 51678dd46ff7..3465603e41ca 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm.h +++ b/drivers/scsi/aic7xxx/aicasm/aicasm.h @@ -42,7 +42,7 @@ * $FreeBSD$ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "../queue.h" #else #include diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y index f1586a437906..403bc9c5d739 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y @@ -52,7 +52,7 @@ #include #include -#ifdef __linux__ +#ifdef __KERNEL__ #include "../queue.h" #else #include diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y index 708326df0766..695f45e0a995 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y @@ -52,7 +52,7 @@ #include #include -#ifdef __linux__ +#ifdef __KERNEL__ #include "../queue.h" #else #include diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l index c0457b8c3b77..cfff11d80378 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l @@ -51,7 +51,7 @@ #include #include #include -#ifdef __linux__ +#ifdef __KERNEL__ #include "../queue.h" #else #include diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l index 93c8667cd704..e9f6005431b1 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l @@ -51,7 +51,7 @@ #include #include #include -#ifdef __linux__ +#ifdef __KERNEL__ #include "../queue.h" #else #include diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c index 232aff1fe784..dad083fa3adb 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c @@ -44,7 +44,7 @@ #include -#ifdef __linux__ +#ifdef __KERNEL__ #include "aicdb.h" #else #include diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h index 34bbcad7f83f..530fb56d1c47 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h @@ -42,7 +42,7 @@ * $FreeBSD$ */ -#ifdef __linux__ +#ifdef __KERNEL__ #include "../queue.h" #else #include