]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pppox: convert pppox_sk() to use container_of()
authorQingfang Deng <qingfang.deng@linux.dev>
Fri, 10 Apr 2026 05:49:50 +0000 (13:49 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Apr 2026 22:20:46 +0000 (15:20 -0700)
Use container_of() macro instead of direct pointer casting to get the
pppox_sock from a sock pointer.

Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Link: https://patch.msgid.link/20260410054954.114031-2-qingfang.deng@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/if_pppox.h

index 636772693f9aa8f9c151f2e5b0ba2e14936d1165..594d6dc3f4c9e5824873b6ec0a0682a577c14281 100644 (file)
@@ -54,7 +54,7 @@ struct pppox_sock {
 
 static inline struct pppox_sock *pppox_sk(struct sock *sk)
 {
-       return (struct pppox_sock *)sk;
+       return container_of(sk, struct pppox_sock, sk);
 }
 
 struct module;