From patchwork Sat Sep 13 08:52:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Schaefer X-Patchwork-Id: 25916 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1XSj2w-0002RV-ES; Sat, 13 Sep 2014 10:51:06 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtp id 1XSj2u-0007eu-0Z; Sat, 13 Sep 2014 10:51:06 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751763AbaIMIvB (ORCPT + 1 other); Sat, 13 Sep 2014 04:51:01 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:37911 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751447AbaIMIu7 (ORCPT ); Sat, 13 Sep 2014 04:50:59 -0400 Received: by mail-lb0-f181.google.com with SMTP id z11so2096998lbi.40 for ; Sat, 13 Sep 2014 01:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=zNWmhcbAKGS2S5YubHOaNx7GVM62sy6/Xx+AOJLJe04=; b=SDgn11Rt3ofMSV3hI5cudVZkQbKqIAnCFrXdav0e2iCNkZI2nnUD9mFVD8eZo1LgZT sHcc6XFi55IaikDl6Cc3dvgUxdjaMUolyhUf5ThaPHKL0TrbIGWelfIoUVXJgT8+Hzw5 /vSF9HEhcZUAOP0HeT/fwTRaOlqko8rZmcoKFddamZPRrK40XPS6yKoNlSVhXrPNmhZX sRJK/9S9UrXhDIhwQcMsfrGwonYxvwra+9A/fU1GsWvbgz8PjFlNrQDBIst1dRorBWem V8NJ2qGFSHDU9wSSFDAEhzLZYnpY/BAdo6rVuCBdhzB8xKTjVo+E/Yb9FJ1N+263U4Ep CBcw== X-Received: by 10.112.209.37 with SMTP id mj5mr13942206lbc.55.1410598257800; Sat, 13 Sep 2014 01:50:57 -0700 (PDT) Received: from Athlon64X2-5000.site (ip-178-201-166-123.hsi08.unitymediagroup.de. [178.201.166.123]) by mx.google.com with ESMTPSA id nx9sm1299601lbb.23.2014.09.13.01.50.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Sep 2014 01:50:57 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 1/4] em28xx: remove some unnecessary fields from struct em28xx_audio_mode Date: Sat, 13 Sep 2014 10:52:19 +0200 Message-Id: <1410598342-31094-1-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.9.13.83920 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' Fields "ac97_feat", "ac97_vendor_id" and "i2s_samplerates" of struct em28xx_audio_mode are used nowhere, except in function em28xx_audio_setup(). So get rid of them and use local variables instead. Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-core.c | 14 ++++++-------- drivers/media/usb/em28xx/em28xx.h | 6 ------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 2f82e92..0fe05ff 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -505,6 +505,7 @@ int em28xx_audio_setup(struct em28xx *dev) { int vid1, vid2, feat, cfg; u32 vid; + u8 i2s_samplerates; if (dev->chip_id == CHIP_ID_EM2870 || dev->chip_id == CHIP_ID_EM2874 || @@ -534,15 +535,15 @@ int em28xx_audio_setup(struct em28xx *dev) if (dev->chip_id < CHIP_ID_EM2860 && (cfg & EM28XX_CHIPCFG_AUDIOMASK) == EM2820_CHIPCFG_I2S_1_SAMPRATE) - dev->audio_mode.i2s_samplerates = 1; + i2s_samplerates = 1; else if (dev->chip_id >= CHIP_ID_EM2860 && (cfg & EM28XX_CHIPCFG_AUDIOMASK) == EM2860_CHIPCFG_I2S_5_SAMPRATES) - dev->audio_mode.i2s_samplerates = 5; + i2s_samplerates = 5; else - dev->audio_mode.i2s_samplerates = 3; + i2s_samplerates = 3; em28xx_info("I2S Audio (%d sample rate(s))\n", - dev->audio_mode.i2s_samplerates); + i2s_samplerates); /* Skip the code that does AC97 vendor detection */ dev->audio_mode.ac97 = EM28XX_NO_AC97; goto init_audio; @@ -569,15 +570,12 @@ int em28xx_audio_setup(struct em28xx *dev) goto init_audio; vid = vid1 << 16 | vid2; - - dev->audio_mode.ac97_vendor_id = vid; em28xx_warn("AC97 vendor ID = 0x%08x\n", vid); feat = em28xx_read_ac97(dev, AC97_RESET); if (feat < 0) goto init_audio; - dev->audio_mode.ac97_feat = feat; em28xx_warn("AC97 features = 0x%04x\n", feat); /* Try to identify what audio processor we have */ @@ -597,7 +595,7 @@ init_audio: break; case EM28XX_AC97_SIGMATEL: - em28xx_info("Sigmatel audio processor detected(stac 97%02x)\n", - dev->audio_mode.ac97_vendor_id & 0xff); + em28xx_info("Sigmatel audio processor detected (stac 97%02x)\n", + vid & 0xff); break; case EM28XX_AC97_OTHER: em28xx_warn("Unknown AC97 audio processor detected!\n"); diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 84ef8ef..1f38163 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -309,13 +309,7 @@ enum em28xx_ac97_mode { struct em28xx_audio_mode { enum em28xx_ac97_mode ac97; - - u16 ac97_feat; - u32 ac97_vendor_id; - unsigned int has_audio:1; - - u8 i2s_samplerates; }; /* em28xx has two audio inputs: tuner and line in.