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

[microblaze-uclinux] patch for unaligned.h (warning: left shift count >= width of type)




    The following patch has been applied to CVS to fix a problem noticed 
in smbfs where a 64 bit value was
    being truncated to 32 bits. You will know if this problem exists by 
the following compiler warning being
    displayed during the building of the kernel.

warning: left shift count >= width of type

    This problem seems to show up mainly in the file systems (fat, 
smbfs, msdos partitions etc).

--- uClinux-2.4.x/include/asm-microblaze/unaligned.h	2003/05/26 00:31:39	1.2
+++ uClinux-2.4.x/include/asm-microblaze/unaligned.h	2004/08/14 00:17:53	1.3
@@ -72,7 +72,7 @@ extern int __bug_unaligned_x(void *ptr);
 				unsigned int __v1, __v2;	\
 				__v2 = __get_unaligned_4((__p+4)); \
 				__v1 = __get_unaligned_4(__p);	\
-				__v = ((unsigned long long)__v2 | __v1 << 32);	\
+				__v = ((unsigned long long)__v2 | (unsigned long long)__v1 << 32);	\
 			}					\
 			break;					\
 		default: __v = __bug_unaligned_x(__p);	break;	\




-- 

=====================================================================
 / /\/  Craig Hackney		
 \ \    Xilinx Inc.		   Tel: +1 (408) 626-6292
 / /    2100 Logic Drive,	mailto:craig.hackney@xilinx.com
 \_\/\  San Jose, CA 95124	  http://www.xilinx.com
=====================================================================


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/