From patchwork Thu Sep 14 10:37:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9952751 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 C637460317 for ; Thu, 14 Sep 2017 10:37:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A00B028DDD for ; Thu, 14 Sep 2017 10:37:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93A8128E94; Thu, 14 Sep 2017 10:37:52 +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=unavailable 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 27CEB28DDD for ; Thu, 14 Sep 2017 10:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbdINKhh (ORCPT ); Thu, 14 Sep 2017 06:37:37 -0400 Received: from mout.web.de ([212.227.17.11]:50273 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbdINKhf (ORCPT ); Thu, 14 Sep 2017 06:37:35 -0400 Received: from [192.168.1.2] ([85.182.44.111]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M0ymZ-1dZWt90KlT-00vBXv; Thu, 14 Sep 2017 12:37:16 +0200 Subject: [PATCH 7/8] [media] ttusb_dec: Add spaces for better code readability From: SF Markus Elfring To: linux-media@vger.kernel.org, Arvind Yadav , Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <66b087d3-6dd3-1e1c-d33d-e34c9e2ffe25@users.sourceforge.net> Message-ID: <69c23391-a033-97a0-2ee6-27581f48d539@users.sourceforge.net> Date: Thu, 14 Sep 2017 12:37:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <66b087d3-6dd3-1e1c-d33d-e34c9e2ffe25@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:goYhyph3cjREQRHHVHScvCtNW3LanUjXwsPDlJbvFsoR7RPJC+H aBROtwn2X7wsEHwY7oAW2pVRgygD+wozRXKlQG7a1VjsdWEpH2o0jtLsEQzhkmo3/jwILqu rXjQLVvRI6IydEDBDsvkeQ1i7r10Qc+slDf9fgzBuS3JqnBHo8WwGqtnjNu2pvzVK9CfQN9 cTWlqT9x2uiRtjdKH3t9w== X-UI-Out-Filterresults: notjunk:1; V01:K0:jzLUU/AOXS0=:S0+IC2YJj1gLYHGUC/EdZD BjHn6l6gT4XItMp8ZdAMy+smq6iUKoiGymGR8GHiX4U+Oe/rlu2lPjUmiZVzecUJs/34r0f87 sH2fAvJ8cbJu6Txfh5Ljxmu8yg+w4XLeK3dhPYEELme9R55NAcZuzP3h061gjR8FJITv+nSb/ bp3okj2+V54UC2BebLa/8T+owT5bysaoVc0ZbKrq7dazSLKuxmzZgYSxacVLKKMVgIniVCSfr 234xX0hDqZzmtJfSczmYq7UDMwmfdx+o0+NmryUNZD6kd11LnD3xIAD+iSwd/S/zfP81nh6AC t+pSwMJvMX2Jt8zt9YNglokLLsriZnnte7qJQz1MG1gXYcPJY5VB9P65R2RelnumetbdJ5B7f 1oDI+tjyqS86Et9xGkLRQ8jLfDMTA67bf7OpwgqlZbqg7GWz4+allWRFYqHQkjXTW+1J8jqG4 ErEI9mTObuN0otpEjhB3r2VFoinj32Hp6j5clUKCbzALB49PrmQWtb/POaVQXCFKqVnQBctyT baPCyQkNNqVMYj0ARLcMnZlIDB2sh9uUvQvzQRhPGRojaTSmrtZ5+8lysewDKNnuWfuygZrS9 pHyFt2RBYnuotmG0T+VJLKAGwFYD3tQCf63A/erjwtckE53KCVNDLjXSupiS9LBz6cdElrFaC XyQj9a99/f61WHyXEK/MgINK0VKnffWl503AtonCYQjQr6kpcofg6NciGcvE1kSZ0e43cgrhL uwFWdWsj3H4u0M8FxhdedMPtxhb5e79RZmxCkoVRFdD27eVy46O1AmcHtZFicL5NqpgI0IDni 5zYhvX3wJ75fdfytxjGnH+WlXzQPQuADV3v/p68ZOMsKraKijw= 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: Markus Elfring Date: Wed, 13 Sep 2017 22:12:07 +0200 The script "checkpatch.pl" pointed information out like the following. ERROR: spaces required around that '=' (ctx:VxV) Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/usb/ttusb-dec/ttusb_dec.c | 79 +++++++++++++++++---------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c index e9fe4c6142a5..58256d518fa6 100644 --- a/drivers/media/usb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c @@ -209,47 +209,49 @@ static void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, dvb_filter_pes2ts_cb_t *cb, void *priv) { - unsigned char *buf=p2ts->buf; - - buf[0]=0x47; - buf[1]=(pid>>8); - buf[2]=pid&0xff; - p2ts->cc=0; - p2ts->cb=cb; - p2ts->priv=priv; + unsigned char *buf = p2ts->buf; + + buf[0] = 0x47; + buf[1] = pid >> 8; + buf[2] = pid & 0xff; + p2ts->cc = 0; + p2ts->cb = cb; + p2ts->priv = priv; } static int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, int len, int payload_start) { - unsigned char *buf=p2ts->buf; - int ret=0, rest; + unsigned char *buf = p2ts->buf; + int ret = 0, rest; //len=6+((pes[4]<<8)|pes[5]); if (payload_start) - buf[1]|=0x40; + buf[1] |= 0x40; else - buf[1]&=~0x40; - while (len>=184) { - buf[3]=0x10|((p2ts->cc++)&0x0f); - memcpy(buf+4, pes, 184); - if ((ret=p2ts->cb(p2ts->priv, buf))) + buf[1] &= ~0x40; + while (len >= 184) { + buf[3] = 0x10 | ((p2ts->cc++) & 0x0f); + memcpy(buf + 4, pes, 184); + ret = p2ts->cb(p2ts->priv, buf); + if (ret) return ret; - len-=184; pes+=184; - buf[1]&=~0x40; + len -= 184; + pes += 184; + buf[1] &= ~0x40; } if (!len) return 0; - buf[3]=0x30|((p2ts->cc++)&0x0f); - rest=183-len; + buf[3] = 0x30 | ((p2ts->cc++) & 0x0f); + rest = 183 - len; if (rest) { - buf[5]=0x00; - if (rest-1) - memset(buf+6, 0xff, rest-1); + buf[5] = 0x00; + if (rest - 1) + memset(buf + 6, 0xff, rest - 1); } - buf[4]=rest; - memcpy(buf+5+rest, pes, len); + buf[4] = rest; + memcpy(buf + 5 + rest, pes, len); return p2ts->cb(p2ts->priv, buf); } @@ -262,7 +264,7 @@ static void ttusb_dec_handle_irq( struct urb *urb) char *buffer = dec->irq_buffer; int retval; - switch(urb->status) { + switch (urb->status) { case 0: /*success*/ break; case -ECONNRESET: @@ -275,7 +277,7 @@ static void ttusb_dec_handle_irq( struct urb *urb) return; default: dprintk("%s:nonzero status received: %d\n", - __func__,urb->status); + __func__, urb->status); goto exit; } @@ -1263,10 +1265,9 @@ static int ttusb_init_rc( struct ttusb_dec *dec) dec->rc_input_dev = input_dev; if (usb_submit_urb(dec->irq_urb, GFP_KERNEL)) - printk("%s: usb_submit_urb failed\n",__func__); + printk("%s: usb_submit_urb failed\n", __func__); /* enable irq pipe */ - ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL); - + ttusb_dec_send_command(dec, 0xb0, sizeof(b), b, NULL, NULL); return 0; } @@ -1295,18 +1296,20 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec) dec->out_pipe = usb_sndisocpipe(dec->udev, OUT_PIPE); dec->irq_pipe = usb_rcvintpipe(dec->udev, IRQ_PIPE); - if(enable_rc) { + if (enable_rc) { dec->irq_urb = usb_alloc_urb(0, GFP_KERNEL); - if(!dec->irq_urb) { + if (!dec->irq_urb) return -ENOMEM; - } - dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE, - GFP_KERNEL, &dec->irq_dma_handle); - if(!dec->irq_buffer) { + + dec->irq_buffer = usb_alloc_coherent(dec->udev, + IRQ_PACKET_SIZE, + GFP_KERNEL, + &dec->irq_dma_handle); + if (!dec->irq_buffer) { usb_free_urb(dec->irq_urb); return -ENOMEM; } - usb_fill_int_urb(dec->irq_urb, dec->udev,dec->irq_pipe, + usb_fill_int_urb(dec->irq_urb, dec->udev, dec->irq_pipe, dec->irq_buffer, IRQ_PACKET_SIZE, ttusb_dec_handle_irq, dec, 1); dec->irq_urb->transfer_dma = dec->irq_dma_handle; @@ -1739,7 +1742,7 @@ static void ttusb_dec_disconnect(struct usb_interface *intf) if (dec->active) { ttusb_dec_exit_tasklet(dec); ttusb_dec_exit_filters(dec); - if(enable_rc) + if (enable_rc) ttusb_dec_exit_rc(dec); ttusb_dec_exit_usb(dec); ttusb_dec_exit_dvb(dec);