netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Zoltan Kiss <zoltan.kiss@citrix.com>,
	Jay Vosburgh <fubar@us.ibm.com>,
	Veaceslav Falico <vfalico@redhat.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nikolay Aleksandrov <nikolay@redhat.com>
Subject: Re: [PATCH net-next] bonding: Use do_div to divide 64 bit numbers
Date: Fri, 24 Jan 2014 02:25:28 +0400	[thread overview]
Message-ID: <52E196D8.5060103@cogentembedded.com> (raw)
In-Reply-To: <1390502838-21581-1-git-send-email-zoltan.kiss@citrix.com>

Hello.

On 23-01-2014 22:47, Zoltan Kiss wrote:

> Nikolay Aleksandrov's recent bonding option API changes (25a9b54a and e4994612)

    You should also specify those commits' summary lines.

> introduced u64 as the type of downdelay and updelay. On 32 bit the division and
> modulo operations cause compile errors:

> ERROR: "__udivdi3" [drivers/net/bonding/bonding.ko] undefined!
> ERROR: "__umoddi3" [drivers/net/bonding/bonding.ko] undefined!

> This patch use the do_div macro, which guaranteed to do the right thing.

> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> ---
>   drivers/net/bonding/bond_options.c |   19 +++++++++++--------
>   1 file changed, 11 insertions(+), 8 deletions(-)

> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index 4cee04a..4f94907 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
[...]
> @@ -727,19 +728,20 @@ int bond_option_miimon_set(struct bonding *bond, struct bond_opt_value *newval)
>
>   int bond_option_updelay_set(struct bonding *bond, struct bond_opt_value *newval)
>   {
> +	u64 quotient = newval->value;
> +	u64 remainder = do_div(quotient, bond->params.miimon);

    Empty line after declarations wouldn't hurt here.

> @@ -750,19 +752,20 @@ int bond_option_updelay_set(struct bonding *bond, struct bond_opt_value *newval)
>   int bond_option_downdelay_set(struct bonding *bond,
>   			      struct bond_opt_value *newval)
>   {
> +	u64 quotient = newval->value;
> +	u64 remainder = do_div(quotient, bond->params.miimon);

    And here.

WBR, Sergei

      parent reply	other threads:[~2014-01-23 22:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 18:47 [PATCH net-next] bonding: Use do_div to divide 64 bit numbers Zoltan Kiss
2014-01-23 20:44 ` Nikolay Aleksandrov
2014-01-23 21:18   ` Nikolay Aleksandrov
2014-01-23 22:43     ` [PATCH net-next] bonding: fix u64 division Nikolay Aleksandrov
2014-01-24  0:12       ` David Miller
2014-01-24 18:27     ` [PATCH net-next] bonding: Use do_div to divide 64 bit numbers Zoltan Kiss
2014-01-23 22:25 ` Sergei Shtylyov [this message]

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=52E196D8.5060103@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=andy@greyhouse.net \
    --cc=fubar@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@redhat.com \
    --cc=vfalico@redhat.com \
    --cc=zoltan.kiss@citrix.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 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).