diff options
author | Noe Rubinstein <nrubinstein@proformatique.com> | 2010-12-21 16:17:39 +0100 |
---|---|---|
committer | Noe Rubinstein <nrubinstein@proformatique.com> | 2010-12-21 16:17:39 +0100 |
commit | 43de3f330c3407d799dad28effd6f4d8f5a80aad (patch) | |
tree | f8cafc3be8bd21471644e886d198a809fae51eb6 /xivovp/base.c | |
parent | 0d609959e683a9f872f5a9c8a26872e7ce2beb45 (diff) |
change xivovp_line_from_ctx to a single container_of call
Diffstat (limited to 'xivovp/base.c')
-rw-r--r-- | xivovp/base.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/xivovp/base.c b/xivovp/base.c index 7095e21..fedd38d 100644 --- a/xivovp/base.c +++ b/xivovp/base.c @@ -110,23 +110,10 @@ static void xivovp_receive_and_transmit(void *data) } #endif -/* Shouldn't there be something better there? TOTHINK */ +/* Returns the xivovp_line which line is the same as the VpLineCtxType */ static struct xivovp_line* xivovp_line_from_ctx(VpLineCtxType* line_ctx) { - Vp890LineObjectType* line_obj; - int i; - - if (!line_ctx) - panic(DRV_NAME ": LineCtx == NULL\n"); - - line_obj = line_ctx->pLineObj; - - for (i = 0; i < NB_LINES; i++) - if (&xivovp.line[i].line_obj == line_obj) - return &xivovp.line[i]; - - panic(DRV_NAME ": unknown FX line, this shouldn't happen\n"); - return NULL; + return container_of(line_ctx->pLineObj, struct xivovp_line, line_obj); } static void vp_set_debug_select_running(void) |