[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 2/5] Cast to 'int'



On 04/19/2011 02:55 PM, Zdenek Kabelac wrote:

>  #ifdef linux
> -#  define MAJOR(dev)	((dev & 0xfff00) >> 8)
> +#  define MAJOR(dev)	((int)(dev & 0xfff00) >> 8)
>  #  define MINOR(dev)	((dev & 0xff) | ((dev >> 12) & 0xfff00))
>  #  define MKDEV(ma,mi)	((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
>  #else

I we really want to play this cast games (seems I was infected too:-),
please fix all defines to use (int) - like MAJOR() so it is consistent
despite there is no current gcc warning.

Milan
p.s.
or use gnu_dev_major()/minor, it is reliable these days.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]