From patchwork Sun May 7 21:23:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 9715501 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 183B660380 for ; Sun, 7 May 2017 22:04:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09D2E200F5 for ; Sun, 7 May 2017 22:04:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECF8F26C9B; Sun, 7 May 2017 22:04:38 +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 84995200F5 for ; Sun, 7 May 2017 22:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756501AbdEGWEg (ORCPT ); Sun, 7 May 2017 18:04:36 -0400 Received: from mail.anw.at ([195.234.101.228]:35906 "EHLO mail.anw.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754100AbdEGWEe (ORCPT ); Sun, 7 May 2017 18:04:34 -0400 X-Greylist: delayed 595 seconds by postgrey-1.27 at vger.kernel.org; Sun, 07 May 2017 18:04:26 EDT Received: from hoppel.217.196.72.190 (anwhome.anw.at [195.234.103.23]) by mail.anw.at (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id v47LNeGO026475; Sun, 7 May 2017 23:23:46 +0200 From: "Jasmin J." To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, max.kellermann@gmail.com, jasmin@anw.at Subject: [PATCH 07/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 3 Date: Sun, 7 May 2017 23:23:30 +0200 Message-Id: <1494192214-20082-8-git-send-email-jasmin@anw.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494192214-20082-1-git-send-email-jasmin@anw.at> References: <1494192214-20082-1-git-send-email-jasmin@anw.at> X-Antivirus: checked in 0.027sec at mail.anw.at ([195.234.102.72]) by smf-clamd v1.2.1 - http://smfs.sf.net/ 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 From: Jasmin Jessich Fixed all: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Jasmin Jessich --- drivers/media/dvb-core/dvb_ca_en50221.c | 48 +++++++++++++-------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index 6d405b5..af66c83 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -240,9 +240,8 @@ static int dvb_ca_en50221_check_camstatus(struct dvb_ca_private *ca, int slot) int cam_changed; /* IRQ mode */ - if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE) { + if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE) return (atomic_read(&sl->camchange_count) != 0); - } /* poll mode */ slot_status = ca->pub->poll_slot_status(ca->pub, slot, ca->open); @@ -255,11 +254,9 @@ static int dvb_ca_en50221_check_camstatus(struct dvb_ca_private *ca, int slot) } if (cam_changed) { - if (!cam_present_now) { - sl->camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; - } else { - sl->camchange_type = DVB_CA_EN50221_CAMCHANGE_INSERTED; - } + sl->camchange_type = cam_present_now ? + DVB_CA_EN50221_CAMCHANGE_INSERTED : + DVB_CA_EN50221_CAMCHANGE_REMOVED; atomic_set(&sl->camchange_count, 1); } else { if ((sl->slot_state == SLOT_STAT_WAITREADY) && @@ -309,9 +306,8 @@ static int dvb_ca_en50221_wait_if_status(struct dvb_ca_private *ca, int slot, } /* check for timeout */ - if (time_after(jiffies, timeout)) { + if (time_after(jiffies, timeout)) break; - } /* wait for a bit */ msleep(1); @@ -534,9 +530,8 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) sl = &ca->slot_info[slot]; sl->config_base = 0; - for (i = 0; i < rasz + 1; i++) { + for (i = 0; i < rasz + 1; i++) sl->config_base |= (tuple[2 + i] << (8 * i)); - } /* check it contains the correct DVB string */ dvb_str = findstr((char *)tuple, tupleLength, "DVB_CI_V", 8); @@ -774,9 +769,9 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, buf[0], (buf[1] & 0x80) == 0, bytes_read); /* wake up readers when a last_fragment is received */ - if ((buf[1] & 0x80) == 0x00) { + if ((buf[1] & 0x80) == 0x00) wake_up_interruptible(&ca->wait_queue); - } + status = bytes_read; exit: @@ -1122,9 +1117,8 @@ static void dvb_ca_en50221_thread_state_machine(struct dvb_ca_private *ca, dvb_ca_en50221_slot_shutdown(ca, slot); /* if a CAM is NOW present, initialise it */ - if (sl->camchange_type == DVB_CA_EN50221_CAMCHANGE_INSERTED) { + if (sl->camchange_type == DVB_CA_EN50221_CAMCHANGE_INSERTED) sl->slot_state = SLOT_STAT_UNINIT; - } /* we've handled one CAMCHANGE */ dvb_ca_en50221_thread_update_delay(ca); @@ -1389,9 +1383,8 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file, && (sl->slot_state != SLOT_STAT_INVALID)) { info->flags = CA_CI_MODULE_PRESENT; } - if (sl->slot_state == SLOT_STAT_RUNNING) { + if (sl->slot_state == SLOT_STAT_RUNNING) info->flags |= CA_CI_MODULE_READY; - } break; } @@ -1541,9 +1534,8 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, if (sl->slot_state != SLOT_STAT_RUNNING) goto nextslot; - if (sl->rx_buffer.data == NULL) { + if (sl->rx_buffer.data == NULL) return 0; - } idx = dvb_ringbuffer_pkt_next(&sl->rx_buffer, -1, &fraglen); while (idx != -1) { @@ -1637,20 +1629,18 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user *buf, connection_id = hdr[0]; if (hdr[0] == connection_id) { if (pktlen < count) { - if ((pktlen + fraglen - 2) > count) { + if ((pktlen + fraglen - 2) > count) fraglen = count - pktlen; - } else { + else fraglen -= 2; - } status = dvb_ringbuffer_pkt_read_user(&sl->rx_buffer, idx, 2, buf + pktlen, fraglen); - if (status < 0) { + if (status < 0) goto exit; - } pktlen += fraglen; } @@ -1776,9 +1766,8 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table *wait) dprintk("%s\n", __func__); - if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { + if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) mask |= POLLIN; - } /* if there is something, return now */ if (mask) @@ -1787,9 +1776,8 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table *wait) /* wait for something to happen */ poll_wait(file, &ca->wait_queue, wait); - if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { + if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) mask |= POLLIN; - } return mask; } @@ -1930,9 +1918,9 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca) /* shutdown the thread if there was one */ kthread_stop(ca->thread); - for (i = 0; i < ca->slot_count; i++) { + for (i = 0; i < ca->slot_count; i++) dvb_ca_en50221_slot_shutdown(ca, i); - } + dvb_remove_device(ca->dvbdev); dvb_ca_private_put(ca); pubca->private = NULL;