devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Byungho An <bh74.an@samsung.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org, davem@davemloft.net,
	siva.kallam@samsung.com, vipul.pandya@samsung.com,
	ks.giri@samsung.com, ilho215.lee@samsung.com
Subject: Re: [PATCH 1/7] net: xgmac: add basic framework for Samsung 10Gb ethernet driver
Date: Wed, 05 Mar 2014 08:11:58 -0800	[thread overview]
Message-ID: <1394035918.3271.67.camel@joe-AO722> (raw)
In-Reply-To: <007b01cf3866$009f1900$01dd4b00$%an@samsung.com>

On Wed, 2014-03-05 at 20:28 +0900, Byungho An wrote:
> From: Siva Reddy <siva.kallam@samsung.com>

Just a few trivial comments on a brief scan.

> +/* Context descriptor structure */
> +struct xgmac_tx_ctxt_desc {
> +	u32 tstamp_lo:32;
> +	u32 tstamp_hi:32;

I think u32 foo:32; is odd at best
and may cause compiler oddities.

> diff --git a/drivers/net/ethernet/samsung/xgmac_main.c b/drivers/net/ethernet/samsung/xgmac_main.c
[]
> +static void print_pkt(unsigned char *buf, int len)
> +{
> +	int j;
> +	pr_debug("len = %d byte, buf addr: 0x%p", len, buf);
> +	for (j = 0; j < len; j++) {
> +		if ((j % 16) == 0)
> +			pr_debug("\n %03x:", j);
> +		pr_debug(" %02x", buf[j]);
> +	}
> +	pr_debug("\n");
> +}

This will make a mess.  Use print_hex_dump_debug.

> +static int xgmac_open(struct net_device *dev)
> +{
[]
> 	if (ret) {
> +		pr_err("%s: Cannot attach to PHY (error: %d)\n",
> +				__func__, ret);

A lot of the message logging would be better using
more verbose forms like;

	netdev_<level>(dev, etc...)

[]

> +/* xgmac_config - entry point for changing configuration mode passed on by
> + * ifconfig
> + * @dev : pointer to the device structure
> + * @map : pointer to the device mapping structure
> + * Description:
> + * This function is a driver entry point which gets called by the kernel
> + * whenever some device configuration is changed.
> + * Return value:
> + * This function returns 0 if success and appropriate error otherwise.
> + */

It might be nicer if you used kernel-doc forms startig with
/**
for these comments everywhere.

      reply	other threads:[~2014-03-05 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 11:28 [PATCH 1/7] net: xgmac: add basic framework for Samsung 10Gb ethernet driver Byungho An
2014-03-05 16:11 ` Joe Perches [this message]

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=1394035918.3271.67.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=bh74.an@samsung.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=ilho215.lee@samsung.com \
    --cc=ks.giri@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=siva.kallam@samsung.com \
    --cc=vipul.pandya@samsung.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).