From patchwork Wed Nov 24 05:36:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 351711 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAO5c3Cp015357 for ; Wed, 24 Nov 2010 05:38:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974Ab0KXFhN (ORCPT ); Wed, 24 Nov 2010 00:37:13 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:64614 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717Ab0KXFhM (ORCPT ); Wed, 24 Nov 2010 00:37:12 -0500 Received: by wyb28 with SMTP id 28so9100597wyb.19 for ; Tue, 23 Nov 2010 21:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=lVYvN7Snir+kkGWDhwENY3TcpJ9R5NSqPJtTxjrb5Uk=; b=gyerm/lxeUMxuqLdSSPUkvq3EaZpi72jm1KD4kg71zt+G6HV+LtkYxSPTDL3OAGDXR 8m3MCwdUvcFSWc3IwITewchbF/SPeZVrqZcj63QqXOARA97aNJs0o/Z42SHVzLjplWko tpjooaJmQbmK0poyz6a8vgsrFwOWMD5Dnntrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; b=F14N8ap3AhR7SF1fXb1iMHF7TBJDsh5sgPtbAbSuH/r4rPOgrIHEudEAujr3GRwjap MH/k9erip2DJXKN+eWSJnRrsb44sxLilQgXs15gR5hv8ALqyKO6hTfe+DXY4uvnx0Ha1 n3OnyvyMXEro+KHysxvnZMv0dNK+t8DnNtMH8= Received: by 10.216.46.65 with SMTP id q43mr7137981web.114.1290577029277; Tue, 23 Nov 2010 21:37:09 -0800 (PST) Received: from bicker ([41.138.6.25]) by mx.google.com with ESMTPS id x23sm3244316weq.34.2010.11.23.21.37.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 21:37:07 -0800 (PST) Date: Wed, 24 Nov 2010 08:36:57 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Steven Toth , Gavin Hurlbut , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] saa7164: poll mask set incorrectly Message-ID: <20101124053656.GO1522@bicker> Mail-Followup-To: Dan Carpenter , Mauro Carvalho Chehab , Steven Toth , Gavin Hurlbut , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 24 Nov 2010 05:38:04 +0000 (UTC) diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c index cbb53d0..f4b8ac7 100644 --- a/drivers/media/video/saa7164/saa7164-encoder.c +++ b/drivers/media/video/saa7164/saa7164-encoder.c @@ -1238,7 +1238,6 @@ static unsigned int fops_poll(struct file *file, poll_table *wait) { struct saa7164_encoder_fh *fh = (struct saa7164_encoder_fh *)file->private_data; struct saa7164_port *port = fh->port; - struct saa7164_user_buffer *ubuf; unsigned int mask = 0; port->last_poll_msecs_diff = port->last_poll_msecs; @@ -1271,10 +1270,7 @@ static unsigned int fops_poll(struct file *file, poll_table *wait) } /* Pull the first buffer from the used list */ - ubuf = list_first_entry(&port->list_buf_used.list, - struct saa7164_user_buffer, list); - - if (ubuf) + if (!list_empty(&port->list_buf_used.list)) mask |= POLLIN | POLLRDNORM; return mask; diff --git a/drivers/media/video/saa7164/saa7164-vbi.c b/drivers/media/video/saa7164/saa7164-vbi.c index 323c7cd..8025631 100644 --- a/drivers/media/video/saa7164/saa7164-vbi.c +++ b/drivers/media/video/saa7164/saa7164-vbi.c @@ -1186,7 +1186,6 @@ static unsigned int fops_poll(struct file *file, poll_table *wait) { struct saa7164_vbi_fh *fh = (struct saa7164_vbi_fh *)file->private_data; struct saa7164_port *port = fh->port; - struct saa7164_user_buffer *ubuf; unsigned int mask = 0; port->last_poll_msecs_diff = port->last_poll_msecs; @@ -1219,10 +1218,7 @@ static unsigned int fops_poll(struct file *file, poll_table *wait) } /* Pull the first buffer from the used list */ - ubuf = list_first_entry(&port->list_buf_used.list, - struct saa7164_user_buffer, list); - - if (ubuf) + if (!list_empty(&port->list_buf_used.list)) mask |= POLLIN | POLLRDNORM; return mask;