diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-05-23 10:24:42 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-05-23 10:24:31 +0200 |
commit | 30c2df51173ea4e4755ad52be7f2914f01e32404 (patch) | |
tree | ee228c2f42902b484fb1d58f36cc955a1d0edcd6 /drivers/s390/char/sclp.h | |
parent | fca894edd7566f5c548598c8fad7f329278c23b4 (diff) |
[S390] sclp: event buffer dissection
Move gds vector/subvector find functions to the sclp header file.
Simplify event buffer dissection in sclp tty code.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/sclp.h')
-rw-r--r-- | drivers/s390/char/sclp.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h index 6bb5a6bdfab..bc23b05bfe7 100644 --- a/drivers/s390/char/sclp.h +++ b/drivers/s390/char/sclp.h @@ -186,4 +186,26 @@ sclp_ascebc_str(unsigned char *str, int nr) (MACHINE_IS_VM) ? ASCEBC(str, nr) : ASCEBC_500(str, nr); } +static inline struct gds_vector * +sclp_find_gds_vector(void *start, void *end, u16 id) +{ + struct gds_vector *v; + + for (v = start; (void *) v < end; v = (void *) v + v->length) + if (v->gds_id == id) + return v; + return NULL; +} + +static inline struct gds_subvector * +sclp_find_gds_subvector(void *start, void *end, u8 key) +{ + struct gds_subvector *sv; + + for (sv = start; (void *) sv < end; sv = (void *) sv + sv->length) + if (sv->key == key) + return sv; + return NULL; +} + #endif /* __SCLP_H__ */ |