From patchwork Wed Sep 20 19:11:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9962105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9279960234 for ; Wed, 20 Sep 2017 19:12:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 846CB29079 for ; Wed, 20 Sep 2017 19:12:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78199290D1; Wed, 20 Sep 2017 19:12:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A2A729079 for ; Wed, 20 Sep 2017 19:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750938AbdITTL5 (ORCPT ); Wed, 20 Sep 2017 15:11:57 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:50293 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751450AbdITTL4 (ORCPT ); Wed, 20 Sep 2017 15:11:56 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id CB865A0D89; Wed, 20 Sep 2017 19:12:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zZBhZd_db9ZZ; Wed, 20 Sep 2017 19:12:23 +0000 (UTC) Received: from smtp.s-opensource.com (unknown [179.183.111.11]) by osg.samsung.com (Postfix) with ESMTPSA id 0ACA9A05F0; Wed, 20 Sep 2017 19:12:23 +0000 (UTC) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1dukPX-00034Z-JL; Wed, 20 Sep 2017 16:11:51 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Ingo Molnar , Sakari Ailus , Hans Verkuil , Masahiro Yamada , Arvind Yadav Subject: [PATCH 13/25] media: dvb_demux: dvb_demux_feed.pusi_seen is boolean Date: Wed, 20 Sep 2017 16:11:38 -0300 Message-Id: <9e8228624ba9960cda4042c0901e5e7d55e49bb3.1505933919.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of using an integer to represent it, use boolean, as this better describes what this field really means. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-core/dvb_demux.c | 12 ++++++------ drivers/media/dvb-core/dvb_demux.h | 2 +- drivers/media/pci/ttpci/av7110.c | 2 +- drivers/media/pci/ttpci/budget-core.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c index 68e93362c081..b9360cbc3519 100644 --- a/drivers/media/dvb-core/dvb_demux.c +++ b/drivers/media/dvb-core/dvb_demux.c @@ -223,10 +223,10 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed) * when the second packet arrives. * * Fix: - * when demux is started, let feed->pusi_seen = 0 to + * when demux is started, let feed->pusi_seen = false to * prevent initial feeding of garbage from the end of * previous section. When you for the first time see PUSI=1 - * then set feed->pusi_seen = 1 + * then set feed->pusi_seen = true */ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const u8 *buf, u8 len) @@ -318,10 +318,10 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, */ #endif /* - * Discontinuity detected. Reset pusi_seen = 0 to + * Discontinuity detected. Reset pusi_seen to * stop feeding of suspicious data until next PUSI=1 arrives */ - feed->pusi_seen = 0; + feed->pusi_seen = false; dvb_dmx_swfilter_section_new(feed); } @@ -335,8 +335,8 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, dvb_dmx_swfilter_section_copy_dump(feed, before, before_len); - /* before start of new section, set pusi_seen = 1 */ - feed->pusi_seen = 1; + /* before start of new section, set pusi_seen */ + feed->pusi_seen = true; dvb_dmx_swfilter_section_new(feed); dvb_dmx_swfilter_section_copy_dump(feed, after, after_len); diff --git a/drivers/media/dvb-core/dvb_demux.h b/drivers/media/dvb-core/dvb_demux.h index 700887938145..9db3c2b7c64e 100644 --- a/drivers/media/dvb-core/dvb_demux.h +++ b/drivers/media/dvb-core/dvb_demux.h @@ -101,7 +101,7 @@ struct dvb_demux_feed { enum dmx_ts_pes pes_type; int cc; - int pusi_seen; /* prevents feeding of garbage from previous section */ + bool pusi_seen; /* prevents feeding of garbage from previous section */ u16 peslen; diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c index f46947d8adf8..f89fb23f6c57 100644 --- a/drivers/media/pci/ttpci/av7110.c +++ b/drivers/media/pci/ttpci/av7110.c @@ -1224,7 +1224,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed) dprintk(2, "av7110: %p\n", budget); spin_lock(&budget->feedlock1); - feed->pusi_seen = 0; /* have a clean section start */ + feed->pusi_seen = false; /* have a clean section start */ status = start_ts_capture(budget); spin_unlock(&budget->feedlock1); return status; diff --git a/drivers/media/pci/ttpci/budget-core.c b/drivers/media/pci/ttpci/budget-core.c index 97499b2af714..b3dc45b91101 100644 --- a/drivers/media/pci/ttpci/budget-core.c +++ b/drivers/media/pci/ttpci/budget-core.c @@ -330,7 +330,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed) return -EINVAL; spin_lock(&budget->feedlock); - feed->pusi_seen = 0; /* have a clean section start */ + feed->pusi_seen = false; /* have a clean section start */ if (budget->feeding++ == 0) status = start_ts_capture(budget); spin_unlock(&budget->feedlock);