netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: samuel@sortiz.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irda: fix overly long udelay()
Date: Fri, 25 Nov 2016 20:56:38 -0500 (EST)	[thread overview]
Message-ID: <20161125.205638.2032421932060534687.davem@davemloft.net> (raw)
In-Reply-To: <20161124162630.3802535-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 24 Nov 2016 17:26:22 +0100

> irda_get_mtt() returns a hardcoded '10000' in some cases,
> and with gcc-7, we get a build error because this triggers a
> compile-time check in udelay():
> 
> drivers/net/irda/w83977af_ir.o: In function `w83977af_hard_xmit':
> w83977af_ir.c:(.text.w83977af_hard_xmit+0x14c): undefined reference to `__bad_udelay'
> 
> Older compilers did not run into this because they either did not
> completely inline the irda_get_mtt() or did not consider the
> 10000 value a constant expression.
> 
> The code has been wrong since the start of git history.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 ...
> @@ -518,7 +518,9 @@ static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb,
>  		
>  		mtt = irda_get_mtt(skb);
>  		pr_debug("%s(%ld), mtt=%d\n", __func__ , jiffies, mtt);
> -			if (mtt)
> +			if (mtt > 1000)
> +				mdelay(mtt/1000);
> +			else if (mtt)
>  				udelay(mtt);

I know this isn't caused by you, but wow what is going on with the
indentation here?!?!?

  reply	other threads:[~2016-11-26  1:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 16:26 [PATCH] irda: fix overly long udelay() Arnd Bergmann
2016-11-26  1:56 ` David Miller [this message]
2016-11-28  1:00 ` David Miller

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=20161125.205638.2032421932060534687.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=samuel@sortiz.org \
    /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).