[PATCH] Replace regular code with appropriate calls to container_of()
Replace a small number of expressions with a call to the "container_of()" macro. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Acked-by: Paul Mackerras <paulus@samba.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
521dae191e
commit
b385a144ee
@@ -83,7 +83,7 @@ struct ppp_file {
|
||||
int dead; /* unit/channel has been shut down */
|
||||
};
|
||||
|
||||
#define PF_TO_X(pf, X) ((X *)((char *)(pf) - offsetof(X, file)))
|
||||
#define PF_TO_X(pf, X) container_of(pf, X, file)
|
||||
|
||||
#define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp)
|
||||
#define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel)
|
||||
|
Reference in New Issue
Block a user