From: Takashi Iwai Subject: Re: ALSA: core: add support for compress_offload Date: Wed, 05 Sep 2012 15:36:24 +0200 Message-ID: References: <20120904163300.GA12172@elgon.mountain> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 2C48726534C for ; Wed, 5 Sep 2012 15:36:25 +0200 (CEST) In-Reply-To: <20120904163300.GA12172@elgon.mountain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Dan Carpenter Cc: vinod.koul@linux.intel.com, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 4 Sep 2012 19:33:00 +0300, Dan Carpenter wrote: > > Hello Vinod Koul, > > The patch b21c60a4edd2: "ALSA: core: add support for > compress_offload" from Dec 23, 2011, leads to the following warning: > sound/core/compress_offload.c:85 snd_compr_open() > warn: bitwise AND condition is false here > > 83 if (f->f_flags & O_WRONLY) > 84 dirn = SND_COMPRESS_PLAYBACK; > 85 else if (f->f_flags & O_RDONLY) > 86 dirn = SND_COMPRESS_CAPTURE; > 87 else { > 88 pr_err("invalid direction\n"); > 89 return -EINVAL; > 90 } > > O_RDONLY is 0 so we never do compressed capture. Perhaps the tests > should be: > > if ((file->f_flags & O_ACCMODE) == O_WRONLY) > dirn = SND_COMPRESS_PLAYBACK; > else if (file->f_flags & O_ACCMODE) == O_RDONLY) > dirn = SND_COMPRESS_CAPTURE; > else > return -EINVAL; > > Also it seems like a bad thing to print an error here, because can the > user flood dmesg? Agreed on both points. Care to send a fix patch? thanks, Takashi