cleanup KERNEL_VERSION definition and linux/version.h
Subsystems (10)
PATCH 1/1 cleanup KERNEL_VERSION definition and linux/version.h
Hi Marcelo,
I send you a patch to clean up KERNEL_VERSION definition and linux/version.h generated by linux/Makefile.
Main part of the patch is as follows:
Makefile Wed Mar 20 00:46:23 2002 renamed from Makefile Wed Feb 27 00:15:58 2002 +10 -3
@@ -325,9 +325,16 @@ @mv -f .ver $@ include/linux/version.h: ./Makefile - @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver - @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver - @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver + @echo "/* this file is generate automaticaly. don\'t edit */" > .ver + @echo '' >> .ver + @echo '#if !defined(_LINUX_VERSION_H_INCLUDED)' >> .ver + @echo '#define _LINUX_VERSION_H_INCLUDED' >> .ver + @echo '' >> .ver + @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" >> .ver + @echo '#define KERNEL_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))' >>.ver + @echo \#define LINUX_VERSION_CODE KERNEL_VERSION\($(VERSION), $(PATCHLEVEL), $(SUBLEVEL)\) >> .ver + @echo '' >> .ver + @echo '#endif' >> .ver @mv -f .ver $@ comma := ,
This patch is against 2.4.18.
I hope it is merged to the tree.
Hiroyuki Toda
Makefile +10 -3
@@ -325,9 +325,16 @@ @mv -f .ver $@ include/linux/version.h: ./Makefile - @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver - @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver - @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver + @echo "/* this file is generate automaticaly. don\'t edit */" > .ver + @echo '' >> .ver + @echo '#if !defined(_LINUX_VERSION_H_INCLUDED)' >> .ver + @echo '#define _LINUX_VERSION_H_INCLUDED' >> .ver + @echo '' >> .ver + @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" >> .ver + @echo '#define KERNEL_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))' >>.ver + @echo \#define LINUX_VERSION_CODE KERNEL_VERSION\($(VERSION), $(PATCHLEVEL), $(SUBLEVEL)\) >> .ver + @echo '' >> .ver + @echo '#endif' >> .ver @mv -f .ver $@ comma := ,
drivers/char/ip2main.c +0 -4
@@ -122,10 +122,6 @@#include <asm/irq.h> #include <asm/bitops.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION (ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq)) -#endif -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,0 )# include <linux/vmalloc.h> # include <linux/init.h>
drivers/message/i2o/i2o_scsi.h +0 -5
@@ -1,12 +1,7 @@#ifndef _I2O_SCSI_H#define _I2O_SCSI_H -#if !defined(LINUX_VERSION_CODE )#include <linux/version.h> -#endif - -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) -#include <linux/types.h> #include <linux/kdev_t.h>
drivers/net/de4x5.h +0 -2
@@ -1026,6 +1026,4 @@#define DE4X5_SET_OMR 0x0d/* Set the OMR Register contents */ #define DE4X5_GET_REG 0x0e/* Get the DE4X5 Registers */ -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) -#define MOTO_SROM_BUG ((lp->active == 8) && (((le32_to_cpu(get_unaligned(((s32 *)dev->dev_addr))))&0x00ffffff)==0x3e0008))
drivers/scsi/aic7xxx/aic7xxx_osm.h +0 -4
@@ -72,10 +72,6 @@#include <linux/module.h> #include <asm/byteorder.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION (x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 )#include <linux/config.h> #endif
drivers/scsi/cpqfcTScontrol.c +1 -2
@@ -28,8 +28,7 @@Hewlitt Packard Manual Part Number 5968-1083E. */ -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) - +#include <linux/version.h> #include <linux/blk.h> #include <linux/kernel.h> #include <linux/string.h>
drivers/scsi/cpqfcTSinit.c +5 -7
@@ -29,8 +29,7 @@*/ -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) - +#include <linux/version.h> #include <linux/blk.h> #include <linux/kernel.h> #include <linux/string.h>
@@ -41,7 +40,7 @@#include <linux/timer.h> #include <linux/ioport.h> // request_region() prototype #include <linux/vmalloc.h> // ioremap() -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,7 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,7 )#include <linux/completion.h> #endif #ifdef __alpha__
@@ -63,7 +62,6 @@#include <linux/config.h> #include <linux/module.h> -#include <linux/version.h> /* Embedded module documentation macros - see module.h */ MODULE_AUTHOR ("Compaq Computer Corporation" );
@@ -78,7 +76,7 @@// few fields... // NOTE: proc_fs changes in 2.4 kernel -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 )static struct proc_dir_entry proc_scsi_cpqfcTS = { PROC_SCSI_CPQFCTS, // ushort low_ino (enumerated list)
@@ -92,7 +90,7 @@#endif -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,7 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,7 )# define CPQFC_DECLARE_COMPLETION (x) DECLARE_COMPLETION(x)# define CPQFC_WAITING waiting# define CPQFC_COMPLETE (x) complete(x)
@@ -279,7 +277,7 @@ENTER ("cpqfcTS_detect" ); -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 ) ScsiHostTemplate->proc_dir = &proc_scsi_cpqfcTS;#else ScsiHostTemplate->proc_name ="cpqfcTS" ;
drivers/scsi/cpqfcTSstructs.h +1 -1
@@ -20,6 +20,7 @@#ifndef CPQFCTSSTRUCTS_H #define CPQFCTSSTRUCTS_H +#include <linux/version.h> #include <linux/timer.h> // timer declaration in our host data #include <linux/tqueue.h> // task queue sched #include <asm/atomic.h>
@@ -88,7 +89,6 @@#define CPQFCTS_CMD_PER_LUN 15 // power of 2 -1, must be >0#define CPQFCTS_REQ_QUEUE_LEN (TACH_SEST_LEN/2) // must be < TACH_SEST_LEN -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s))#ifndef DECLARE_MUTEX_LOCKED #define DECLARE_MUTEX_LOCKED (sem) struct semaphore sem = MUTEX_LOCKED#endif
drivers/scsi/dc390.h +0 -3
@@ -14,9 +14,6 @@#define DC390_H #include <linux/version.h> -#ifndef KERNEL_VERSION -# define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#endif #define DC390_BANNER "Tekram DC390/AM53C974"#define DC390_VERSION "2.0f 2000-12-20"
drivers/scsi/eata.c +0 -4
@@ -393,10 +393,6 @@#include <linux/version.h> -#ifndef LinuxVersionCode -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) -#endif -#define MAX_INT_PARAM 10#if defined(MODULE )
drivers/scsi/ips.c +22 -22
170 lines not on this page · raw message
drivers/scsi/ips.h +2 -4
@@ -47,6 +47,7 @@#ifndef _IPS_H_#define _IPS_H_ +#include <linux/version.h> #include <asm/uaccess.h> #include <asm/io.h>
@@ -69,9 +70,6 @@/* * Some handy macros */ -#ifndef LinuxVersionCode -#define LinuxVersionCode (x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif #define IPS_HA (x) ((ips_ha_t *) x->hostdata)#define IPS_COMMAND_ID (ha, scb) (int) (scb - ha->scbs)
@@ -415,7 +413,7 @@/* * Scsi_Host Template */ -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 )#define IPS { \ next : NULL, \ module : NULL, \
drivers/scsi/ncr53c8xx.c +15 -16
@@ -114,15 +114,15 @@**========================================================== */ -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) +#include <linux/version.h> #include <linux/module.h> #include <asm/dma.h> #include <asm/io.h> #include <asm/system.h> -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,17 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,17 )#include <linux/spinlock.h> -#elif LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,93 ) +#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,93 )#include <asm/spinlock.h> #endif #include <linux/delay.h>
@@ -137,10 +137,9 @@#include <linux/timer.h> #include <linux/stat.h> -#include <linux/version.h> #include <linux/blk.h> -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,35 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,35 )#include <linux/init.h> #endif
@@ -151,7 +150,7 @@#define __initdata#endif -#if LINUX_VERSION_CODE <=LinuxVersionCode (2 ,1 ,92 ) +#if LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,1 ,92 )#include <linux/bios32.h> #endif
@@ -186,7 +185,7 @@** Donnot compile integrity checking code for Linux-2.3.0 ** and above since SCSI data structures are not ready yet. */ -/* #if LINUX_VERSION_CODE < LinuxVersionCode(2,3,0) */ +/* #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */ #if 0 #define SCSI_NCR_INTEGRITY_CHECKING #endif
@@ -1012,7 +1011,7 @@/* when lcb is not allocated. */ Scsi_Cmnd *done_list;/* Commands waiting for done() */ /* callback to be invoked. */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,93 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,93 )spinlock_t smp_lock;/* Lock for SMP threading */ #endif
@@ -3698,7 +3697,7 @@ instance->max_id = np->maxwide ?16 :8 ; instance->max_lun =SCSI_NCR_MAX_LUN ;#ifndef SCSI_NCR_IOMAPPED -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,29 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,29 ) instance->base = (unsigned long ) np->reg;#else instance->base = (char *) np->reg;
@@ -3787,7 +3786,7 @@ if (request_irq(device->slot.irq, ncr53c8xx_intr, ((driver_setup.irqm & 0x10) ? 0 : SA_SHIRQ) | -#if LINUX_VERSION_CODE < LinuxVersionCode(2,2,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) ((driver_setup.irqm & 0x20) ? 0 : SA_INTERRUPT), #else 0,
@@ -9171,7 +9170,7 @@** **========================================================== */ -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 )static struct proc_dir_entry proc_scsi_ncr53c8xx = {PROC_SCSI_NCR53C8XX ,9 ,NAME53C8XX , S_IFDIR | S_IRUGO | S_IXUGO, 2
@@ -9186,7 +9185,7 @@*/ #ifdef MODULE char *ncr53c8xx =0 ;/* command line passed by insmod */ -# if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,30 ) +# if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,30 )MODULE_PARM (ncr53c8xx,"s" );# endif #endif
@@ -9196,7 +9195,7 @@return sym53c8xx__setup (str); } -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,13 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,13 )#ifndef MODULE __setup ("ncr53c8xx=" , ncr53c8xx_setup);#endif
@@ -9236,7 +9235,7 @@** Initialize driver general stuff. */ #ifdef SCSI_NCR_PROC_INFO_SUPPORT -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 ) tpnt->proc_dir = &proc_scsi_ncr53c8xx;#else tpnt->proc_name =NAME53C8XX ;
@@ -9269,10 +9268,10 @@*/ MODULE_LICENSE ("GPL" ); -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 ) static#endif -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,0 ) || defined(MODULE ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 ) || defined(MODULE )Scsi_Host_Template driver_template =NCR53C8XX ;#include "scsi_module.c" #endif
drivers/scsi/ncr53c8xx.h +1 -1
@@ -67,7 +67,7 @@#endif -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,75 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,75 )#define NCR53C8XX { name: "", \ detect: ncr53c8xx_detect, \
drivers/scsi/qla1280.c +0 -5
@@ -223,11 +223,6 @@#include <linux/slab.h> /* for kmalloc() */ -#ifndef KERNEL_VERSION -# define KERNEL_VERSION (x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif - -/* * Compile time Options: * 0 - Disable and 1 - Enable
drivers/scsi/qla1280.h +0 -4
@@ -191,10 +191,6 @@#endif -#ifndef KERNEL_VERSION -# define KERNEL_VERSION (x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif -#if LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,1 ,92 )# if defined(__sparc_v9__) || defined(__powerpc__)# error "PPC and Sparc platforms are only support under 2.1.92 and above"
drivers/scsi/sym53c416.h +0 -7
@@ -18,14 +18,7 @@#ifndef _SYM53C416_H#define _SYM53C416_H -#if !defined(LINUX_VERSION_CODE )#include <linux/version.h> -#endif - -#ifndef LinuxVersionCode -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) -#endif -#include <linux/types.h> #include <linux/kdev_t.h>
drivers/scsi/sym53c8xx.c +29 -31
218 lines not on this page · raw message
drivers/scsi/sym53c8xx.h +1 -1
@@ -82,7 +82,7 @@#endif -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,75 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,75 )#define SYM53C8XX { name: "", \ detect: sym53c8xx_detect, \
drivers/scsi/sym53c8xx_2/sym_glue.c +16 -16
@@ -74,7 +74,7 @@ {u_long base; -#if LINUX_VERSION_CODE >LinuxVersionCode (2 ,3 ,12 ) +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,3 ,12 ) base = pdev->resource[index].start;#else base = pdev->base_address[index];
@@ -106,11 +106,11 @@#undef PCI_BAR_OFFSET } -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,0 )#define pci_enable_device (pdev) (0)#endif -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,4 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,4 )#define scsi_set_pci_device (inst, pdev) do { ;} while (0)#endif
@@ -245,7 +245,7 @@/* * /proc directory entry and proc_info. */ -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 )static struct proc_dir_entry proc_scsi_sym53c8xx = {PROC_SCSI_SYM53C8XX ,9 ,NAME53C8XX , S_IFDIR | S_IRUGO | S_IXUGO, 2
@@ -258,7 +258,7 @@* Until some linux kernel version near 2.3.40, low-level scsi * drivers were not told about data transfer direction. */ -#if LINUX_VERSION_CODE >LinuxVersionCode (2 ,3 ,40 ) +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,3 ,40 )#define scsi_data_direction (cmd) (cmd->sc_data_direction)
@@ -592,7 +592,7 @@*/ cam_status =sym_xerr_cam_status (DID_ERROR , cp->xerr_status); } -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,99 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,99 ) csio->resid = resid;#endif csio->result = (drv_status <<24 ) + (cam_status <<16 ) + scsi_status;
@@ -849,7 +849,7 @@ {u_long thistime =ktime_get (0 ); -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,0 )/* * If release process in progress, let's go * Set the release stage from 1 to 2 to synchronize
@@ -1152,7 +1152,7 @@ goto finish;break ;case SYM_EH_DO_WAIT : -#if LINUX_VERSION_CODE >LinuxVersionCode (2 ,3 ,0 ) +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,3 ,0 )init_MUTEX_LOCKED (&ep->sem);#else ep->sem =MUTEX_LOCKED ;
@@ -1870,7 +1870,7 @@#ifdef SYM_LINUX_DYNAMIC_DMA_MAPPING static int sym_setup_bus_dma_mask (hcb_p np) { -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,3 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,3 )if (!pci_dma_supported (np->s.device,0xffffffffUL )) goto out_err32;#else
@@ -2122,7 +2122,7 @@ instance->max_id = np->maxwide ?16 :8 ; instance->max_lun =SYM_CONF_MAX_LUN ;#ifndef SYM_CONF_IOMAPPED -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,29 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,29 ) instance->base = (unsigned long ) np->s.mmio_va;#else instance->base = (char *) np->s.mmio_va;
@@ -2136,7 +2136,7 @@ instance->cmd_per_lun =SYM_CONF_MAX_TAG ; instance->can_queue = (SYM_CONF_MAX_START -2 ); instance->sg_tablesize =SYM_CONF_MAX_SG ; -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 ) instance->max_cmd_len =16 ;#endif instance->select_queue_depths = sym53c8xx_select_queue_depths;
@@ -2387,7 +2387,7 @@return 1 ; } -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,13 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,13 )#ifndef MODULE __setup ("sym53c8xx=" , sym53c8xx_setup);#endif
@@ -2737,7 +2737,7 @@* Initialize driver general stuff. */ #ifdef SYM_LINUX_PROC_INFO_SUPPORT -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,3 ,27 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,3 ,27 ) tpnt->proc_dir = &proc_scsi_sym53c8xx;#else tpnt->proc_name =NAME53C8XX ;
@@ -2945,7 +2945,7 @@* In the unlikely situation where this failed, * try to synchronize with the timer handler. */ -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,0 ) np->s.release_stage =1 ;if (!del_timer (&np->s.timer)) {int i =1000 ;
@@ -3003,10 +3003,10 @@/* * Driver host template. */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 ) static#endif -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,4 ,0 ) || defined(MODULE ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 ) || defined(MODULE )Scsi_Host_Template driver_template =SYM53C8XX ;#include "../scsi_module.c" #endif
drivers/scsi/sym53c8xx_2/sym_glue.h +5 -6
@@ -57,16 +57,15 @@#define SYM_CONF_DMA_ADDRESSING_MODE 2#endif -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s))#include <linux/version.h> -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,2 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,2 ,0 )#error "This driver requires a kernel version not lower than 2.2.0"#endif #include <asm/dma.h> #include <asm/io.h> #include <asm/system.h> -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,17 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,17 )#include <linux/spinlock.h> #else #include <asm/spinlock.h>
@@ -140,7 +139,7 @@/* * Configuration addendum for Linux. */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,47 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,47 )#define SYM_LINUX_DYNAMIC_DMA_MAPPING #endif
@@ -473,7 +472,7 @@u_long lasttime;u_long settle_time;/* Resetting the SCSI BUS */ u_char settle_time_valid; -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,0 )u_char release_stage;/* Synchronisation on release */ #endif };
@@ -648,7 +647,7 @@ {Scsi_Cmnd *cmd = cp->cam_ccb; -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,99 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,99 ) cmd->resid = resid;#endif cmd->result = (((DID_OK ) <<16 ) + ((cp->ssss_status) &0x7f ));
drivers/scsi/sym53c8xx_comm.h +14 -12
@@ -54,6 +54,8 @@******************************************************************************* */ +#include <linux/version.h> +/* ** This file contains definitions and code that the ** sym53c8xx and ncr53c8xx drivers should share.
@@ -74,7 +76,7 @@**========================================================== */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,3 ,47 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,47 )#define SCSI_NCR_DYNAMIC_DMA_MAPPING #endif
@@ -262,7 +264,7 @@**========================================================== */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,2 ,0 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,2 ,0 )typedef struct pci_dev *pcidev_t ;#define PCIDEV_NULL (0)
@@ -277,7 +279,7 @@ {u_long base; -#if LINUX_VERSION_CODE >LinuxVersionCode (2 ,3 ,12 ) +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,3 ,12 ) base = pdev->resource[index].start;#else base = pdev->base_address[index];
@@ -397,13 +399,13 @@ return base; } -#endif /* LINUX_VERSION_CODE >= LinuxVersionCode(2,2,0) */ +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) */ /* Does not make sense in earlier kernels */ -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,0 )#define pci_enable_device (pdev) (0)#endif -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,4 ,4 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,4 )#define scsi_set_pci_device (inst, pdev) (0)#endif
@@ -428,7 +430,7 @@**========================================================== */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,93 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,93 )spinlock_t DRIVER_SMP_LOCK =SPIN_LOCK_UNLOCKED ;#define NCR_LOCK_DRIVER (flags) spin_lock_irqsave(&DRIVER_SMP_LOCK, flags)#define NCR_UNLOCK_DRIVER (flags) \
@@ -472,7 +474,7 @@**========================================================== */ -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,1 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,1 ,0 )#define ioremap vremap#define iounmap vfree#endif
@@ -518,7 +520,7 @@**========================================================== */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,105 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,105 )#define UDELAY udelay#define MDELAY mdelay#else
@@ -544,7 +546,7 @@**========================================================== */ -#if LINUX_VERSION_CODE >=LinuxVersionCode (2 ,1 ,0 ) +#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,0 )#define __GetFreePages (flags, order) __get_free_pages(flags, order)#else #define __GetFreePages (flags, order) __get_free_pages(flags, order, 0)
@@ -2309,7 +2311,7 @@pci_write_config_word (pdev,PCI_COMMAND , command); } -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,2 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,2 ,0 )if ( is_prep ) {if (io_port >=0x10000000 ) {printk (NAME53C8XX ": reallocating io_port (Wacky IBM)" );
@@ -2335,7 +2337,7 @@#if defined(__i386__) && !defined(MODULE )if (!cache_line_size) { -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,1 ,75 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,1 ,75 )extern char x86;switch (x86) {#else
drivers/scsi/sym53c8xx_defs.h +2 -6
@@ -61,13 +61,9 @@** Check supported Linux versions */ -#if !defined(LINUX_VERSION_CODE )#include <linux/version.h> -#endif #include <linux/config.h> -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) -/* * NCR PQS/PDS special device support. */
@@ -175,7 +171,7 @@#elif defined(__alpha__)#define SCSI_NCR_IOMAPPED #elif defined(__powerpc__) -#if LINUX_VERSION_CODE <=LinuxVersionCode (2 ,4 ,3 ) +#if LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,4 ,3 )#define SCSI_NCR_IOMAPPED #define SCSI_NCR_PCI_MEM_NOT_SUPPORTED #endif
@@ -367,7 +363,7 @@#ifdef __BIG_ENDIAN -#if LINUX_VERSION_CODE <LinuxVersionCode (2 ,1 ,0 ) +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,1 ,0 )#error "BIG ENDIAN byte ordering needs kernel version >= 2.1.0"#endif
drivers/scsi/u14-34f.c +0 -4
@@ -337,10 +337,6 @@#include <linux/module.h> #include <linux/version.h> -#ifndef LinuxVersionCode -#define LinuxVersionCode (v, p, s) (((v)<<16)+((p)<<8)+(s)) -#endif -#define MAX_INT_PARAM 10MODULE_PARM (boot_options,"s" );
include/linux/i2c.h +0 -3
@@ -43,9 +43,6 @@/* --- Includes and compatibility declarations ------------------------ */ #include <linux/version.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION (a,b,c) (((a) << 16) | ((b) << 8) | (c)) -#endif #include <asm/page.h> /* for 2.2.xx */ #if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,0 ,25 )
include/linux/sdladrv.h +0 -4
@@ -21,10 +21,6 @@#include <linux/version.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#endif -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,0 )#define LINUX_2_4 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
include/linux/wanpipe.h +0 -4
@@ -41,10 +41,6 @@#include <linux/version.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#endif -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,0 )#define LINUX_2_4
include/linux/wanrouter.h +0 -4
@@ -45,10 +45,6 @@*****************************************************************************/ #include <linux/version.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#endif -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,3 ,0 )#define LINUX_2_4 #define netdevice_t struct net_device
init/version.c +0 -5
@@ -11,11 +11,6 @@#include <linux/version.h> #include <linux/compile.h> -#define version (a) Version_ ## a -#define version_string (a) version(a) - -int version_string (LINUX_VERSION_CODE ); -struct new_utsname system_utsname = {UTS_SYSNAME ,UTS_NODENAME ,UTS_RELEASE ,UTS_VERSION ,UTS_MACHINE ,UTS_DOMAINNAME
Quoted 29 lines · Hiroyuki Toda
Hi Marcelo,
I send you a patch to clean up
KERNEL_VERSIONdefinition andlinux/version.hgenerated by linux/Makefile.Main part of the patch is as follows:
diff -ur linux-2.4.18.org/Makefile linux/Makefile
Makefile Wed Mar 20 00:46:23 2002 renamed from Makefile Wed Feb 27 00:15:58 2002 +0
-0@@ -325,9 +325,16 @@ @mv -f .ver $@
include/linux/version.h: ./MakefileMakefile Wed Mar 20 00:46:23 2002 renamed from Makefile Wed Feb 27 00:15:58 2002 +10
-3- @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver - @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver - @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver + @echo "/* this file is generate automaticaly. don\'t edit */" > .ver + @echo '' >> .ver + @echo '#if !defined(_LINUX_VERSION_H_INCLUDED)' >> .ver + @echo '#define _LINUX_VERSION_H_INCLUDED' >> .ver + @echo '' >> .ver + @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" >> .ver + @echo '#define KERNEL_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))' >>.ver + @echo \#define LINUX_VERSION_CODE KERNEL_VERSION\($(VERSION), $(PATCHLEVEL), $(SUBLEVEL)\) >> .ver + @echo '' >> .ver + @echo '#endif' >> .ver @mv -f .ver $@
Quoted 2 lines
comma := ,
This file will change completely in 2.5 when kbuild 2.5 goes in. Why does it need to be rearranged in 2.4?
Keith> This file will change completely in 2.5 when kbuild 2.5 goes in. Why Keith> does it need to be rearranged in 2.4?
Will kbuild 2.5 go in 2.4 tree also?
Hiroyuki Toda
Quoted 5 lines · Hiroyuki Toda
Keith> This file will change completely in 2.5 when kbuild 2.5 goes in. Why Keith> does it need to be rearranged in 2.4?
Will kbuild 2.5 go in 2.4 tree also?
No, but version.h is working at the moment in 2.4. Why change it?
Keith> >Will kbuild 2.5 go in 2.4 tree also?
Keith>
Keith> No, but version.h is working at the moment in 2.4. Why change it?
Because version.h and its generating code (in linux/Makefile) are not smart.
Hiroyuki Toda
Quoted 9 lines · Keith Owens
Quoted 5 lines · Hiroyuki Toda
Keith> This file will change completely in 2.5 when kbuild 2.5 goes in. Why Keith> does it need to be rearranged in 2.4?
Will kbuild 2.5 go in 2.4 tree also?
No, but
version.his working at the moment in 2.4. Why change it?
Why do so many drivers enable options depending on the kernel version? Shouldn't that be stripped out before a patch is accepted into the kernel?
Quoted 7 lines · Mike Fedyk
Quoted 6 lines · Keith Owens
Quoted 4 lines · Hiroyuki Toda
Keith> This file will change completely in 2.5 when kbuild 2.5 goes in. Why Keith> does it need to be rearranged in 2.4?
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Will kbuild 2.5 go in 2.4 tree also?
No, but
version.his working at the moment in 2.4. Why change it?Why do so many drivers enable options depending on the kernel version? Shouldn't that be stripped out before a patch is accepted into the kernel?
From kbuild 2.5 top level
Makefile.
# FIXME: Current kernel source includes linux/version.h, mainly to get # KERNEL_VERSION(). version.h also includes UTS_RELEASE which changes every
# time the kernel identifiers change. The presence of UTS_RELEASE in version.h # causes lots of unnecessary recompilations, very few places actually want # UTS_RELEASE. The new makefile generates separate linux/version.h and # linux/uts_release.h, with version.h including utsname.h to avoid compilation # errors. Find all the source code that needs just UTS_RELEASE and change it to # include uts_release.h, then remove #include <linux/uts_release.h> from the # commands below. KAO
Unfortunately this area of kbuild 2.4 is fragile. At the moment, changes to the top level Makefile indirectly force a rebuild, Makefile -> version.h -> KERNEL_VERSION() -> almost everything.
Breaking that chain _might_ cause problems in 2.4 because it does not have a complete dependency chain to pick up changes to the top level Makefile, it only works at the moment due to the extra recompiles. I am not willing to change this in 2.4 until I have got it stable in 2.5.
Quoted 9 lines
Quoted 3 lines · Keith Owens
Quoted 1 line
No, but
version.his working at the moment in 2.4. Why change it?Quoted 2 lines · Mike Fedyk
Why do so many drivers enable options depending on the kernel version? Shouldn't that be stripped out before a patch is accepted into the kernel?
Quoted 12 lines · Keith Owens
Quoted 1 line
From kbuild 2.5 top level
Makefile.# FIXME: Current kernel source includes
linux/version.h, mainly to get #KERNEL_VERSION().version.halso includesUTS_RELEASEwhich changes every# time the kernel identifiers change. The presence of UTS_RELEASE in version.h # causes lots of unnecessary recompilations, very few places actually want # UTS_RELEASE. The new makefile generates separate linux/version.h and # linux/uts_release.h, with version.h including utsname.h to avoid compilation # errors. Find all the source code that needs just UTS_RELEASE and change it to # include uts_release.h, then remove #include <linux/uts_release.h> from the # commands below. KAO
Quoted 8 lines
Unfortunately this area of kbuild 2.4 is fragile. At the moment, changes to the top level
Makefileindirectly force a rebuild,Makefile->version.h->KERNEL_VERSION()-> almost everything.Breaking that chain _might_ cause problems in 2.4 because it does not have a complete dependency chain to pick up changes to the top level
Makefile, it only works at the moment due to the extra recompiles. I am not willing to change this in 2.4 until I have got it stable in 2.5.
Sounds like a good plan to work on 2.5 first.
Hmm. It looks like kbuild 2.5 might be able to be split up into a few separate parts. Do you think so too?
Do you know where I could find some good documentation on Makefiles? Especially on dependencies and etc?
Quoted 8 lines · Mike Fedyk
Quoted 5 lines
Quoted 1 line · Keith Owens
Breaking that chain _might_ cause problems in 2.4 because it does not have a complete dependency chain to pick up changes to the top level
Makefile, it only works at the moment due to the extra recompiles. I am not willing to change this in 2.4 until I have got it stable in 2.5.Hmm. It looks like kbuild 2.5 might be able to be split up into a few separate parts. Do you think so too?
There are some bug fixes to existing makefiles and CML1 that can safely be fed back to 2.4, I will do them next week. Apart from that, the design philosophies for kbuild 2.4 and 2.5 are completely different, there is little from kbuild 2.5 that can safely be extracted and back ported to kbuild 2.4.
Quoted 2 lines
Do you know where I could find some good documentation on Makefiles? Especially on dependencies and etc?
info make.