2002-06-28 13:49:29

by Steve Lord

[permalink] [raw]
Subject: [PATCH] compile fix for 2.5 kdev_t compatibility macros



Marcelo,

We started using these for XFS, and found a missing bracket, patch
against 2.4.19-rc1.

Steve

*** linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:40:22 2002
--- linux/include/linux/kdev_t.h Fri Jun 28 07:05:32 2002
***************
*** 81,87 ****
#define minor(d) MINOR(d)
#define kdev_same(a,b) ((a) == (b))
#define kdev_none(d) (!(d))
! #define kdev_val(d) ((unsigned int)(d)
#define val_to_kdev(d) ((kdev_t(d))

/*
--- 81,87 ----
#define minor(d) MINOR(d)
#define kdev_same(a,b) ((a) == (b))
#define kdev_none(d) (!(d))
! #define kdev_val(d) ((unsigned int)(d))
#define val_to_kdev(d) ((kdev_t(d))

/*


2002-06-28 14:37:58

by Steven Cole

[permalink] [raw]
Subject: Re: [PATCH] compile fix for 2.5 kdev_t compatibility macros

On Fri, 2002-06-28 at 07:50, Stephen Lord wrote:
>
>
> Marcelo,
>
> We started using these for XFS, and found a missing bracket, patch
> against 2.4.19-rc1.
>
> Steve
>
> *** linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:40:22 2002
> --- linux/include/linux/kdev_t.h Fri Jun 28 07:05:32 2002
> ***************
> *** 81,87 ****
> #define minor(d) MINOR(d)
> #define kdev_same(a,b) ((a) == (b))
> #define kdev_none(d) (!(d))
> ! #define kdev_val(d) ((unsigned int)(d)
> #define val_to_kdev(d) ((kdev_t(d))
>
> /*
> --- 81,87 ----
> #define minor(d) MINOR(d)
> #define kdev_same(a,b) ((a) == (b))
> #define kdev_none(d) (!(d))
> ! #define kdev_val(d) ((unsigned int)(d))
> #define val_to_kdev(d) ((kdev_t(d))
>
> /*

That's an odd-looking patch. Is this what you meant?

Steven

--- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 08:31:27 2002
+++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:32:36 2002
@@ -81,7 +81,7 @@
#define minor(d) MINOR(d)
#define kdev_same(a,b) ((a) == (b))
#define kdev_none(d) (!(d))
-#define kdev_val(d) ((unsigned int)(d)
+#define kdev_val(d) ((unsigned int)(d))
#define val_to_kdev(d) ((kdev_t(d))

/*


2002-06-28 14:45:15

by Steve Lord

[permalink] [raw]
Subject: Re: [PATCH] compile fix for 2.5 kdev_t compatibility macros

On Fri, 2002-06-28 at 09:37, Steven Cole wrote:
> On Fri, 2002-06-28 at 07:50, Stephen Lord wrote:
> >
> >
> > Marcelo,
> >
> > We started using these for XFS, and found a missing bracket, patch
> > against 2.4.19-rc1.
> >
> > Steve
> >
> > *** linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:40:22 2002
> > --- linux/include/linux/kdev_t.h Fri Jun 28 07:05:32 2002
> > ***************
> > *** 81,87 ****
> > #define minor(d) MINOR(d)
> > #define kdev_same(a,b) ((a) == (b))
> > #define kdev_none(d) (!(d))
> > ! #define kdev_val(d) ((unsigned int)(d)
> > #define val_to_kdev(d) ((kdev_t(d))
> >
> > /*
> > --- 81,87 ----
> > #define minor(d) MINOR(d)
> > #define kdev_same(a,b) ((a) == (b))
> > #define kdev_none(d) (!(d))
> > ! #define kdev_val(d) ((unsigned int)(d))
> > #define val_to_kdev(d) ((kdev_t(d))
> >
> > /*
>
> That's an odd-looking patch. Is this what you meant?
>
> Steven
>
> --- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 08:31:27 2002
> +++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:32:36 2002
> @@ -81,7 +81,7 @@
> #define minor(d) MINOR(d)
> #define kdev_same(a,b) ((a) == (b))
> #define kdev_none(d) (!(d))
> -#define kdev_val(d) ((unsigned int)(d)
> +#define kdev_val(d) ((unsigned int)(d))
> #define val_to_kdev(d) ((kdev_t(d))
>
> /*
>


Yes, do not use diff before drinking coffee in the morning.

Steve


2002-06-28 14:59:55

by Andries Brouwer

[permalink] [raw]
Subject: Re: [PATCH] compile fix for 2.5 kdev_t compatibility macros

On Fri, Jun 28, 2002 at 09:42:42AM -0500, Stephen Lord wrote:
> On Fri, 2002-06-28 at 09:37, Steven Cole wrote:
> > On Fri, 2002-06-28 at 07:50, Stephen Lord wrote:
> > >
> > >
> > > Marcelo,
> > >
> > > We started using these for XFS, and found a missing bracket, patch
> > > against 2.4.19-rc1.

> > --- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 08:31:27 2002
> > +++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:32:36 2002
> > @@ -81,7 +81,7 @@
> > #define minor(d) MINOR(d)
> > #define kdev_same(a,b) ((a) == (b))
> > #define kdev_none(d) (!(d))
> > -#define kdev_val(d) ((unsigned int)(d)
> > +#define kdev_val(d) ((unsigned int)(d))
> > #define val_to_kdev(d) ((kdev_t(d))
> >
> > /*

But what about the next line?

2002-06-28 15:07:56

by Martin Josefsson

[permalink] [raw]
Subject: Re: [PATCH] compile fix for 2.5 kdev_t compatibility macros

On Fri, 2002-06-28 at 16:37, Steven Cole wrote:

[snip]
> That's an odd-looking patch. Is this what you meant?
>
> Steven
>
> --- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 08:31:27 2002
> +++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 08:32:36 2002
> @@ -81,7 +81,7 @@
> #define minor(d) MINOR(d)
> #define kdev_same(a,b) ((a) == (b))
> #define kdev_none(d) (!(d))
> -#define kdev_val(d) ((unsigned int)(d)
> +#define kdev_val(d) ((unsigned int)(d))
> #define val_to_kdev(d) ((kdev_t(d))
>
> /*

And here's one more...

--- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 16:59:48 2002
+++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 17:01:12 2002
@@ -82,7 +82,7 @@
#define kdev_same(a,b) ((a) == (b))
#define kdev_none(d) (!(d))
#define kdev_val(d) ((unsigned int)(d))
-#define val_to_kdev(d) ((kdev_t(d))
+#define val_to_kdev(d) (kdev_t(d))

/*
As long as device numbers in the outside world have 16 bits only,

--
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.

2002-06-28 15:24:13

by Steven Cole

[permalink] [raw]
Subject: Re: [PATCH] compile fix for 2.5 kdev_t compatibility macros

On Fri, 2002-06-28 at 09:10, Martin Josefsson wrote:
[snip]
>
> And here's one more...
>
> --- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 16:59:48 2002
> +++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 17:01:12 2002
> @@ -82,7 +82,7 @@
> #define kdev_same(a,b) ((a) == (b))
> #define kdev_none(d) (!(d))
> #define kdev_val(d) ((unsigned int)(d))
> -#define val_to_kdev(d) ((kdev_t(d))
> +#define val_to_kdev(d) (kdev_t(d))
>
> /*
> As long as device numbers in the outside world have 16 bits only,
>
> --
> /Martin
>

Hmm. It looks like (d) should be cast to (kdev_t).
Here are both fixes (I hope).

Steven

--- linux-2.4.19-rc1/include/linux/kdev_t.h.orig Fri Jun 28 08:31:27 2002
+++ linux-2.4.19-rc1/include/linux/kdev_t.h Fri Jun 28 09:11:39 2002
@@ -81,8 +81,8 @@
#define minor(d) MINOR(d)
#define kdev_same(a,b) ((a) == (b))
#define kdev_none(d) (!(d))
-#define kdev_val(d) ((unsigned int)(d)
-#define val_to_kdev(d) ((kdev_t(d))
+#define kdev_val(d) ((unsigned int)(d))
+#define val_to_kdev(d) ((kdev_t)(d))

/*
As long as device numbers in the outside world have 16 bits only,