'\" t .\" Title: container_of .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "CONTAINER_OF" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" container_of \- cast a member of a structure out to the containing structure .SH "SYNOPSIS" .HP \w'container_of('u .BI "container_of(" "ptr" ", " "type" ", " "member" ");" .SH "ARGUMENTS" .PP \fIptr\fR .RS 4 the pointer to the member\&. .RE .PP \fItype\fR .RS 4 the type of the container struct this is embedded in\&. .RE .PP \fImember\fR .RS 4 the name of the member within the struct\&. .RE .SH "COPYRIGHT" .br