Skip to content

Commit

Permalink
[POWERPC] Don't cast a struct pointer to list_head pointer
Browse files Browse the repository at this point in the history
The casting is safe only when the list_head member is the first member
of the structure, and even then it is better to use the address of the
list_head structure member.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Li Zefan authored and Paul Mackerras committed Dec 20, 2007
1 parent 9ac71d0 commit 6c6199c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/ppc/syslib/ocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ ocp_remove_one_device(unsigned int vendor, unsigned int function, int index)

down_write(&ocp_devices_sem);
dev = __ocp_find_device(vendor, function, index);
list_del((struct list_head *)dev);
list_del(&dev->link);
up_write(&ocp_devices_sem);

DBG(("ocp: ocp_remove_one_device(vendor: %x, function: %x, index: %d)... done.\n", vendor, function, index));
Expand Down

0 comments on commit 6c6199c

Please sign in to comment.