Re: [2.4.0test1-ac16 PATCH] undefined references to CDROM_CAN

From: Peter Blomgren (blomgren@monster.stanford.edu)
Date: Mon Jun 12 2000 - 16:27:58 EST


Ben,

You're right... I was just lazy and cut-n-pasted what used to be
in there...

>
> On Mon, Jun 12, 2000 at 11:50:49AM -0700, Peter Blomgren wrote:
> > Alan,
> >
> > 2.4.0-test1-ac16 does not compile since the definition of CDROM_CAN
> > was removed... The following patch puts it back in:
> >
> Actually to fix compiler warnings (and make it more correct, IMO), it
> should be:
>
> #define CDROM_CAN(type) (cdi->ops->capability & ~cdi->mask & (type))
> ^ ^
>
> There is atleat one call to CDROM_CAN that |'s together some types, which
> need to remain grouped in the macro.

Updated patch:

--- linux/drivers/cdrom/cdrom.c.2.4.0-test1-ac16 Mon Jun 12 11:30:10 2000
+++ linux/drivers/cdrom/cdrom.c Mon Jun 12 11:30:53 2000
@@ -297,6 +297,10 @@
 #define IOCTL_OUT(arg, type, out) \
         copy_to_user_ret((type *) arg, &out, sizeof out, -EFAULT)
 
+/* The (cdo->capability & ~cdi->mask & CDC_XXX) construct was used in
+ a lot of places. This macro makes the code more clear. */
+#define CDROM_CAN(type) (cdi->ops->capability & ~cdi->mask & (type))
+
 /* used in the audio ioctls */
 #define CHECKAUDIO if ((ret=check_for_audio_disc(cdi, cdo))) return ret

-- 
\Peter.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:26 EST