All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Veaceslav Falico <vfalico@gmail.com>
Cc: netdev@vger.kernel.org, Andy Gospodarek <andy@greyhouse.net>
Subject: Re: [PATCH v2 net-next 5/9] bonding: create a macro for bond mode and use it
Date: Thu, 15 May 2014 11:32:41 -0700	[thread overview]
Message-ID: <10534.1400178761@localhost.localdomain> (raw)
In-Reply-To: <20140515181436.GA25181@mikrodark.usersys.redhat.com>

Veaceslav Falico <vfalico@gmail.com> wrote:

>On Thu, May 15, 2014 at 10:51:51AM -0700, Jay Vosburgh wrote:
>>Veaceslav Falico <vfalico@gmail.com> wrote:
>>
>>>CC: Jay Vosburgh <j.vosburgh@gmail.com>
>>>CC: Andy Gospodarek <andy@greyhouse.net>
>>>Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
>>>---
>...snip...
>>	Would it be better to use "bond_uses_primary(struct bonding *)"
>>instead of the above?  That would simplify the above calling pattern,
>>and shorten the calls elsewhere.  Maybe I missed one, but it looks like
>>all of the calls to _uses_primary have BOND_MODE(bond) as the argument.
>
>There's at least one call, when checking the params, where it checks the
>int:
>
>bond_main.c:
>4271         if (primary && !bond_mode_uses_primary(bond_mode)) {
>
>so, either we'll use something else here, or leave it with BOND_MODE()...

	The something else isn't so bad, and would look better for most
callers:

static inline bool bond_uses_primary(struct bonding *bond)
{
	return bond_mode_uses_primary(bond->params.mode);
}

	This ends up replacing "USES_PRIMARY(bond->params.mode)" with
"bond_uses_primary(bond)" for most call sites, which actually looks like
an improvement (it's even shorter).

	-J

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

  reply	other threads:[~2014-05-15 18:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 12:29 [PATCH v2 net-next 0/9] bonding: simple macro cleanup Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 1/9] bonding: remove BOND_MODE_IS_LB macro Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 2/9] bonding: make TX_QUEUE_OVERRIDE() macro an inline function Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 3/9] bonding: make BOND_NO_USES_ARP " Veaceslav Falico
2014-05-15 15:35   ` Alexei Starovoitov
2014-05-15 15:45     ` Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 4/9] bonding: make USES_PRIMARY " Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 5/9] bonding: create a macro for bond mode and use it Veaceslav Falico
2014-05-15 17:51   ` Jay Vosburgh
2014-05-15 18:14     ` Veaceslav Falico
2014-05-15 18:32       ` Jay Vosburgh [this message]
2014-05-15 19:18         ` Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 6/9] bonding: make IS_IP_TARGET_UNUSABLE_ADDRESS an inline function Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 7/9] bonding: convert IS_UP(slave->dev) to " Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 8/9] bonding: rename {,bond_}slave_can_tx and clean it up Veaceslav Falico
2014-05-15 12:29 ` [PATCH v2 net-next 9/9] bonding: replace SLAVE_IS_OK() with bond_slave_can_tx() Veaceslav Falico

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=10534.1400178761@localhost.localdomain \
    --to=jay.vosburgh@canonical.com \
    --cc=andy@greyhouse.net \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.