From: Sam Ravnborg <sam@ravnborg.org>
To: John Rigby <jrigby@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>,
linuxppc-dev@ozlabs.org, jeff@garzik.org, netdev@vger.kernel.org
Subject: Re: [PATCH] [Rev2] MPC5121 FEC support
Date: Tue, 17 Jun 2008 21:22:37 +0200 [thread overview]
Message-ID: <20080617192237.GA12961@uranus.ravnborg.org> (raw)
In-Reply-To: <1213729717-26688-1-git-send-email-jrigby@freescale.com>
Hi John - a few nitpicks.
>
> +config FS_ENET_MPC5121_FEC
> + bool "Freescale MPC512x FEC driver"
> + depends on PPC_MPC512x
> + select FS_ENET
> + select PPC_CPM_NEW_BINDING
> + default y
help is missing. I assume you can help the casual reader a bit by being
a bit more verbose. Especially so some random MPC user knows this is not for him.
> +/*
> + * The 5121 FEC doc says transmit buffers must have 4 byte alignment.
> + * We get alignement from the device tree in case this changes on future
> + * platforms.
> + */
> +static struct sk_buff *align_tx_skb(struct net_device *dev, struct sk_buff *skb,
> + int align)
> +{
> + struct sk_buff *skbn;
> +
> + if ((((unsigned long)skb->data) & (align-1)) == 0)
> + return skb;
Use one of the available ALIGN macros?
Spaces arounf operators please.
> +
> + skbn = dev_alloc_skb(ENET_RX_FRSIZE+align);
spaces around operatiors please.
> + if (!skbn) {
> + printk(KERN_WARNING DRV_MODULE_NAME
> + ": %s Memory squeeze, dropping tx packet.\n",
> + dev->name);
> + dev_kfree_skb_any(skb);
> + return NULL;
Consider using goto for error handling like we do in many
other places.
> + data = of_get_property(ofdev->node, "fsl,align-tx-packets", &len);
> + if (data && len == 4)
> + fpi->align_tx_packets = *data;
> +
Where did "4" come from. USe a define with a desriptive name.
> fpi->rx_ring = 32;
> fpi->tx_ring = 32;
Same for "32"
> fpi->rx_copybreak = 240;
Same for "240".
> --- a/drivers/net/fs_enet/fs_enet.h
> +++ b/drivers/net/fs_enet/fs_enet.h
> @@ -10,12 +10,17 @@
>
> #include <linux/fs_enet_pd.h>
> #include <asm/fs_pd.h>
> +#ifdef CONFIG_FS_ENET_MPC5121_FEC
> +#include "fec_mpc5121.h"
> +#endif
Which is this include ifdeffed - looks like some wrong concept.
>
> #ifdef CONFIG_CPM1
> #include <asm/cpm1.h>
> +#endif
>
> +#if defined(CONFIG_FS_ENET_HAS_FEC)
> struct fec_info {
> - fec_t __iomem *fecp;
> + struct fec __iomem *fecp;
> u32 mii_speed;
I we have a conversion from fec_t to struct fec
then this is a separate patch in the normal case.
> diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
> index 8a311d1..a48a550 100644
> --- a/drivers/net/fs_enet/mac-fec.c
> +++ b/drivers/net/fs_enet/mac-fec.c
> @@ -42,6 +42,9 @@
> #include <asm/mpc8xx.h>
> #include <asm/cpm1.h>
> #endif
> +#ifdef CONFIG_FS_ENET_MPC5121_FEC
> +#include "fec_mpc5121.h"
> +#endif
The ifdeffed include shows up again...
> -static int whack_reset(fec_t __iomem *fecp)
> +static int whack_reset(struct fec __iomem *fecp)
And so does fec_t => struct fec...
> {
And so does fec_t => struct fec...
> static void set_promiscuous_mode(struct net_device *dev)
> {
> struct fs_enet_private *fep = netdev_priv(dev);
> - fec_t __iomem *fecp = fep->fec.fecp;
> + struct fec __iomem *fecp = fep->fec.fecp;
Again.. (will drop mention it for now. But this is truly
a unrelated change.
The amount of ifdef introduced looks bad..
And try to run the patch through scripts/checkpatch.pl
And try to split it up a bit.
Sam
next prev parent reply other threads:[~2008-06-17 19:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-17 19:08 [PATCH] [Rev2] MPC5121 FEC support John Rigby
2008-06-17 19:22 ` Sam Ravnborg [this message]
2008-06-17 19:31 ` Scott Wood
2008-06-17 19:46 ` Sam Ravnborg
2008-06-17 19:43 ` John Rigby
2008-06-17 19:57 ` Sam Ravnborg
2008-06-17 19:33 ` Scott Wood
2008-06-17 19:57 ` Sam Ravnborg
2008-06-17 20:03 ` Scott Wood
2008-06-17 21:00 ` Sam Ravnborg
2008-06-17 21:12 ` Scott Wood
2008-06-17 23:52 ` Trent Piepho
2008-06-18 5:00 ` Sam Ravnborg
2008-06-18 15:43 ` Scott Wood
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=20080617192237.GA12961@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=jeff@garzik.org \
--cc=jrigby@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=scottwood@freescale.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).