Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1025439imm; Wed, 17 Oct 2018 12:03:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV62dthqMgIeaUYPPIstDG4U1kzJh7jZWyIdv8NaTc3Vafnxf6V7x+CY1Pq5IBwnu2ToQ93f0 X-Received: by 2002:a62:ca4d:: with SMTP id n74-v6mr27108664pfg.10.1539802992987; Wed, 17 Oct 2018 12:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539802992; cv=none; d=google.com; s=arc-20160816; b=w/DsOVEyDUBb5gC4OZqpt6VsOdVTpClVdQgEm0Exq86BulKdeS6oxwUH8hALlpOihW 1QvArmbBUpn1TYKOrqcIgvxJjHNlVHfyjGJ1AADuiUdnrwSjPcixSutPHoFWbVp+8Rxm fhqnm4Tm8mQEk1rDinIr/1KVwT1r7F44sO9W7FutyNk1RYFBB+N6UietJuSSbnrBCOG7 9++5S+Jf5N3xukEvk/mocxroxVT8fhSl+L02vGE+fe92/E42el5/Hr4SoZQke+0+Y9C1 IpXQ3+f0Jvs9JHDywUwo5RK2mgT5Oah9s6WvaHesrHfoi/L1GHK48qTCQCernxqihIhq kGow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0ETCssSp8A7L7WGFnDpTUTVSs6gEKMILvZDpjniN+jQ=; b=dT6qGO6/g2wgODN4G9nGZeqVHuIFlt+ffqtyPowFV99vY/SZ4ldWhcm/XvWYDCPHRH E7C9bV4UVsbVMKvvDWxQ4f+uh5gKZ36RkOZwPslpxlSuX3jqXnW7ZbIIBmnnDtiosIxw W3SZ95zL64C5amrZDAJLj9FChLBxkYBp3zjl/gGPN/9mpVXDD/XXiG+YZn/WgslnD6df fyrxK08dmVJekPMcQKNJQEkjvvNyNWsiXHvvrL09LQdzKVkFexssbwCrI2BmZFQVi8mh mI0FiNqMmp3D7rkrfdT0Iwwg9xK7hG86Z0r48a5HKmYDWz1ZRhGedkgA8K0QklT2fsi0 GKkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11-v6si18185893pgi.139.2018.10.17.12.02.57; Wed, 17 Oct 2018 12:03:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728374AbeJRC7Z (ORCPT + 99 others); Wed, 17 Oct 2018 22:59:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:42498 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728181AbeJRC7Y (ORCPT ); Wed, 17 Oct 2018 22:59:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 853A0B060; Wed, 17 Oct 2018 19:02:19 +0000 (UTC) From: Nicolas Saenz Julienne To: gregkh@linuxfoundation.org Cc: eric@anholt.net, stefan.wahren@i2se.com, linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tiwai@suse.de, nsaenzjulienne@suse.de, devel@driverdev.osuosl.org Subject: [PATCH v2 3/7] staging: bcm2835-audio: reorder variable declarations & remove trivial comments Date: Wed, 17 Oct 2018 21:01:52 +0200 Message-Id: <20181017190156.30010-4-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181017190156.30010-1-nsaenzjulienne@suse.de> References: <20181017190156.30010-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When it comes to declaring variables it's preferred, when possible, to use an inverted tree organization scheme. Also, removes some comments that were useless. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Takashi Iwai Acked-by: Stefan Wahren --- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 10 ++-------- .../vc04_services/bcm2835-audio/bcm2835-vchiq.c | 4 ++-- .../staging/vc04_services/bcm2835-audio/bcm2835.c | 14 +++++++------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c index e66da11af5cf..98b6977bdce7 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c @@ -164,14 +164,11 @@ static int snd_bcm2835_playback_spdif_open(struct snd_pcm_substream *substream) return snd_bcm2835_playback_open_generic(substream, 1); } -/* close callback */ static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream) { - /* the hardware-specific codes will be here */ - - struct bcm2835_chip *chip; - struct snd_pcm_runtime *runtime; struct bcm2835_alsa_stream *alsa_stream; + struct snd_pcm_runtime *runtime; + struct bcm2835_chip *chip; chip = snd_pcm_substream_chip(substream); mutex_lock(&chip->audio_mutex); @@ -195,20 +192,17 @@ static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream) return 0; } -/* hw_params callback */ static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); } -/* hw_free callback */ static int snd_bcm2835_pcm_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -/* prepare callback */ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) { struct bcm2835_chip *chip = snd_pcm_substream_chip(substream); diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index aca7008e1921..932ef12ac5d2 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -94,9 +94,9 @@ static void audio_vchi_callback(void *param, void *msg_handle) { struct bcm2835_audio_instance *instance = param; - int status; - int msg_len; struct vc_audio_msg m; + int msg_len; + int status; if (reason != VCHI_CALLBACK_MSG_AVAILABLE) return; diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c index 0efae7068fef..6ee8334dfc81 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c @@ -161,8 +161,8 @@ static int snd_add_child_device(struct device *dev, struct bcm2835_audio_driver *audio_driver, u32 numchans) { - struct snd_card *card; struct bcm2835_chip *chip; + struct snd_card *card; int err; err = snd_card_new(dev, -1, NULL, THIS_MODULE, sizeof(*chip), &card); @@ -225,12 +225,12 @@ static int snd_add_child_device(struct device *dev, static int snd_add_child_devices(struct device *device, u32 numchans) { - int i; - int count_devices = 0; - int minchannels = 0; - int extrachannels = 0; int extrachannels_per_driver = 0; int extrachannels_remainder = 0; + int count_devices = 0; + int extrachannels = 0; + int minchannels = 0; + int i; for (i = 0; i < ARRAY_SIZE(children_devices); i++) if (*children_devices[i].is_enabled) @@ -258,9 +258,9 @@ static int snd_add_child_devices(struct device *device, u32 numchans) extrachannels_remainder); for (i = 0; i < ARRAY_SIZE(children_devices); i++) { - int err; - int numchannels_this_device; struct bcm2835_audio_driver *audio_driver; + int numchannels_this_device; + int err; if (!*children_devices[i].is_enabled) continue; -- 2.19.1