All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Akihiro TSUKADA <tskd08@gmail.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH] [media] qm1d1c0042: fix compilation on 32 bits
Date: Wed, 24 Sep 2014 16:38:02 +0300	[thread overview]
Message-ID: <5422C93A.2050203@iki.fi> (raw)
In-Reply-To: <20140924103445.31aeca91@recife.lan>



On 09/24/2014 04:34 PM, Mauro Carvalho Chehab wrote:
> Em Wed, 24 Sep 2014 21:27:57 +0900
> Akihiro TSUKADA <tskd08@gmail.com> escreveu:
>
>>> -	b = (((s64) freq) << 20) / state->cfg.xtal_freq - (((s64) a) << 20);
>>> +	b = (s32)div64_s64(((s64) freq) << 20,
>>> +			   state->cfg.xtal_freq - (((s64) a) << 20));
>>> +
>>
>> I'm afraid it should be like the following.
>>> +	b = (s32)(div64_s64(((s64) freq) << 20, state->cfg.xtal_freq)
>>> +			- (((s64) a) << 20));
>
> Are you talking about coding style?

It is calculation order of operators. '/' vs. '-'

>
> Instead of using something like:
>
> 	var = foo_func(a, c
> 		- b);
>
> We generally use:
> 	var = foo_func(a,
> 		       c - b);
>
> As it is quicker for reviewers to read.
>
>>
>> regads,
>> akihiro
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-- 
http://palosaari.fi/

  reply	other threads:[~2014-09-24 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24  1:31 [PATCH] [media] qm1d1c0042: fix compilation on 32 bits Mauro Carvalho Chehab
2014-09-24 12:27 ` Akihiro TSUKADA
2014-09-24 13:34   ` Mauro Carvalho Chehab
2014-09-24 13:38     ` Antti Palosaari [this message]
2014-09-24 14:05       ` Mauro Carvalho Chehab

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=5422C93A.2050203@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@osg.samsung.com \
    --cc=tskd08@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.