|
@@ -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 ||
|