[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 <rpjday@mindspring.com> Acked-by: Paul Mackerras <paulus@samba.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
521dae191e
commit
b385a144ee
@@ -1511,8 +1511,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer)
|
||||
LCS_DBF_TEXT(5, trace, "txbuffcb");
|
||||
/* Put buffer back to pool. */
|
||||
lcs_release_buffer(channel, buffer);
|
||||
card = (struct lcs_card *)
|
||||
((char *) channel - offsetof(struct lcs_card, write));
|
||||
card = container_of(channel, struct lcs_card, write);
|
||||
if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev))
|
||||
netif_wake_queue(card->dev);
|
||||
spin_lock(&card->lock);
|
||||
@@ -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, read);
|
||||
offset = 0;
|
||||
while (lcs_hdr->offset != 0) {
|
||||
if (lcs_hdr->offset <= 0 ||
|
||||
|
Reference in New Issue
Block a user