[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200609061453.38619.ossthema@de.ibm.com>
Date: Wed, 6 Sep 2006 14:53:38 +0200
From: Jan-Bernd Themann <ossthema@...ibm.com>
To: Francois Romieu <romieu@...zoreil.com>
Cc: Thomas Klein <osstklei@...ibm.com>,
netdev <netdev@...r.kernel.org>,
Christoph Raisch <raisch@...ibm.com>,
Jan-Bernd Themann <themann@...ibm.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-ppc <linuxppc-dev@...abs.org>,
Marcus Eder <meder@...ibm.com>
Subject: Re: [2.6.19 PATCH 1/7] ehea: interface to network stack
Hi,
ok, I admit this solution looks a bit nicer. We changed it in a similar way.
Jan-Bernd
On Tuesday 05 September 2006 20:58, Francois Romieu wrote:
> Thomas Klein <osstklei@...ibm.com> :
> [...]
> > Somehow I don't get your point concerning the usage of 'k'. We need another
> > iterator as the for loops using 'k' use 'i' as their terminating condition.
>
> Something like the code below perhaps (with more local variables maybe):
>
> static int ehea_reg_interrupts(struct net_device *dev)
> {
> struct ehea_port *port = netdev_priv(dev);
> struct ehea_port_res *pr;
> int i, ret;
>
> for (i = 0; i < port->num_def_qps; i++) {
> pr = &port->port_res[i];
> snprintf(pr->int_recv_name, EHEA_IRQ_NAME_SIZE - 1
> , "%s-recv%d", dev->name, i);
> ret = ibmebus_request_irq(NULL, pr->recv_eq->attr.ist1,
> ehea_recv_irq_handler, SA_INTERRUPT,
> pr->int_recv_name, pr);
> if (ret) {
> ehea_error("failed registering irq for ehea_recv_int:"
> "port_res_nr:%d, ist=%X", i,
> pr->recv_eq->attr.ist1);
> goto err_free_irq_recv_eq_0;
> }
> if (netif_msg_ifup(port))
> ehea_info("irq_handle 0x%X for funct ehea_recv_int %d "
> "registered", pr->recv_eq->attr.ist1, i);
> }
>
> snprintf(port->int_aff_name, EHEA_IRQ_NAME_SIZE - 1,
> "%s-aff", dev->name);
> ret = ibmebus_request_irq(NULL, port->qp_eq->attr.ist1,
> ehea_qp_aff_irq_handler,
> SA_INTERRUPT, port->int_aff_name, port);
> if (ret) {
> ehea_error("failed registering irq for qp_aff_irq_handler:"
> " ist=%X", port->qp_eq->attr.ist1);
> goto err_free_irq_recv_eq_0;
> }
> if (netif_msg_ifup(port))
> ehea_info("irq_handle 0x%X for function qp_aff_irq_handler "
> "registered", port->qp_eq->attr.ist1);
>
> for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
> pr = &port->port_res[i];
> snprintf(pr->int_send_name, EHEA_IRQ_NAME_SIZE - 1,
> "%s-send%d", dev->name, i);
> ret = ibmebus_request_irq(NULL, pr->send_eq->attr.ist1,
> ehea_send_irq_handler, SA_INTERRUPT,
> pr->int_send_name, pr);
> if (ret) {
> ehea_error("failed registering irq for ehea_send"
> " port_res_nr:%d, ist=%X", i,
> pr->send_eq->attr.ist1);
> goto err_free_irq_send_eq_1;
> }
> if (netif_msg_ifup(port))
> ehea_info("irq_handle 0x%X for function ehea_send_int "
> "%d registered", pr->send_eq->attr.ist1, i);
> }
> out:
> return ret;
>
> err_free_irq_send_eq_1:
> // Post-dec works with unsigned int too.
> while (i-- > 0) {
> u32 ist = port->port_res[i].send_eq->attr.ist1;
> ibmebus_free_irq(NULL, ist, &port->port_res[i]);
> }
> ibmebus_free_irq(NULL, port->qp_eq->attr.ist1, port);
> i = port->num_def_qps;
> err_free_irq_recv_eq_0:
> while (i-- > 0) {
> u32 ist = port->port_res[i].recv_eq->attr.ist1;
> ibmebus_free_irq(NULL, ist, &port->port_res[k]);
> }
> goto out;
> }
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists