linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Bernd Themann <ossthema@de.ibm.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jan-Bernd Themann <themann@de.ibm.com>,
	netdev <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Thomas Klein <osstklei@de.ibm.com>,
	linux-ppc <linuxppc-dev@ozlabs.org>,
	Christoph Raisch <raisch@de.ibm.com>,
	Marcus Eder <meder@de.ibm.com>
Subject: Re: [2.6.19 PATCH 1/7] ehea: interface to network stack
Date: Wed, 6 Sep 2006 14:53:38 +0200	[thread overview]
Message-ID: <200609061453.38619.ossthema@de.ibm.com> (raw)
In-Reply-To: <20060905185832.GA15311@electric-eye.fr.zoreil.com>

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@de.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;
> }
> 

  reply	other threads:[~2006-09-06 13:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-04 10:37 [2.6.19 PATCH 1/7] ehea: interface to network stack Jan-Bernd Themann
2006-09-04 20:16 ` Francois Romieu
2006-09-04 21:11   ` Arnd Bergmann
2006-09-04 21:49     ` Francois Romieu
2006-09-06 15:22     ` Jeff Garzik
2006-09-05 15:09   ` Thomas Klein
2006-09-05 18:58     ` Francois Romieu
2006-09-06 12:53       ` Jan-Bernd Themann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-06 13:30 Jan-Bernd Themann
2006-08-23  8:56 Jan-Bernd Themann
2006-08-22 12:51 Jan-Bernd Themann
2006-08-18 11:29 Jan-Bernd Themann
2006-08-18 13:47 ` Alexey Dobriyan
2006-08-18 13:56   ` Arjan van de Ven
2006-08-18 14:44 ` Alexey Dobriyan
2006-08-21 12:23   ` Jan-Bernd Themann
2006-08-21 13:18     ` Jörn Engel
2006-08-21 14:52   ` Thomas Klein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609061453.38619.ossthema@de.ibm.com \
    --to=ossthema@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=meder@de.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=osstklei@de.ibm.com \
    --cc=raisch@de.ibm.com \
    --cc=romieu@fr.zoreil.com \
    --cc=themann@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).