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, 12 Mar 2015 02:31:44 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Mahesh Bandewar <maheshb@...gle.com>
Cc:	Jay Vosburgh <j.vosburgh@...il.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	Veaceslav Falico <vfalico@...il.com>,
	Nikolay Aleksandrov <nikolay@...hat.com>,
	David Miller <davem@...emloft.net>,
	Maciej Zenczykowski <maze@...gle.com>,
	netdev <netdev@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next 1/4] bonding: Handle notifications during
 work-queue processing gracefully

On Wed, 2015-03-11 at 22:54 -0700, Mahesh Bandewar wrote:

> +static inline void bond_set_notif_pending(struct bonding *bond,
> +					  bond_notif_pending_t bit, bool set)
> +{
> +	if (set)
> +		test_and_set_bit(bit, &bond->notif_work_mask);
> +	else
> +		test_and_clear_bit(bit, &bond->notif_work_mask);
> +}

If you do not need the return value of test_and_set_bit() and
test_and_clear_bit(), why are you using them, since they are more
expensive ?

May I suggest instead :


static inline void bond_notif_pending_set(struct bonding *bond,
                                          bond_notif_pending_t bit)
{
	set_bit(bit, &bond->notif_work_mask);
}

static inline void bond_notif_pending_clear(struct bonding *bond,
                                            bond_notif_pending_t bit)
{
	clear_bit(bit, &bond->notif_work_mask);
}



--
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