From patchwork Sun May 7 21:23:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 9715495 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 AB1A260387 for ; Sun, 7 May 2017 22:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CF20200F5 for ; Sun, 7 May 2017 22:04:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9206926C9B; Sun, 7 May 2017 22:04:35 +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 1D0B426E69 for ; Sun, 7 May 2017 22:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756392AbdEGWEd (ORCPT ); Sun, 7 May 2017 18:04:33 -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 S1754100AbdEGWEb (ORCPT ); Sun, 7 May 2017 18:04:31 -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 v47LNeGP026475; 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 08/11] [media] dvb-core/dvb_ca_en50221.c: Make checkpatch happy 4 Date: Sun, 7 May 2017 23:23:31 +0200 Message-Id: <1494192214-20082-9-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.022sec 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: Missing a blank line after declarations WARNING: Block comments use * on subsequent lines Signed-off-by: Jasmin Jessich --- drivers/media/dvb-core/dvb_ca_en50221.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index af66c83..090f343 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -178,7 +178,9 @@ static void dvb_ca_private_free(struct dvb_ca_private *ca) static void dvb_ca_private_release(struct kref *ref) { - struct dvb_ca_private *ca = container_of(ref, struct dvb_ca_private, refcount); + struct dvb_ca_private *ca; + + ca = container_of(ref, struct dvb_ca_private, refcount); dvb_ca_private_free(ca); } @@ -237,6 +239,7 @@ static int dvb_ca_en50221_check_camstatus(struct dvb_ca_private *ca, int slot) struct dvb_ca_slot *sl = &ca->slot_info[slot]; int slot_status; int cam_present_now; + int cam_present_old; int cam_changed; /* IRQ mode */ @@ -249,7 +252,7 @@ static int dvb_ca_en50221_check_camstatus(struct dvb_ca_private *ca, int slot) cam_present_now = (slot_status & DVB_CA_EN50221_POLL_CAM_PRESENT) ? 1 : 0; cam_changed = (slot_status & DVB_CA_EN50221_POLL_CAM_CHANGED) ? 1 : 0; if (!cam_changed) { - int cam_present_old = (sl->slot_state != SLOT_STAT_NONE); + cam_present_old = (sl->slot_state != SLOT_STAT_NONE); cam_changed = (cam_present_now != cam_present_old); } @@ -294,7 +297,8 @@ static int dvb_ca_en50221_wait_if_status(struct dvb_ca_private *ca, int slot, timeout = jiffies + timeout_hz; while (1) { /* read the status and check for error */ - int res = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); + int res = ca->pub->read_cam_control(ca->pub, slot, + CTRLIF_STATUS); if (res < 0) return -EIO; @@ -809,9 +813,10 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, return ca->pub->write_data(ca->pub, slot, buf, bytes_write); /* it is possible we are dealing with a single buffer implementation, - thus if there is data available for read or if there is even a read - already in progress, we do nothing but awake the kernel thread to - process the data if necessary. */ + * thus if there is data available for read or if there is even a read + * already in progress, we do nothing but awake the kernel thread to + * process the data if necessary. + */ status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); if (status < 0) goto exitnowrite; @@ -921,8 +926,9 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) ca->pub->slot_shutdown(ca->pub, slot); ca->slot_info[slot].slot_state = SLOT_STAT_NONE; - /* need to wake up all processes to check if they're now - trying to write to a defunct CAM */ + /* need to wake up all processes to check if they're now trying to + * write to a defunct CAM + */ wake_up_interruptible(&ca->wait_queue); dprintk("Slot %i shutdown\n", slot); @@ -1342,6 +1348,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file, case CA_RESET: for (slot = 0; slot < ca->slot_count; slot++) { struct dvb_ca_slot *sl = &ca->slot_info[slot]; + mutex_lock(&sl->slot_lock); if (sl->slot_state != SLOT_STAT_NONE) { dvb_ca_en50221_slot_shutdown(ca, slot); @@ -1862,6 +1869,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, /* now initialise each slot */ for (i = 0; i < slot_count; i++) { struct dvb_ca_slot *sl = &ca->slot_info[i]; + memset(sl, 0, sizeof(struct dvb_ca_slot)); sl->slot_state = SLOT_STAT_NONE; atomic_set(&sl->camchange_count, 0);