the prototype for container_of is as follows:
container_of(pointer,container_type,container_field)
so what exactly does this return?
considering an example,
ptr=container_of(inode->i_cdev,struct scull_dev,cdev)
here the pointer ‘inode->i_cdev’ has a field cdev.’cdev’ is CONTAINED IN struct scull_dev.
so ultimately,’container_of’ takes pointer ‘inode->i_cdev’ to struct scull_dev and returns a pointer containing struct scull_dev.
is it so????
kindly elaborate and add…….