netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jan-Bernd Themann <ossthema@de.ibm.com>,
	netdev <netdev@vger.kernel.org>, Jeff Garzik <jeff@garzik.org>,
	Christoph Raisch <raisch@de.ibm.com>,
	Jan-Bernd Themann <themann@de.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-ppc <linuxppc-dev@ozlabs.org>,
	Marcus Eder <meder@de.ibm.com>, Thomas Klein <tklein@de.ibm.com>
Subject: Re: [2.6.19 PATCH 1/7] ehea: interface to network stack
Date: Mon, 4 Sep 2006 23:11:20 +0200	[thread overview]
Message-ID: <200609042311.21202.arnd@arndb.de> (raw)
In-Reply-To: <20060904201606.GA24386@electric-eye.fr.zoreil.com>

Am Monday 04 September 2006 22:16 schrieb Francois Romieu:
> > +#include "ehea.h"
> > +#include "ehea_qmr.h"
> > +#include "ehea_phyp.h"
>
> Afaik none of those is included in this patch nor in my 2.6.18-git tree.


They are in 5, 3 and 2, respectively

> Happy bissect in sight.

The driver should get merged as a single commit anyway, even
if split diffs are posted for review. Even if it gets merged
like this, bisect will work since the Kconfig option is added
in the final patch.

> > +
> > +static struct net_device_stats *ehea_get_stats(struct net_device *dev)
> > +{
> > +     struct ehea_port *port = netdev_priv(dev);
> > +     struct net_device_stats *stats = &port->stats;
> > +     struct hcp_ehea_port_cb2 *cb2;
> > +     u64 hret, rx_packets;
> > +     int i;
>
> unsigned int ?

does it matter? int as a counter is pretty standard.

> > +
> > +     if (netif_msg_hw(port))
> > +             ehea_dump(cb2, sizeof(*cb2), "net_device_stats");
> > +
> > +     rx_packets = 0;
>
> Could be initialized when it is declared.
>
> > +     for (i = 0; i < port->num_def_qps; i++)
> > +             rx_packets += port->port_res[i].rx_packets;

In one of the previous reviews, we told them to do it this way
instead. Initializing at declaration is error-prone.

> > +
> > +     intreq = ((pr->p_state.ehea_poll & 0xF) == 0xF);
>
> Arguable parenthesis.
>

I'd argue to keep them ;-)

> > +
> > +     hret = ehea_h_modify_ehea_port(port->adapter->handle,
> > +                                    port->logical_port_id,
> > +                                    H_PORT_CB0, mask, cb0);
> > +     if (hret != H_SUCCESS) {
> > +             ret = -EIO;
>
> Why can't ehea_xyz return -EIO/0 directly ?
>

the lowest-level hypercall should return H_* by convention.

Then again, it should also be called plpar_modify_ehea_port()
in that case.

> > +static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > +{
> > +     struct ehea_port *port = netdev_priv(dev);
> > +     struct ehea_port_res *pr;
> > +     struct ehea_swqe *swqe;
> > +     unsigned long flags;
> > +     u32 lkey;
> > +     int swqe_index;
> > +
> > +     pr = &port->port_res[0];
>
> Initialization and declaration can happen at the same time.

it's a gray area. In general, I recommend not to combine them
at all. Initialization to NULL or 0 is always bad, this one
is harmless, but I'd still leave it this way, especially after
telling them to clean this up earlier ;-)

	Arnd <><

  reply	other threads:[~2006-09-04 21:10 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 [this message]
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
  -- 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=200609042311.21202.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=meder@de.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=ossthema@de.ibm.com \
    --cc=raisch@de.ibm.com \
    --cc=romieu@fr.zoreil.com \
    --cc=themann@de.ibm.com \
    --cc=tklein@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).