Re: [PATCH 1/1] [usb/host]: use get/put_unaligned_* helpers to fixmore potential unaligned issues.

From: Jie Zhang
Date: Thu May 15 2008 - 05:16:07 EST


Oliver Neukum wrote:
Am Donnerstag 15 Mai 2008 10:03:35 schrieb Jie Zhang:
Oliver Neukum wrote:
Am Donnerstag 15 Mai 2008 08:19:24 schrieb Bryan Wu:
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -253,7 +253,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
switch (typeReq) {
case GetHubStatus:
- *(__le32 *)buf = cpu_to_le32(0);
+ put_unaligned_le32(0, buf);
What is supposed to make all these changes a good idea?

Since buf might not be 4-byte aligned.

It is. Please analyze the code before you use these access methods.

You are right. buf has been 4-byte aligned since 2.6.19. My patch was written two years ago. Sorry for the noise I caused.


Jie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/