lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 15 Jan 2015 18:00:40 -0800
From:	Stephen Hemminger <stephen@...workplumber.org>
To:	Stephen Wang <wstephen@...eaurora.org>
Cc:	jcliburn@...il.com, grant.likely@...aro.org, robh+dt@...nel.org,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCH] ethernet: atheros: Add nss-gmac driver

On Thu,  8 Jan 2015 14:03:46 -0800
Stephen Wang <wstephen@...eaurora.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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists