From patchwork Wed Jan 18 16:29:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 9524695 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 4A3EE6020B for ; Wed, 18 Jan 2017 20:31:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 396142855A for ; Wed, 18 Jan 2017 20:31:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E069285AE; Wed, 18 Jan 2017 20:31:25 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33EA82855A for ; Wed, 18 Jan 2017 20:31:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9142226777A; Wed, 18 Jan 2017 21:31:20 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2F89D2668A2; Wed, 18 Jan 2017 21:29:02 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4842D266BD9; Wed, 18 Jan 2017 17:30:03 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by alsa0.perex.cz (Postfix) with ESMTP id 9345F266A11 for ; Wed, 18 Jan 2017 17:29:59 +0100 (CET) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0IGTxUJ027227; Wed, 18 Jan 2017 10:29:59 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=rf@opensource.wolfsonmicro.com Received: from mail2.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0a-001ae601.pphosted.com with ESMTP id 27yj93xdmb-1; Wed, 18 Jan 2017 10:29:58 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail2.cirrus.com (Postfix) with ESMTP id 506086121AD3; Wed, 18 Jan 2017 10:29:58 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.301.0; Wed, 18 Jan 2017 16:29:57 +0000 Received: from rf-debian.wolfsonmicro.main ([172.22.20.124]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id v0IGTNfu026506; Wed, 18 Jan 2017 16:29:26 GMT From: Richard Fitzgerald To: Date: Wed, 18 Jan 2017 16:29:53 +0000 Message-ID: <1484756994-19679-1-git-send-email-rf@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701180213 Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com Subject: [alsa-devel] [PATCH 1/2] crecord: Fix some minor coding style problems X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP - Incorrect indenting of arguments to capture_samples() - Wrap long line in capture_samples() - Added a blank line in main() for readability - Deleted extra trailing blank line at end of file Signed-off-by: Richard Fitzgerald --- src/utils/crecord.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/crecord.c b/src/utils/crecord.c index 1ba54d7..390fe45 100644 --- a/src/utils/crecord.c +++ b/src/utils/crecord.c @@ -237,9 +237,9 @@ static int finish_record(void) } static void capture_samples(char *name, unsigned int card, unsigned int device, - unsigned long buffer_size, unsigned int frag, - unsigned int length, unsigned int rate, - unsigned int channels, unsigned int format) + unsigned long buffer_size, unsigned int frag, + unsigned int length, unsigned int rate, + unsigned int channels, unsigned int format) { struct compr_config config; struct snd_codec codec; @@ -268,7 +268,8 @@ static void capture_samples(char *name, unsigned int card, unsigned int device, if (!name) { file = STDOUT_FILENO; } else { - file = open(name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); + file = open(name, O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (file == -1) { fprintf(stderr, "Unable to open file '%s'\n", name); exit(EXIT_FAILURE); @@ -466,6 +467,7 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } } + if (optind >= argc) { file = NULL; finfo = fopen("/dev/null", "w"); @@ -483,4 +485,3 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } -