From 57533dcd0c31abd743bb9981afdc3fab2a30f42e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 1 Nov 2018 04:28:46 +0000 Subject: [PATCH] qla2x00t: Fix build against kernel versions before v4.14 git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7568 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/Makefile | 8 ++++++-- qla2x00t/qla_inline.h | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index 838e275a7..4cdb43ab9 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -22,10 +22,14 @@ SHELL=/bin/bash KMOD := $(shell pwd)/kernel +SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ + then echo "$$PWD/../scst/include"; \ + else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) + enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) EXTRA_CFLAGS += $(call enable-Wextra,-Wextra -Wno-unused-parameter \ - -Wno-missing-field-initializers) + -Wno-missing-field-initializers) -I$(SCST_INC_DIR) ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) EXTRA_CFLAGS += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) @@ -57,7 +61,7 @@ qla2xxx_scst-objs := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o else all: - $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m + $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m EXTRA_CFLAGS="$(EXTRA_CFLAGS)" install: all $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \ diff --git a/qla2x00t/qla_inline.h b/qla2x00t/qla_inline.h index e73c3a8f4..f311c67d1 100644 --- a/qla2x00t/qla_inline.h +++ b/qla2x00t/qla_inline.h @@ -5,6 +5,12 @@ * See LICENSE.qla2xxx for copyright and licensing details. */ +#ifdef INSIDE_KERNEL_TREE +#include /* timer_setup() */ +#else +#include +#endif + /* * qla2x00_debounce_register * Debounce register.