From patchwork Mon Oct 31 16:24:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 8253 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RKugK-0003ts-Hm; Mon, 31 Oct 2011 17:26:05 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-1) with esmtp id 1RKugJ-0003cw-Ln; Mon, 31 Oct 2011 17:25:52 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754173Ab1JaQZr (ORCPT + 3 others); Mon, 31 Oct 2011 12:25:47 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:48795 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753823Ab1JaQZq (ORCPT ); Mon, 31 Oct 2011 12:25:46 -0400 Received: by mail-ey0-f174.google.com with SMTP id 27so5444413eye.19 for ; Mon, 31 Oct 2011 09:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=NODUQLTEKvXKaFmrGSu2a5YRlRoq37hMh46fDZGRYao=; b=n8xPCBi8G5u5Pj6i4PaDubu3AzPJJ0pSbZMWIyPpo/jUT0EpQUYMjzuPLjIRe7R2H9 dVNCASF6F1JuYyBaYtekt8obW1r6TN+JLJ253L2butAfPKEDq7LVJ15JrIiHtWbiMD/I CrtmUfKeHZ7didtdELLubO69dQI7dE3xcNvDk= Received: by 10.213.35.83 with SMTP id o19mr1391271ebd.87.1320078345874; Mon, 31 Oct 2011 09:25:45 -0700 (PDT) Received: from localhost.localdomain (84-dzi-26.acn.waw.pl. [85.222.29.84]) by mx.google.com with ESMTPS id z58sm52444586eea.3.2011.10.31.09.25.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 31 Oct 2011 09:25:45 -0700 (PDT) From: Sylwester Nawrocki To: devel@driverdev.osuosl.org, linux-media@vger.kernel.org Cc: Piotr Chmura , Devin Heitmueller , Mauro Carvalho Chehab , Sylwester Nawrocki , Stefan Richter , Greg KH Subject: [PATCH 08/17] staging: as102: Fix CodingStyle errors in file as10x_cmd_cfg.c Date: Mon, 31 Oct 2011 17:24:46 +0100 Message-Id: <1320078295-3379-9-git-send-email-snjw23@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1320078295-3379-1-git-send-email-snjw23@gmail.com> References: <1320078295-3379-1-git-send-email-snjw23@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.10.31.161514 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, __ANY_URI 0, __CP_URI_IN_BODY 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -4.2 (----) X-LSpam-Report: No, score=-4.2 required=5.0 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_MED=-2.3, T_DKIM_INVALID=0.01 autolearn=ham From: Devin Heitmueller Fix Linux kernel coding style (whitespace and indentation) errors in file as10x_cmd_cfg.c. No functional changes. Signed-off-by: Devin Heitmueller Signed-off-by: Piotr Chmura Signed-off-by: Sylwester Nawrocki --- drivers/staging/media/as102/as10x_cmd_cfg.c | 262 +++++++++++++-------------- 1 files changed, 130 insertions(+), 132 deletions(-) diff --git a/drivers/staging/media/as102/as10x_cmd_cfg.c b/drivers/staging/media/as102/as10x_cmd_cfg.c index e3a0f90..7b22e19 100644 --- a/drivers/staging/media/as102/as10x_cmd_cfg.c +++ b/drivers/staging/media/as102/as10x_cmd_cfg.c @@ -2,8 +2,6 @@ \file as10x_cmd_cfg.c - \version $Id$ - \author: S. Martinelli ----------------------------------------------------------------------------\n @@ -22,7 +20,8 @@ #include #include "as102_drv.h" #elif defined(WIN32) - #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) /* win32 ddk implementation */ + #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) + /* win32 ddk implementation */ #include "wdm.h" #include "Device.h" #include "endian_mgmt.h" /* FIXME */ @@ -59,52 +58,52 @@ int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag, uint32_t *pvalue) { - int error; - struct as10x_cmd_t *pcmd, *prsp; - - ENTER(); - - pcmd = phandle->cmd; - prsp = phandle->rsp; - - /* prepare command */ - as10x_cmd_build(pcmd, (++phandle->cmd_xid), - sizeof(pcmd->body.context.req)); - - /* fill command */ - pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); - pcmd->body.context.req.tag = cpu_to_le16(tag); - pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA); - - /* send command */ - if(phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd(phandle, - (uint8_t *) pcmd, - sizeof(pcmd->body.context.req) + HEADER_SIZE, - (uint8_t *) prsp, - sizeof(prsp->body.context.rsp) + HEADER_SIZE); - } - else{ - error = AS10X_CMD_ERROR; - } - - if(error < 0) { - goto out; - } - - /* parse response: context command do not follow the common response */ - /* structure -> specific handling response parse required */ - error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); - - if(error == 0) { - /* Response OK -> get response data */ - *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32); - /* value returned is always a 32-bit value */ - } + int error; + struct as10x_cmd_t *pcmd, *prsp; + + ENTER(); + + pcmd = phandle->cmd; + prsp = phandle->rsp; + + /* prepare command */ + as10x_cmd_build(pcmd, (++phandle->cmd_xid), + sizeof(pcmd->body.context.req)); + + /* fill command */ + pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); + pcmd->body.context.req.tag = cpu_to_le16(tag); + pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA); + + /* send command */ + if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd(phandle, + (uint8_t *) pcmd, + sizeof(pcmd->body.context.req) + + HEADER_SIZE, + (uint8_t *) prsp, + sizeof(prsp->body.context.rsp) + + HEADER_SIZE); + } else { + error = AS10X_CMD_ERROR; + } + + if (error < 0) + goto out; + + /* parse response: context command do not follow the common response */ + /* structure -> specific handling response parse required */ + error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); + + if (error == 0) { + /* Response OK -> get response data */ + *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32); + /* value returned is always a 32-bit value */ + } out: - LEAVE(); - return(error); + LEAVE(); + return error; } /** @@ -118,47 +117,48 @@ out: int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag, uint32_t value) { - int error; - struct as10x_cmd_t *pcmd, *prsp; - - ENTER(); - - pcmd = phandle->cmd; - prsp = phandle->rsp; - - /* prepare command */ - as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.context.req)); - - /* fill command */ - pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); - /* pcmd->body.context.req.reg_val.mode initialization is not required */ - pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value); - pcmd->body.context.req.tag = cpu_to_le16(tag); - pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); - - /* send command */ - if(phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd(phandle, - (uint8_t *) pcmd, - sizeof(pcmd->body.context.req) + HEADER_SIZE, - (uint8_t *) prsp, - sizeof(prsp->body.context.rsp) + HEADER_SIZE); - } - else{ - error = AS10X_CMD_ERROR; - } - - if(error < 0) { - goto out; - } - - /* parse response: context command do not follow the common response */ - /* structure -> specific handling response parse required */ - error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); + int error; + struct as10x_cmd_t *pcmd, *prsp; + + ENTER(); + + pcmd = phandle->cmd; + prsp = phandle->rsp; + + /* prepare command */ + as10x_cmd_build(pcmd, (++phandle->cmd_xid), + sizeof(pcmd->body.context.req)); + + /* fill command */ + pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); + /* pcmd->body.context.req.reg_val.mode initialization is not required */ + pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value); + pcmd->body.context.req.tag = cpu_to_le16(tag); + pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); + + /* send command */ + if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd(phandle, + (uint8_t *) pcmd, + sizeof(pcmd->body.context.req) + + HEADER_SIZE, + (uint8_t *) prsp, + sizeof(prsp->body.context.rsp) + + HEADER_SIZE); + } else { + error = AS10X_CMD_ERROR; + } + + if (error < 0) + goto out; + + /* parse response: context command do not follow the common response */ + /* structure -> specific handling response parse required */ + error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); out: - LEAVE(); - return(error); + LEAVE(); + return error; } /** @@ -175,45 +175,43 @@ out: */ int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode) { - int error; - struct as10x_cmd_t *pcmd, *prsp; - - ENTER(); - - pcmd = phandle->cmd; - prsp = phandle->rsp; - - /* prepare command */ - as10x_cmd_build(pcmd, (++phandle->cmd_xid), - sizeof(pcmd->body.cfg_change_mode.req)); - - /* fill command */ - pcmd->body.cfg_change_mode.req.proc_id = - cpu_to_le16(CONTROL_PROC_ELNA_CHANGE_MODE); - pcmd->body.cfg_change_mode.req.mode = mode; - - /* send command */ - if(phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd(phandle, - (uint8_t *) pcmd, - sizeof(pcmd->body.cfg_change_mode.req) + HEADER_SIZE, - (uint8_t *) prsp, - sizeof(prsp->body.cfg_change_mode.rsp) + HEADER_SIZE); - } - else{ - error = AS10X_CMD_ERROR; - } - - if(error < 0) { - goto out; - } - - /* parse response */ - error = as10x_rsp_parse(prsp, CONTROL_PROC_ELNA_CHANGE_MODE_RSP); + int error; + struct as10x_cmd_t *pcmd, *prsp; + + ENTER(); + + pcmd = phandle->cmd; + prsp = phandle->rsp; + + /* prepare command */ + as10x_cmd_build(pcmd, (++phandle->cmd_xid), + sizeof(pcmd->body.cfg_change_mode.req)); + + /* fill command */ + pcmd->body.cfg_change_mode.req.proc_id = + cpu_to_le16(CONTROL_PROC_ELNA_CHANGE_MODE); + pcmd->body.cfg_change_mode.req.mode = mode; + + /* send command */ + if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd, + sizeof(pcmd->body.cfg_change_mode.req) + + HEADER_SIZE, (uint8_t *) prsp, + sizeof(prsp->body.cfg_change_mode.rsp) + + HEADER_SIZE); + } else { + error = AS10X_CMD_ERROR; + } + + if (error < 0) + goto out; + + /* parse response */ + error = as10x_rsp_parse(prsp, CONTROL_PROC_ELNA_CHANGE_MODE_RSP); out: - LEAVE(); - return(error); + LEAVE(); + return error; } /** @@ -225,15 +223,15 @@ out: ABILIS_RC_NOK \callgraph */ -int as10x_context_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id) { - - int err; +int as10x_context_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id) +{ + int err; - err = prsp->body.context.rsp.error; + err = prsp->body.context.rsp.error; - if((err == 0) && - (le16_to_cpu(prsp->body.context.rsp.proc_id) == proc_id)) { - return 0; - } - return AS10X_CMD_ERROR; + if ((err == 0) && + (le16_to_cpu(prsp->body.context.rsp.proc_id) == proc_id)) { + return 0; + } + return AS10X_CMD_ERROR; }