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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 19 Aug 2012 21:26:49 +0000
From:	Tabi Timur-B04825 <B04825@...escale.com>
To:	Francois Romieu <romieu@...zoreil.com>
CC:	Tabi Timur-B04825 <B04825@...escale.com>,
	Fleming Andy-AFLEMING <afleming@...escale.com>,
	David Miller <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] net/fsl: introduce Freescale 10G MDIO driver

Francois Romieu wrote:
>> >+	/* Wait till the bus is free */
>> >+	status = spin_event_timeout(
>> >+		!((in_be32(&regs->mdio_stat)) & MDIO_STAT_BSY), TIMEOUT, 0);
>> >+	if (!status) {
>> >+		dev_dbg(&bus->dev, "%s: timeout waiting for stat\n", __func__);
>> >+		return -ETIMEDOUT;
>> >+	}
> This code - comment included - is repeated several times. You may
> consider factoring it out in some xgmac_mdio_free_bus_wait function.

But it's just one line and a test.  The function would look like this:

bool xgmac_mdio_free_bus_wait(struct tgec_mdio_controller __iomem *regs)
{
	uint32_t status;

	status = spin_event_timeout(
		!((in_be32(&regs->mdio_stat)) & MDIO_STAT_BSY), TIMEOUT, 0);

	return status != 0;
}

and then

	if (!xgmac_mdio_free_bus_wait(regs)) {
		dev_dbg(&bus->dev, "%s: timeout waiting for stat\n", __func__);
		return -ETIMEDOUT;
	}

I don't see any real savings here.

-- 
Timur Tabi
Linux kernel developer at Freescale
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ