Re: Bug#572512: module-init-tools: depmod unaligned trap on alpha

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

 



diff --git a/util.c b/util.c
index 59db9cb..e03f6cd 100644
--- a/util.c
+++ b/util.c
@@ -199,10 +199,8 @@ const char *next_string(const char *string,
unsigned long *secsize)
  */
 int __attribute__ ((pure)) native_endianness()
 {
-	/* Encoding the endianness enums in a string and then reading that
-	 * string as a 32-bit int, returns the correct endianness automagically.
-	 */
-	return (char) *((uint32_t*)("\1\0\0\2"));
+	uint32_t enums = 0x02000001;
+	return *((uint8_t*)&enums);
 }

 /*
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux