From b385a144ee790f00e8559bcb8024d042863f9be1 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Sat, 10 Feb 2007 01:46:25 -0800 Subject: [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 Acked-by: Paul Mackerras Cc: "David S. Miller" Cc: Martin Schwidefsky Cc: Stephen Smalley Cc: James Morris Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/net/ppp_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/ppp_generic.c') diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index c6de566188e..0986f6c843e 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -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) -- cgit v1.2.3