Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6f061487f7d31427d7e8f420f366e5537ae16f43
Commit:     6f061487f7d31427d7e8f420f366e5537ae16f43
Parent:     7ada60e367640fa8a4a349d9b105f235f346238b
Author:     Jay Fenlason <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 27 16:04:33 2007 -0400
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 00:07:46 2007 +0200

    firewire: fw-sbp2: correctly dereference by container_of
    
    Replace a cast with a container_of().  As long as nobody reorders the
    structure elements, they do the same thing, but container_of() is more
    readable.
    
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]> (added 
complete_command_orb)
    Acked-by: Kristian Høgsberg <[EMAIL PROTECTED]>
---
 drivers/firewire/fw-sbp2.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 2c39f19..1fc1af7 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -395,7 +395,7 @@ static void
 complete_management_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
 {
        struct sbp2_management_orb *orb =
-           (struct sbp2_management_orb *)base_orb;
+               container_of(base_orb, struct sbp2_management_orb, base);
 
        if (status)
                memcpy(&orb->status, status, sizeof(*status));
@@ -838,7 +838,8 @@ sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
 static void
 complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
 {
-       struct sbp2_command_orb *orb = (struct sbp2_command_orb *)base_orb;
+       struct sbp2_command_orb *orb =
+               container_of(base_orb, struct sbp2_command_orb, base);
        struct fw_unit *unit = orb->unit;
        struct fw_device *device = fw_device(unit->device.parent);
        struct scatterlist *sg;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to