Commit 1fe595bb authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] #if abuses

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 355a1bb9
...@@ -570,7 +570,7 @@ static const char *major_name="sbpcd"; ...@@ -570,7 +570,7 @@ static const char *major_name="sbpcd";
/*==========================================================================*/ /*==========================================================================*/
#if FUTURE #ifdef FUTURE
static DECLARE_WAIT_QUEUE_HEAD(sbp_waitq); static DECLARE_WAIT_QUEUE_HEAD(sbp_waitq);
#endif /* FUTURE */ #endif /* FUTURE */
...@@ -703,7 +703,7 @@ static struct sbpcd_drive { ...@@ -703,7 +703,7 @@ static struct sbpcd_drive {
u_char TocEnt_number; u_char TocEnt_number;
u_char TocEnt_format; /* em */ u_char TocEnt_format; /* em */
u_int TocEnt_address; u_int TocEnt_address;
#if SAFE_MIXED #ifdef SAFE_MIXED
char has_data; char has_data;
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
u_char ored_ctl_adr; /* to detect if CDROM contains data tracks */ u_char ored_ctl_adr; /* to detect if CDROM contains data tracks */
...@@ -3176,7 +3176,7 @@ static int cc_CheckMultiSession(void) ...@@ -3176,7 +3176,7 @@ static int cc_CheckMultiSession(void)
return (0); return (0);
} }
/*==========================================================================*/ /*==========================================================================*/
#if FUTURE #ifdef FUTURE
static int cc_SubChanInfo(int frame, int count, u_char *buffer) static int cc_SubChanInfo(int frame, int count, u_char *buffer)
/* "frame" is a RED BOOK (msf-bin) address */ /* "frame" is a RED BOOK (msf-bin) address */
{ {
...@@ -3733,7 +3733,7 @@ static int __init check_drives(void) ...@@ -3733,7 +3733,7 @@ static int __init check_drives(void)
return (0); return (0);
} }
/*==========================================================================*/ /*==========================================================================*/
#if FUTURE #ifdef FUTURE
/* /*
* obtain if requested service disturbs current audio state * obtain if requested service disturbs current audio state
*/ */
...@@ -4027,7 +4027,7 @@ static int sbpcd_drive_status(struct cdrom_device_info *cdi, int slot_nr) ...@@ -4027,7 +4027,7 @@ static int sbpcd_drive_status(struct cdrom_device_info *cdi, int slot_nr)
/*==========================================================================*/ /*==========================================================================*/
#if FUTURE #ifdef FUTURE
/* /*
* called always if driver gets entered * called always if driver gets entered
* returns 0 or ERROR2 or ERROR15 * returns 0 or ERROR2 or ERROR15
...@@ -4198,7 +4198,7 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4198,7 +4198,7 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
case CDROMREADMODE1: case CDROMREADMODE1:
msg(DBG_IOC,"ioctl: CDROMREADMODE1 requested.\n"); msg(DBG_IOC,"ioctl: CDROMREADMODE1 requested.\n");
#if SAFE_MIXED #ifdef SAFE_MIXED
if (current_drive->has_data>1) RETURN_UP(-EBUSY); if (current_drive->has_data>1) RETURN_UP(-EBUSY);
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
cc_ModeSelect(CD_FRAMESIZE); cc_ModeSelect(CD_FRAMESIZE);
...@@ -4208,7 +4208,7 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4208,7 +4208,7 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
case CDROMREADMODE2: /* not usable at the moment */ case CDROMREADMODE2: /* not usable at the moment */
msg(DBG_IOC,"ioctl: CDROMREADMODE2 requested.\n"); msg(DBG_IOC,"ioctl: CDROMREADMODE2 requested.\n");
#if SAFE_MIXED #ifdef SAFE_MIXED
if (current_drive->has_data>1) RETURN_UP(-EBUSY); if (current_drive->has_data>1) RETURN_UP(-EBUSY);
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
cc_ModeSelect(CD_FRAMESIZE_RAW1); cc_ModeSelect(CD_FRAMESIZE_RAW1);
...@@ -4257,11 +4257,11 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4257,11 +4257,11 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
if (famL_drive) RETURN_UP(-EINVAL); if (famL_drive) RETURN_UP(-EINVAL);
if (famV_drive) RETURN_UP(-EINVAL); if (famV_drive) RETURN_UP(-EINVAL);
if (famT_drive) RETURN_UP(-EINVAL); if (famT_drive) RETURN_UP(-EINVAL);
#if SAFE_MIXED #ifdef SAFE_MIXED
if (current_drive->has_data>1) RETURN_UP(-EBUSY); if (current_drive->has_data>1) RETURN_UP(-EBUSY);
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
if (current_drive->aud_buf==NULL) RETURN_UP(-EINVAL); if (current_drive->aud_buf==NULL) RETURN_UP(-EINVAL);
if (copy_from_user(&read_audio, (void *)arg, if (copy_from_user(&read_audio, (void __user *)arg,
sizeof(struct cdrom_read_audio))) sizeof(struct cdrom_read_audio)))
RETURN_UP(-EFAULT); RETURN_UP(-EFAULT);
if (read_audio.nframes < 0 || read_audio.nframes>current_drive->sbp_audsiz) RETURN_UP(-EINVAL); if (read_audio.nframes < 0 || read_audio.nframes>current_drive->sbp_audsiz) RETURN_UP(-EINVAL);
...@@ -4460,8 +4460,8 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4460,8 +4460,8 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
msg(DBG_AUD,"read_audio: cc_ReadError was necessary after read: %02X\n",i); msg(DBG_AUD,"read_audio: cc_ReadError was necessary after read: %02X\n",i);
continue; continue;
} }
if (copy_to_user((u_char *)read_audio.buf, if (copy_to_user(read_audio.buf,
(u_char *) current_drive->aud_buf, current_drive->aud_buf,
read_audio.nframes * CD_FRAMESIZE_RAW)) read_audio.nframes * CD_FRAMESIZE_RAW))
RETURN_UP(-EFAULT); RETURN_UP(-EFAULT);
msg(DBG_AUD,"read_audio: copy_to_user done.\n"); msg(DBG_AUD,"read_audio: copy_to_user done.\n");
...@@ -4549,7 +4549,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4549,7 +4549,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd,
case CDROMPLAYMSF: case CDROMPLAYMSF:
msg(DBG_IOC,"ioctl: CDROMPLAYMSF entered.\n"); msg(DBG_IOC,"ioctl: CDROMPLAYMSF entered.\n");
#if SAFE_MIXED #ifdef SAFE_MIXED
if (current_drive->has_data>1) RETURN_UP(-EBUSY); if (current_drive->has_data>1) RETURN_UP(-EBUSY);
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
if (current_drive->audio_state==audio_playing) if (current_drive->audio_state==audio_playing)
...@@ -4584,7 +4584,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4584,7 +4584,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd,
case CDROMPLAYTRKIND: /* Play a track. This currently ignores index. */ case CDROMPLAYTRKIND: /* Play a track. This currently ignores index. */
msg(DBG_IOC,"ioctl: CDROMPLAYTRKIND entered.\n"); msg(DBG_IOC,"ioctl: CDROMPLAYTRKIND entered.\n");
#if SAFE_MIXED #ifdef SAFE_MIXED
if (current_drive->has_data>1) RETURN_UP(-EBUSY); if (current_drive->has_data>1) RETURN_UP(-EBUSY);
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
if (current_drive->audio_state==audio_playing) if (current_drive->audio_state==audio_playing)
...@@ -4647,7 +4647,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd, ...@@ -4647,7 +4647,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd,
case CDROMSTOP: /* Spin down the drive */ case CDROMSTOP: /* Spin down the drive */
msg(DBG_IOC,"ioctl: CDROMSTOP entered.\n"); msg(DBG_IOC,"ioctl: CDROMSTOP entered.\n");
#if SAFE_MIXED #ifdef SAFE_MIXED
if (current_drive->has_data>1) RETURN_UP(-EBUSY); if (current_drive->has_data>1) RETURN_UP(-EBUSY);
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
i=cc_Pause_Resume(1); i=cc_Pause_Resume(1);
...@@ -4912,7 +4912,7 @@ static void do_sbpcd_request(request_queue_t * q) ...@@ -4912,7 +4912,7 @@ static void do_sbpcd_request(request_queue_t * q)
goto request_loop; goto request_loop;
} }
#if FUTURE #ifdef FUTURE
i=prepare(0,0); /* at moment not really a hassle check, but ... */ i=prepare(0,0); /* at moment not really a hassle check, but ... */
if (i!=0) if (i!=0)
msg(DBG_INF,"\"prepare\" tells error %d -- ignored\n", i); msg(DBG_INF,"\"prepare\" tells error %d -- ignored\n", i);
...@@ -4940,7 +4940,7 @@ static void do_sbpcd_request(request_queue_t * q) ...@@ -4940,7 +4940,7 @@ static void do_sbpcd_request(request_queue_t * q)
sbp_sleep(0); sbp_sleep(0);
if (sbp_data(req) != 0) if (sbp_data(req) != 0)
{ {
#if SAFE_MIXED #ifdef SAFE_MIXED
current_drive->has_data=2; /* is really a data disk */ current_drive->has_data=2; /* is really a data disk */
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
#ifdef DEBUG_GTL #ifdef DEBUG_GTL
...@@ -5416,11 +5416,11 @@ static int sbpcd_open(struct cdrom_device_info *cdi, int purpose) ...@@ -5416,11 +5416,11 @@ static int sbpcd_open(struct cdrom_device_info *cdi, int purpose)
if ((current_drive->ored_ctl_adr&0x40)==0) if ((current_drive->ored_ctl_adr&0x40)==0)
{ {
msg(DBG_INF,"CD contains no data tracks.\n"); msg(DBG_INF,"CD contains no data tracks.\n");
#if SAFE_MIXED #ifdef SAFE_MIXED
current_drive->has_data=0; current_drive->has_data=0;
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
} }
#if SAFE_MIXED #ifdef SAFE_MIXED
else if (current_drive->has_data<1) current_drive->has_data=1; else if (current_drive->has_data<1) current_drive->has_data=1;
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
} }
...@@ -5455,7 +5455,7 @@ static void sbpcd_release(struct cdrom_device_info * cdi) ...@@ -5455,7 +5455,7 @@ static void sbpcd_release(struct cdrom_device_info * cdi)
if (p->f_eject) cc_SpinDown(); if (p->f_eject) cc_SpinDown();
p->diskstate_flags &= ~cd_size_bit; p->diskstate_flags &= ~cd_size_bit;
p->open_count=0; p->open_count=0;
#if SAFE_MIXED #ifdef SAFE_MIXED
p->has_data=0; p->has_data=0;
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
} }
...@@ -5822,7 +5822,7 @@ int __init sbpcd_init(void) ...@@ -5822,7 +5822,7 @@ int __init sbpcd_init(void)
if (p->drv_id==-1) continue; if (p->drv_id==-1) continue;
switch_drive(p); switch_drive(p);
#if SAFE_MIXED #ifdef SAFE_MIXED
p->has_data=0; p->has_data=0;
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
/* /*
...@@ -5942,7 +5942,7 @@ static int sbpcd_media_changed(struct cdrom_device_info *cdi, int disc_nr) ...@@ -5942,7 +5942,7 @@ static int sbpcd_media_changed(struct cdrom_device_info *cdi, int disc_nr)
current_drive->diskstate_flags &= ~toc_bit; current_drive->diskstate_flags &= ~toc_bit;
/* we *don't* need invalidate here, it's done by caller */ /* we *don't* need invalidate here, it's done by caller */
current_drive->diskstate_flags &= ~cd_size_bit; current_drive->diskstate_flags &= ~cd_size_bit;
#if SAFE_MIXED #ifdef SAFE_MIXED
current_drive->has_data=0; current_drive->has_data=0;
#endif /* SAFE_MIXED */ #endif /* SAFE_MIXED */
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
*/ */
#define RAID5_DEBUG 0 #define RAID5_DEBUG 0
#define RAID5_PARANOIA 1 #define RAID5_PARANOIA 1
#if RAID5_PARANOIA && CONFIG_SMP #if RAID5_PARANOIA && defined(CONFIG_SMP)
# define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG() # define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG()
#else #else
# define CHECK_DEVLOCK() # define CHECK_DEVLOCK()
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#define RAID6_DEBUG 0 /* Extremely verbose printk */ #define RAID6_DEBUG 0 /* Extremely verbose printk */
#define RAID6_PARANOIA 1 /* Check spinlocks */ #define RAID6_PARANOIA 1 /* Check spinlocks */
#define RAID6_DUMPSTATE 0 /* Include stripe cache state in /proc/mdstat */ #define RAID6_DUMPSTATE 0 /* Include stripe cache state in /proc/mdstat */
#if RAID6_PARANOIA && CONFIG_SMP #if RAID6_PARANOIA && defined(CONFIG_SMP)
# define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG() # define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG()
#else #else
# define CHECK_DEVLOCK() # define CHECK_DEVLOCK()
......
...@@ -63,7 +63,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) ...@@ -63,7 +63,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
#define LAST_CONTEXT 255 #define LAST_CONTEXT 255
#define FIRST_CONTEXT 1 #define FIRST_CONTEXT 1
#elif CONFIG_E500 #elif defined(CONFIG_E500)
#define NO_CONTEXT 256 #define NO_CONTEXT 256
#define LAST_CONTEXT 255 #define LAST_CONTEXT 255
#define FIRST_CONTEXT 1 #define FIRST_CONTEXT 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment