From: Jan Glauber Date: Mon, 17 May 2010 08:00:16 +0000 (+0200) Subject: [S390] qdio: remove memset hack X-Git-Tag: v2.6.35-rc1~505^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5382fe11d90e3ed9602ce655e523852e3dbf3e35;p=platform%2Fkernel%2Flinux-3.10.git [S390] qdio: remove memset hack Remove memset hack that relied on the layout of struct qdio_q to avoid deletion of the slib pointer. Signed-off-by: Jan Glauber Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h index 48aa064..da80e9b 100644 --- a/drivers/s390/cio/qdio.h +++ b/drivers/s390/cio/qdio.h @@ -296,10 +296,8 @@ struct qdio_q { struct qdio_irq *irq_ptr; struct sl *sl; /* - * Warning: Leave this member at the end so it won't be cleared in - * qdio_fill_qs. A page is allocated under this pointer and used for - * slib and sl. slib is 2048 bytes big and sl points to offset - * PAGE_SIZE / 2. + * A page is allocated under this pointer and used for slib and sl. + * slib is 2048 bytes big and sl points to offset PAGE_SIZE / 2. */ struct slib *slib; } __attribute__ ((aligned(256))); diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c index 7f4a754..6326b67 100644 --- a/drivers/s390/cio/qdio_setup.c +++ b/drivers/s390/cio/qdio_setup.c @@ -106,10 +106,12 @@ int qdio_allocate_qs(struct qdio_irq *irq_ptr, int nr_input_qs, int nr_output_qs static void setup_queues_misc(struct qdio_q *q, struct qdio_irq *irq_ptr, qdio_handler_t *handler, int i) { - /* must be cleared by every qdio_establish */ - memset(q, 0, ((char *)&q->slib) - ((char *)q)); - memset(q->slib, 0, PAGE_SIZE); + struct slib *slib = q->slib; + /* queue must be cleared for qdio_establish */ + memset(q, 0, sizeof(*q)); + memset(slib, 0, PAGE_SIZE); + q->slib = slib; q->irq_ptr = irq_ptr; q->mask = 1 << (31 - i); q->nr = i;