lkml.org 
[lkml]   [2009]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel] [RFC] [PATCH 3/3] ASoC: add support for Amstrad E3 (Delta) machine
Mark Brown wrote:
> On Wed, Jul 22, 2009 at 01:39:22PM +0200, Takashi Iwai wrote:
>> Mark Brown wrote:
>
>>>> + /* Setup pins after corresponding bits if changed */
>>>> + if ((bool)snd_soc_dapm_get_pin_status(codec, "Speaker") !=
>>>> + (bool)(function & (1 << AMS_DELTA_SPEAKER))) {
>
>>> Don't like these casts... why are they needed?
>
>> Because the right side is the bit operation?
>
> Ick, yes.
>
>> The cast doesn't look nice, though...
>
> Indeed. I'd suggest rewriting to try to do less in the if statement - a
> helper function seems to be in order here since the same code is
> repeated several times with different pins and bitmasks.

Thanks, I'll rewrite as you suggest.

Janusz


\
 
 \ /
  Last update: 2009-07-22 16:59    [W:0.066 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site