From patchwork Tue Aug 5 13:26:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4679001 X-Patchwork-Delegate: tiwai@suse.de 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 229209F373 for ; Tue, 5 Aug 2014 13:27:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D53B2018B for ; Tue, 5 Aug 2014 13:27:23 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0DC692017A for ; Tue, 5 Aug 2014 13:27:19 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E3E30265043; Tue, 5 Aug 2014 15:27:15 +0200 (CEST) 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, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 297A3262600; Tue, 5 Aug 2014 15:27:05 +0200 (CEST) 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 79FDF264EBF; Tue, 5 Aug 2014 15:27:02 +0200 (CEST) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by alsa0.perex.cz (Postfix) with ESMTP id A7CB92625EA for ; Tue, 5 Aug 2014 15:26:53 +0200 (CEST) Received: by mail-pd0-f177.google.com with SMTP id p10so1350682pdj.22 for ; Tue, 05 Aug 2014 06:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=5yn6oGZbF2haKr1dZLxHJ+vkEASat946qYo9S2V6w7A=; b=FqZ8GBey4AfQ6B4mhRtP7ebwGDXxK6y5vIwQAY8F6Pme2UEzHzAFYzVzsRgbV/aTaE cdeA0tAcnDYi1oLMO+Q7YMGxlnUrb7jfqILjgM7lp9Ezyc37g3irFiGcF7efNbmYACAo foSePhb+GErf8kNV3gNbotVIEiBnHOe0MCfKzP3VARKG/gzLuDQiT27DTgds7eNGdTkK 4rWgYqwaSXm5ZIbo50igxrlXReSeUnWQppljnJ4RfO8xbp65AEkDzUmWEnZr5wvzjO9L xsiGzpBSnJnOeXDUakodepov6TVVYauCfAW/x232lzojafrnj4y8hcNZYQ/c1Nil5IsF UU2g== X-Received: by 10.68.139.36 with SMTP id qv4mr4281882pbb.82.1407245211577; Tue, 05 Aug 2014 06:26:51 -0700 (PDT) Received: from localhost ([14.139.82.6]) by mx.google.com with ESMTPSA id np15sm2967796pdb.84.2014.08.05.06.26.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 06:26:50 -0700 (PDT) Date: Tue, 5 Aug 2014 18:56:47 +0530 From: Himangi Saraogi To: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Message-ID: <20140805132647.GA17360@himangi-Dell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Julia Lawall Subject: [alsa-devel] [PATCH] sound/oss/pss: Remove typedefs pss_mixerdata and pss_confdata 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 The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedefs for pss_mixerdata and pss_confdata. The following Coccinelle semantic patch is used to make the change. @tn@ identifier i; type td; @@ -typedef struct i { ... } -td ; @@ type tn.td; identifier tn.i; @@ -td + struct i Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- sound/oss/pss.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/sound/oss/pss.c b/sound/oss/pss.c index 145e36b..ca0d6e9 100644 --- a/sound/oss/pss.c +++ b/sound/oss/pss.c @@ -123,25 +123,25 @@ static bool pss_mixer; #endif -typedef struct pss_mixerdata { +struct pss_mixerdata { unsigned int volume_l; unsigned int volume_r; unsigned int bass; unsigned int treble; unsigned int synth; -} pss_mixerdata; +}; -typedef struct pss_confdata { +struct pss_confdata { int base; int irq; int dma; int *osp; - pss_mixerdata mixer; + struct pss_mixerdata mixer; int ad_mixer_dev; -} pss_confdata; +}; -static pss_confdata pss_data; -static pss_confdata *devc = &pss_data; +static struct pss_confdata pss_data; +static struct pss_confdata *devc = &pss_data; static DEFINE_SPINLOCK(lock); static int pss_initialized; @@ -150,7 +150,7 @@ static int pss_cdrom_port = -1; /* Parameter for the PSS cdrom port */ static bool pss_enable_joystick; /* Parameter for enabling the joystick */ static coproc_operations pss_coproc_operations; -static void pss_write(pss_confdata *devc, int data) +static void pss_write(struct pss_confdata *devc, int data) { unsigned long i, limit; @@ -206,7 +206,7 @@ static int __init probe_pss(struct address_info *hw_config) return 1; } -static int set_irq(pss_confdata * devc, int dev, int irq) +static int set_irq(struct pss_confdata *devc, int dev, int irq) { static unsigned short irq_bits[16] = { @@ -232,7 +232,7 @@ static int set_irq(pss_confdata * devc, int dev, int irq) return 1; } -static void set_io_base(pss_confdata * devc, int dev, int base) +static void set_io_base(struct pss_confdata *devc, int dev, int base) { unsigned short tmp = inw(REG(dev)) & 0x003f; unsigned short bits = (base & 0x0ffc) << 4; @@ -240,7 +240,7 @@ static void set_io_base(pss_confdata * devc, int dev, int base) outw(bits | tmp, REG(dev)); } -static int set_dma(pss_confdata * devc, int dev, int dma) +static int set_dma(struct pss_confdata *devc, int dev, int dma) { static unsigned short dma_bits[8] = { @@ -264,7 +264,7 @@ static int set_dma(pss_confdata * devc, int dev, int dma) return 1; } -static int pss_reset_dsp(pss_confdata * devc) +static int pss_reset_dsp(struct pss_confdata *devc) { unsigned long i, limit = jiffies + HZ/10; @@ -275,7 +275,7 @@ static int pss_reset_dsp(pss_confdata * devc) return 1; } -static int pss_put_dspword(pss_confdata * devc, unsigned short word) +static int pss_put_dspword(struct pss_confdata *devc, unsigned short word) { int i, val; @@ -291,7 +291,7 @@ static int pss_put_dspword(pss_confdata * devc, unsigned short word) return 0; } -static int pss_get_dspword(pss_confdata * devc, unsigned short *word) +static int pss_get_dspword(struct pss_confdata *devc, unsigned short *word) { int i, val; @@ -307,7 +307,8 @@ static int pss_get_dspword(pss_confdata * devc, unsigned short *word) return 0; } -static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size, int flags) +static int pss_download_boot(struct pss_confdata *devc, unsigned char *block, + int size, int flags) { int i, val, count; unsigned long limit; @@ -397,7 +398,7 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size } /* Mixer */ -static void set_master_volume(pss_confdata *devc, int left, int right) +static void set_master_volume(struct pss_confdata *devc, int left, int right) { static unsigned char log_scale[101] = { 0xdb, 0xe0, 0xe3, 0xe5, 0xe7, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xed, 0xee, @@ -416,7 +417,7 @@ static void set_master_volume(pss_confdata *devc, int left, int right) pss_write(devc, log_scale[right] | 0x0100); } -static void set_synth_volume(pss_confdata *devc, int volume) +static void set_synth_volume(struct pss_confdata *devc, int volume) { int vol = ((0x8000*volume)/100L); pss_write(devc, 0x0080); @@ -425,21 +426,21 @@ static void set_synth_volume(pss_confdata *devc, int volume) pss_write(devc, vol); } -static void set_bass(pss_confdata *devc, int level) +static void set_bass(struct pss_confdata *devc, int level) { int vol = (int)(((0xfd - 0xf0) * level)/100L) + 0xf0; pss_write(devc, 0x0010); pss_write(devc, vol | 0x0200); }; -static void set_treble(pss_confdata *devc, int level) +static void set_treble(struct pss_confdata *devc, int level) { int vol = (((0xfd - 0xf0) * level)/100L) + 0xf0; pss_write(devc, 0x0010); pss_write(devc, vol | 0x0300); }; -static void pss_mixer_reset(pss_confdata *devc) +static void pss_mixer_reset(struct pss_confdata *devc) { set_master_volume(devc, 33, 33); set_bass(devc, 50); @@ -499,7 +500,8 @@ static int ret_vol_stereo(int left, int right) return ((right << 8) | left); } -static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, void __user *arg) +static int call_ad_mixer(struct pss_confdata *devc, unsigned int cmd, + void __user *arg) { if (devc->ad_mixer_dev != NO_WSS_MIXER) return mixer_devs[devc->ad_mixer_dev]->ioctl(devc->ad_mixer_dev, cmd, arg); @@ -509,7 +511,7 @@ static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, void __user *arg) static int pss_mixer_ioctl (int dev, unsigned int cmd, void __user *arg) { - pss_confdata *devc = mixer_devs[dev]->devc; + struct pss_confdata *devc = mixer_devs[dev]->devc; int cmdf = cmd & 0xff; if ((cmdf != SOUND_MIXER_VOLUME) && (cmdf != SOUND_MIXER_BASS) &&