devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
To: Stephen Wang <wstephen-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: jcliburn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ethernet: atheros: Add nss-gmac driver
Date: Thu, 15 Jan 2015 18:00:40 -0800	[thread overview]
Message-ID: <20150115180040.180fdbb9@urahara> (raw)
In-Reply-To: <1420754626-30121-1-git-send-email-wstephen-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Thu,  8 Jan 2015 14:03:46 -0800
Stephen Wang <wstephen-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:

> +static int32_t nss_gmac_setup_tx_desc_queue(struct nss_gmac_dev *gmacdev,
> +						struct device *dev,
> +						uint32_t no_of_desc,
> +						uint32_t desc_mode)
> +{
> +	int32_t i;
> +	struct dma_desc *first_desc = NULL;
> +	dma_addr_t dma_addr;
> +
> +	gmacdev->tx_desc_count = 0;
> +
> +	BUG_ON(desc_mode != RINGMODE);
> +	BUG_ON((no_of_desc & (no_of_desc - 1)) != 0);
> +
> +	netdev_dbg(gmacdev->netdev, "Total size of memory required for Tx Descriptors in Ring Mode = 0x%08x"
> +			, (uint32_t) ((sizeof(struct dma_desc) * no_of_desc)));
> +
> +	first_desc = dma_alloc_coherent(dev, sizeof(struct dma_desc) * no_of_desc
> +					, &dma_addr, GFP_KERNEL);
> +	if (first_desc == NULL) {

In a lot of places you first initialize a variable then assign it 5 lines
later to it's initial value.  Get rid of the first initialization.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-01-16  2:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 22:03 [PATCH] ethernet: atheros: Add nss-gmac driver Stephen Wang
2015-01-08 23:35 ` Arnd Bergmann
2015-01-15  8:12   ` wstephen-sgV2jX0FEOL9JmXXK+q4OQ
2015-01-15 12:34     ` Arnd Bergmann
2015-01-19 21:58       ` wstephen-sgV2jX0FEOL9JmXXK+q4OQ
2015-01-20 14:05         ` Arnd Bergmann
2015-01-22  0:20           ` wstephen-sgV2jX0FEOL9JmXXK+q4OQ
     [not found]             ` <f9cbb34c9228b2af7ed6c1c96a6aa61c.squirrel-mMfbam+mt9083fI46fginR2eb7JE58TQ@public.gmane.org>
2015-01-22 10:18               ` Arnd Bergmann
2015-01-23  8:54                 ` David Miller
     [not found] ` <1420754626-30121-1-git-send-email-wstephen-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-01-08 22:18   ` Joe Perches
2015-01-09  0:00   ` Francois Romieu
2015-01-09 13:50   ` Mark Rutland
2015-01-16  2:00   ` Stephen Hemminger [this message]
2015-01-16  1:56 ` Stephen Hemminger
2015-01-16  1:58 ` Stephen Hemminger

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=20150115180040.180fdbb9@urahara \
    --to=stephen-otpzqlsittunbdjkjebofr2eb7je58tq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=jcliburn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=wstephen-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    /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).