From patchwork Sat Jan 30 10:18:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8170541 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 476739F6DA for ; Sat, 30 Jan 2016 10:18:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA8892039E for ; Sat, 30 Jan 2016 10:18:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CED4820125 for ; Sat, 30 Jan 2016 10:18:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C0256264EBF; Sat, 30 Jan 2016 11:18:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 470BA261AA3; Sat, 30 Jan 2016 11:18:45 +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 718FE261AD0; Sat, 30 Jan 2016 11:18:43 +0100 (CET) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by alsa0.perex.cz (Postfix) with ESMTP id 0EFC4261A7C for ; Sat, 30 Jan 2016 11:18:36 +0100 (CET) Received: by mail-pf0-f193.google.com with SMTP id x125so5020542pfb.0 for ; Sat, 30 Jan 2016 02:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=bs+QHQIoYBUFvKyarB/EcyRa04hhkWK7xy/ZNxxNBS8=; b=FJJcOLm4R2PJEp1UVB8ydPJBRSaJQJwREMu/e/I+ainiOrMSAsMk195EKvwW0yG8py nAZG1ojLTITHrsEhJzoLWa7D61HGYWUSbOC5AgMyg6vtASu29Y30oJ727EnABJhjkXfA TIkwIyvesykI00y15Au00z1efgAU1S6iNBnIp+4DoiyQfbGuyT+y8+0XUyJV6SuV54yf 9+l3ydJQElX1l1pJwZcxHdlBCBZlR9RVRvxfTh6GL+EOlt1r+AYuDRNH5v5xyISoSE55 2VU48qlVj+P1xq3dLCfvxHbOI75X9uuF50gCgTe18bP2M5EBa2UZFjx7CWKXBH1G+Bgt nj3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=bs+QHQIoYBUFvKyarB/EcyRa04hhkWK7xy/ZNxxNBS8=; b=cxQ+H9qgKapeFZ2vT13D2M0TzMswxWq54dVnvX6LXc74uvgz1UByJLj44QFy5XtDdS KemlGSWXTMCGNv//y7jcqGRdBuiwsh54CFFJxlo1nfe05flPUmthU+7lVkTIltZKlaCB mSFH1ZTAhhto4PApmHXPWEDZaQifp9cSz3tNVPAEt0J/qqrW/HPAC1g+D71u7LfYpl1j TZ+kd+SQDG4yHJU61yFMl0t3YrgtvJfvprIWiAs907yYQw4ke5tqsnvx+7mvMsg//NfE dd5J1EnKJAM8JQ9noLgXSAKc+XPHWkE7havQi23/tHD2cZNIRmxCku7v7bSbe4uPmUYL 4dCg== X-Gm-Message-State: AG10YOT9wbo/QrPmCuNwehbB5ohZ6uz/BwuM41prKPC2+RTCW54IF3Vhz+1oMmiZPDo87A== X-Received: by 10.98.9.75 with SMTP id e72mr20593613pfd.29.1454149114871; Sat, 30 Jan 2016 02:18:34 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.136]) by smtp.gmail.com with ESMTPSA id s19sm29335561pfs.62.2016.01.30.02.18.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Jan 2016 02:18:33 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Sat, 30 Jan 2016 15:48:23 +0530 Message-Id: <1454149105-17474-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH v2 1/3] ALSA: mts64: whitespace fixes 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 checkpatch was complaining about trailing whitespace, multiple blank lines, space before start of a line and a required space before opening brace. This patch takes care of these issues related to whitespace changes and there was no other change. Signed-off-by: Sudip Mukherjee --- v2: combined 3 patches of v1 series into this patch. sound/drivers/mts64.c | 112 ++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 58 deletions(-) diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 2a008a9..f7d938d 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -1,14 +1,14 @@ -/* +/* * ALSA Driver for Ego Systems Inc. (ESI) Miditerminal 4140 * Copyright (c) 2006 by Matthias König * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * @@ -38,7 +38,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; -static struct platform_device *platform_devices[SNDRV_CARDS]; +static struct platform_device *platform_devices[SNDRV_CARDS]; static int device_count; module_param_array(index, int, NULL, S_IRUGO); @@ -92,7 +92,7 @@ static int snd_mts64_create(struct snd_card *card, *rchip = NULL; mts = kzalloc(sizeof(struct mts64), GFP_KERNEL); - if (mts == NULL) + if (mts == NULL) return -ENOMEM; /* Init chip specific data */ @@ -118,9 +118,9 @@ static int snd_mts64_create(struct snd_card *card, /* Control Bits */ #define MTS64_CTL_READOUT 0x08 /* enable readout */ -#define MTS64_CTL_WRITE_CMD 0x06 -#define MTS64_CTL_WRITE_DATA 0x02 -#define MTS64_CTL_STROBE 0x01 +#define MTS64_CTL_WRITE_CMD 0x06 +#define MTS64_CTL_WRITE_DATA 0x02 +#define MTS64_CTL_STROBE 0x01 /* Command */ #define MTS64_CMD_RESET 0xfe @@ -130,7 +130,7 @@ static int snd_mts64_create(struct snd_card *card, #define MTS64_CMD_SMPTE_STOP 0xef #define MTS64_CMD_SMPTE_FPS_24 0xe3 #define MTS64_CMD_SMPTE_FPS_25 0xe2 -#define MTS64_CMD_SMPTE_FPS_2997 0xe4 +#define MTS64_CMD_SMPTE_FPS_2997 0xe4 #define MTS64_CMD_SMPTE_FPS_30D 0xe1 #define MTS64_CMD_SMPTE_FPS_30 0xe0 #define MTS64_CMD_COM_OPEN 0xf8 /* setting the communication mode */ @@ -159,7 +159,6 @@ static void mts64_write_command(struct parport *p, u8 c); static void mts64_write_data(struct parport *p, u8 c); static void mts64_write_midi(struct mts64 *mts, u8 c, int midiport); - /* Enables the readout procedure * * Before we can read a midi byte from the device, we have to set @@ -171,10 +170,10 @@ static void mts64_enable_readout(struct parport *p) c = parport_read_control(p); c |= MTS64_CTL_READOUT; - parport_write_control(p, c); + parport_write_control(p, c); } -/* Disables readout +/* Disables readout * * Readout is disabled by clearing bit 3 of control */ @@ -201,9 +200,9 @@ static int mts64_device_ready(struct parport *p) for (i = 0; i < 0xffff; ++i) { c = parport_read_status(p); c &= MTS64_STAT_BSY; - if (c != 0) + if (c != 0) return 1; - } + } return 0; } @@ -234,7 +233,7 @@ static int mts64_device_init(struct parport *p) return -EIO; } -/* +/* * Opens the device (set communication mode) */ static int mts64_device_open(struct mts64 *mts) @@ -248,7 +247,7 @@ static int mts64_device_open(struct mts64 *mts) return 0; } -/* +/* * Close device (clear communication mode) */ static int mts64_device_close(struct mts64 *mts) @@ -265,14 +264,14 @@ static int mts64_device_close(struct mts64 *mts) } /* map hardware port to substream number - * + * * When reading a byte from the device, the device tells us * on what port the byte is. This HW port has to be mapped to * the midiport (substream number). * substream 0-3 are Midiports 1-4 * substream 4 is SMPTE Timecode * The mapping is done by the table: - * HW | 0 | 1 | 2 | 3 | 4 + * HW | 0 | 1 | 2 | 3 | 4 * SW | 0 | 1 | 4 | 2 | 3 */ static u8 mts64_map_midi_input(u8 c) @@ -282,10 +281,9 @@ static u8 mts64_map_midi_input(u8 c) return map[c]; } - /* Probe parport for device * - * Do we have a Miditerminal 4140 on parport? + * Do we have a Miditerminal 4140 on parport? * Returns: * 0 device found * -ENODEV no device @@ -298,13 +296,13 @@ static int mts64_probe(struct parport *p) mts64_write_command(p, MTS64_CMD_PROBE); msleep(50); - + c = mts64_read(p); c &= 0x00ff; - if (c != MTS64_CMD_PROBE) + if (c != MTS64_CMD_PROBE) return -ENODEV; - else + else return 0; } @@ -330,7 +328,7 @@ static u16 mts64_read(struct parport *p) /* Read a byte from device * * Note, that readout mode has to be enabled. - * readout procedure is as follows: + * readout procedure is as follows: * - Write number of the Bit to read to DATA * - Read STATUS * - Bit 5 of STATUS indicates if Bit is set @@ -348,10 +346,10 @@ static u8 mts64_read_char(struct parport *p) parport_write_data(p, i); c >>= 1; status = parport_read_status(p); - if (status & MTS64_STAT_BIT_SET) + if (status & MTS64_STAT_BIT_SET) c |= 0x80; } - + return c; } @@ -369,9 +367,9 @@ static void mts64_smpte_start(struct parport *p, u8 seconds, u8 frames, u8 idx) { - static u8 fps[5] = { MTS64_CMD_SMPTE_FPS_24, + static u8 fps[5] = { MTS64_CMD_SMPTE_FPS_24, MTS64_CMD_SMPTE_FPS_25, - MTS64_CMD_SMPTE_FPS_2997, + MTS64_CMD_SMPTE_FPS_2997, MTS64_CMD_SMPTE_FPS_30D, MTS64_CMD_SMPTE_FPS_30 }; @@ -405,7 +403,7 @@ static void mts64_write_command(struct parport *p, u8 c) parport_write_control(p, MTS64_CTL_WRITE_CMD); } -/* Write a data byte to device +/* Write a data byte to device */ static void mts64_write_data(struct parport *p, u8 c) { @@ -652,7 +650,6 @@ static struct snd_kcontrol_new mts64_ctl_smpte_fps = { .put = snd_mts64_ctl_smpte_fps_put }; - static int snd_mts64_ctl_create(struct snd_card *card, struct mts64 *mts) { @@ -669,7 +666,7 @@ static int snd_mts64_ctl_create(struct snd_card *card, for (i = 0; control[i]; ++i) { err = snd_ctl_add(card, snd_ctl_new1(control[i], mts)); if (err < 0) { - snd_printd("Cannot create control: %s\n", + snd_printd("Cannot create control: %s\n", control[i]->name); return err; } @@ -688,8 +685,8 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream) struct mts64 *mts = substream->rmidi->private_data; if (mts->open_count == 0) { - /* We don't need a spinlock here, because this is just called - if the device has not been opened before. + /* We don't need a spinlock here, because this is just called + if the device has not been opened before. So there aren't any IRQs from the device */ mts64_device_open(mts); @@ -746,8 +743,8 @@ static void snd_mts64_rawmidi_input_trigger(struct snd_rawmidi_substream *substr if (up) mts->mode[substream->number] |= MTS64_MODE_INPUT_TRIGGERED; else - mts->mode[substream->number] &= ~MTS64_MODE_INPUT_TRIGGERED; - + mts->mode[substream->number] &= ~MTS64_MODE_INPUT_TRIGGERED; + spin_unlock_irqrestore(&mts->lock, flags); } @@ -771,42 +768,42 @@ static int snd_mts64_rawmidi_create(struct snd_card *card) struct snd_rawmidi_substream *substream; struct list_head *list; int err; - - err = snd_rawmidi_new(card, CARD_NAME, 0, - MTS64_NUM_OUTPUT_PORTS, - MTS64_NUM_INPUT_PORTS, + + err = snd_rawmidi_new(card, CARD_NAME, 0, + MTS64_NUM_OUTPUT_PORTS, + MTS64_NUM_INPUT_PORTS, &rmidi); - if (err < 0) + if (err < 0) return err; rmidi->private_data = mts; strcpy(rmidi->name, CARD_NAME); rmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT | - SNDRV_RAWMIDI_INFO_INPUT | - SNDRV_RAWMIDI_INFO_DUPLEX; + SNDRV_RAWMIDI_INFO_INPUT | + SNDRV_RAWMIDI_INFO_DUPLEX; mts->rmidi = rmidi; /* register rawmidi ops */ - snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, + snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_mts64_rawmidi_output_ops); - snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, + snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_mts64_rawmidi_input_ops); /* name substreams */ /* output */ - list_for_each(list, + list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) { substream = list_entry(list, struct snd_rawmidi_substream, list); sprintf(substream->name, "Miditerminal %d", substream->number+1); } /* input */ - list_for_each(list, + list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) { substream = list_entry(list, struct snd_rawmidi_substream, list); mts->midi_input_substream[substream->number] = substream; - switch(substream->number) { + switch (substream->number) { case MTS64_SMPTE_SUBSTREAM: strcpy(substream->name, "Miditerminal SMPTE"); break; @@ -840,7 +837,7 @@ static void snd_mts64_interrupt(void *private) if (status & MTS64_STAT_PORT) { mts->current_midi_input_port = mts64_map_midi_input(data); } else { - if (mts->current_midi_input_port == -1) + if (mts->current_midi_input_port == -1) goto __out; substream = mts->midi_input_substream[mts->current_midi_input_port]; if (mts->mode[substream->number] & MTS64_MODE_INPUT_TRIGGERED) @@ -860,7 +857,7 @@ static int snd_mts64_probe_port(struct parport *p) 0, NULL); if (!pardev) return -EIO; - + if (parport_claim(pardev)) { parport_unregister_device(pardev); return -EIO; @@ -944,7 +941,7 @@ static int snd_mts64_probe(struct platform_device *pdev) if (dev >= SNDRV_CARDS) return -ENODEV; - if (!enable[dev]) + if (!enable[dev]) return -ENOENT; if ((err = snd_mts64_probe_port(p)) < 0) return err; @@ -957,7 +954,7 @@ static int snd_mts64_probe(struct platform_device *pdev) } strcpy(card->driver, DRIVER_NAME); strcpy(card->shortname, "ESI " CARD_NAME); - sprintf(card->longname, "%s at 0x%lx, irq %i", + sprintf(card->longname, "%s at 0x%lx, irq %i", card->shortname, p->base, p->irq); pardev = parport_register_device(p, /* port */ @@ -980,7 +977,7 @@ static int snd_mts64_probe(struct platform_device *pdev) } card->private_data = mts; card->private_free = snd_mts64_card_private_free; - + if ((err = snd_mts64_rawmidi_create(card)) < 0) { snd_printd("Creating Rawmidi component failed\n"); goto __err; @@ -1024,7 +1021,6 @@ static int snd_mts64_remove(struct platform_device *pdev) return 0; } - static struct platform_driver snd_mts64_driver = { .probe = snd_mts64_probe, .remove = snd_mts64_remove, @@ -1045,7 +1041,7 @@ static void snd_mts64_unregister_all(void) platform_device_unregister(platform_devices[i]); platform_devices[i] = NULL; } - } + } platform_driver_unregister(&snd_mts64_driver); parport_unregister_driver(&mts64_parport_driver); }