lkml.org 
[lkml]   [2007]   [Jan]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 4 Jan 2007 09:42:24 +0100
SubjectRe: [PATCH] Simplify some code to use the container_of() macro.
FromThomas Hisch <>
On Sun, Dec 31, 2006 at 03:55:22PM -0500, Robert P. J. Day wrote:
> @@ -1810,8 +1809,7 @@ lcs_get_frames_cb(struct lcs_channel *channel, struct lcs_buffer *buffer)
>  		LCS_DBF_TEXT(4, trace, "-eiogpkt");
>  		return;
>  	}
> -	card = (struct lcs_card *)
> -		((char *) channel - offsetof(struct lcs_card, read));
> +	card = container_of(channel, struct lcs_card, write);
the last argument in container_of should be read instead of write.

>  	offset = 0;
>  	while (lcs_hdr->offset != 0) {

-- 
Thomas Hisch
e0625874@stud.tuwien.ac.at
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-04 09:45    [from the cache]
©2003-2008