lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5ha9jre2in.wl%tiwai@suse.de>
Date:	Thu, 05 Sep 2013 17:01:20 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	Dave Jones <davej@...hat.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	adi@...omp.erfurt.thur.de
Subject: Re: ALSA: hdspm - AES32: Enable TCO/Sync-In in snd_hdspm_put_sync_ref()

At Thu, 5 Sep 2013 10:50:13 -0400,
Dave Jones wrote:
> 
> On Thu, Sep 05, 2013 at 01:38:37AM +0000, Linux Kernel wrote:
>  > Gitweb:     http://git.kernel.org/linus/;a=commit;h=2d60fc7f7d3d79e5646646bb34811961f19d111a
>  > Commit:     2d60fc7f7d3d79e5646646bb34811961f19d111a
>  > Parent:     dbae4a0c8d8794df1a6bd7e644ed94b915f46f7e
>  > Author:     Adrian Knoth <adi@...omp.erfurt.thur.de>
>  > AuthorDate: Fri Jul 5 11:28:15 2013 +0200
>  > Committer:  Takashi Iwai <tiwai@...e.de>
>  > CommitDate: Fri Jul 5 14:52:42 2013 +0200
>  > 
>  >     ALSA: hdspm - AES32: Enable TCO/Sync-In in snd_hdspm_put_sync_ref()
>  
>  >  static int hdspm_autosync_ref(struct hdspm *hdspm)
>  >  {
>   ...
>  > +		unsigned int syncref = (status >> HDSPM_AES32_syncref_bit) & 0xF;
>  > +		if ((syncref >= HDSPM_AES32_AUTOSYNC_FROM_WORD) &&
>  > +				(syncref <= HDSPM_AES32_AUTOSYNC_FROM_SYNC_IN)) {
>  >  			return syncref;
>  > +		}
> 
> Because syncref is unsigned, the first part of that if always evaluates true.
> (it will always be >0)

True.  But from the coding POV, it's not so bad to show both "from"
and "to" for clearly indicating a range, IMO.  (And the compiler
should be cleverer than the programmer and will optimize it out in
anyway :)


thanks,

Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ