Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbaJ0HlY (ORCPT ); Mon, 27 Oct 2014 03:41:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46293 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834AbaJ0HlW (ORCPT ); Mon, 27 Oct 2014 03:41:22 -0400 Date: Mon, 27 Oct 2014 08:41:20 +0100 Message-ID: From: Takashi Iwai To: Joe Perches Cc: linux-kernel@vger.kernel.org, Thibaut Varene , Jaroslav Kysela , linux-parisc@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH 11/11] sound: ad1889: Fix probable mask then right shift defects In-Reply-To: <20f33139e87eb74f0ac50d0503a241936d4e0ff5.1414387334.git.joe@perches.com> References: <20f33139e87eb74f0ac50d0503a241936d4e0ff5.1414387334.git.joe@perches.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Sun, 26 Oct 2014 22:25:07 -0700, Joe Perches wrote: > > Precedence of & and >> is not the same and is not left to right. > shift has higher precedence and should be done after the mask. > > Add parentheses around the mask. > > Signed-off-by: Joe Perches Thanks, applied. Takashi > --- > sound/pci/ad1889.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c > index 7bfdf9c..1610c38 100644 > --- a/sound/pci/ad1889.c > +++ b/sound/pci/ad1889.c > @@ -681,7 +681,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe > > /* WARQ is at offset 12 */ > tmp = (reg & AD_DS_WSMC_WARQ) ? > - (((reg & AD_DS_WSMC_WARQ >> 12) & 0x01) ? 12 : 18) : 4; > + ((((reg & AD_DS_WSMC_WARQ) >> 12) & 0x01) ? 12 : 18) : 4; > tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1; > > snd_iprintf(buffer, "Wave FIFO: %d %s words\n\n", tmp, > @@ -693,7 +693,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe > > /* SYRQ is at offset 4 */ > tmp = (reg & AD_DS_WSMC_SYRQ) ? > - (((reg & AD_DS_WSMC_SYRQ >> 4) & 0x01) ? 12 : 18) : 4; > + ((((reg & AD_DS_WSMC_SYRQ) >> 4) & 0x01) ? 12 : 18) : 4; > tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1; > > snd_iprintf(buffer, "Synthesis FIFO: %d %s words\n\n", tmp, > @@ -709,7 +709,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe > > /* ACRQ is at offset 4 */ > tmp = (reg & AD_DS_RAMC_ACRQ) ? > - (((reg & AD_DS_RAMC_ACRQ >> 4) & 0x01) ? 12 : 18) : 4; > + ((((reg & AD_DS_RAMC_ACRQ) >> 4) & 0x01) ? 12 : 18) : 4; > tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1; > > snd_iprintf(buffer, "ADC FIFO: %d %s words\n\n", tmp, > @@ -720,7 +720,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe > > /* RERQ is at offset 12 */ > tmp = (reg & AD_DS_RAMC_RERQ) ? > - (((reg & AD_DS_RAMC_RERQ >> 12) & 0x01) ? 12 : 18) : 4; > + ((((reg & AD_DS_RAMC_RERQ) >> 12) & 0x01) ? 12 : 18) : 4; > tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1; > > snd_iprintf(buffer, "Resampler FIFO: %d %s words\n\n", tmp, > -- > 2.1.2 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/