lkml.org 
[lkml]   [2000]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ADFS -> undefined reference to __cmpdi2 (2.3.51)
Arjan van de Ven wrote:
> --- linux/fs/adfs/dir.c.org Sat Mar 11 10:49:54 2000
> +++ linux/fs/adfs/dir.c Sat Mar 11 16:16:26 2000
> @@ -38,8 +38,11 @@
> ret = ops->read(sb, inode->i_ino, inode->i_size, &dir);
> if (ret)
> goto out;
> +
> + if ((filp->f_pos>>32)!=0)
> + BUG();
>
> - switch (filp->f_pos) {
> + switch ((unsigned int)filp->f_pos) {

Don't code in unneccesary dependance that (sizeof int)==32.

if ((filp->f_pos >> BITS_PER_LONG) != 0)
return 0;
switch ((unsigned long) filp->f_pos) {
The only problem is that you'll now get a compiler warning if sizeof(unsigned
long)==sizeof(unsigned long long)... for instance, alpha You can avoid
this with:

#if (-1ULL >> BITS_PER_LONG) != 0
if ((filp->f_pos >> BITS_PER_LONG) != 0)
return 0;
#endif
switch ((unsigned long) filp->f_pos) {
Another posibility is to keep the ">> 32" there and just cast to a "u32"
type.

-Mitch

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans