public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public•gmane.org>
To: Nicholas Mc Guire <der.herr-kA1LtwSENNE@public•gmane.org>
Cc: Nicholas Mc Guire
	<hofrat-Q945KHDl0DbYtjvyW6yDsg@public•gmane.org>,
	Brett Rudley <brudley-dY08KVG/lbpWk0Htik3J/w@public•gmane.org>,
	Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public•gmane.org>,
	"Franky (Zhenhui) Lin"
	<frankyl-dY08KVG/lbpWk0Htik3J/w@public•gmane.org>,
	Hante Meuleman <meuleman-dY08KVG/lbpWk0Htik3J/w@public•gmane.org>,
	Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public•gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public•gmane.org>,
	Pieter-Paul Giesberts
	<pieterpg-dY08KVG/lbpWk0Htik3J/w@public•gmane.org>,
	Daniel Kim <dekim-dY08KVG/lbpWk0Htik3J/w@public•gmane.org>,
	Johannes Berg
	<johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public•gmane.org>,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w@public•gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
Subject: Re: [PATCH] brcmfmac: cfg80211: use msecs_to_jiffies for time conversion
Date: Wed, 18 Mar 2015 00:30:56 -0700	[thread overview]
Message-ID: <1426663856.10043.15.camel@perches.com> (raw)
In-Reply-To: <20150318064439.GA25924-AxMHDufBahDk7+2FdBfRIA@public.gmane.org>

On Wed, 2015-03-18 at 07:44 +0100, Nicholas Mc Guire wrote:
> On Tue, 17 Mar 2015, Joe Perches wrote:
> > On Tue, 2015-03-17 at 08:06 -0400, Nicholas Mc Guire wrote:
> > > Converting milliseconds to jiffies by "val * HZ / 1000" is technically
> > > OK but msecs_to_jiffies(val) is the cleaner solution and handles all
> > > corner cases correctly. This is a minor API consolidation only and
> > > should make things more readable.

> > These API consolidation changes now always have a function
> > call when the compiler may have previously been able to
> > optimize out the "constant * HZ / 1000" calculation.
> >
> > Perhaps the [um]secs_to_jiffies calls should be indirected
> > with yet another static inline with a __builtin_constant_p()
> > test so that the function calls can again be avoided when
> > possible.
> 
> will give it a try 

OK, thanks.

The tricky bit seems to be the movement of
the Makefile for kernel/time/timeconst.h.

  BC      kernel/time/timeconst.h

as include/linux/time.h would need these
calculated #defines

#define MSEC_TO_HZ_MUL32	U64_C(0x80000000)
#define MSEC_TO_HZ_ADJ32	U64_C(0x0)
#define MSEC_TO_HZ_SHR32	31

and the usec ones too.

That created file would have to be moved from
kernel/time/Makefile to some other location
that could be in the normal include path like
include/linux/timeconst.h so that it can be
used by include/linux/time.h



--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-03-18  7:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 12:06 [PATCH] brcmfmac: cfg80211: use msecs_to_jiffies for time conversion Nicholas Mc Guire
2015-03-17 12:42 ` Joe Perches
2015-03-18  6:44   ` Nicholas Mc Guire
     [not found]     ` <20150318064439.GA25924-AxMHDufBahDk7+2FdBfRIA@public.gmane.org>
2015-03-18  7:30       ` Joe Perches [this message]
2015-03-17 16:04 ` Arend van Spriel

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=1426663856.10043.15.camel@perches.com \
    --to=joe-6d6dil74uinbdgjk7y7tuq@public$(echo .)gmane.org \
    --cc=arend-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=brudley-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=dekim-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=der.herr-kA1LtwSENNE@public$(echo .)gmane.org \
    --cc=frankyl-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=hofrat-Q945KHDl0DbYtjvyW6yDsg@public$(echo .)gmane.org \
    --cc=johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public$(echo .)gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public$(echo .)gmane.org \
    --cc=meuleman-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=pieterpg-dY08KVG/lbpWk0Htik3J/w@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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