Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5290453imm; Tue, 16 Oct 2018 08:05:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV62swlCqKRG8aqb+4r4UCr+uJUiklZmROgI/yVrZapxIo5fpY1JzrGXJyjzrxLCaTSj5umwa X-Received: by 2002:a17:902:2ec1:: with SMTP id r59-v6mr14948596plb.243.1539702314101; Tue, 16 Oct 2018 08:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539702314; cv=none; d=google.com; s=arc-20160816; b=A2XYkfMJfhXPC7COfk47pRaGZ2i2w4K5fYMAFs6jRCklVo6xoUFtNjxd5e/dqdo5Xb OkDJqFMIkM6rx1+FUEGFUoBtbMhe2S4bhxHXkfQzKhqqFwTTDEEssPaOkxNKSh8A6Gfh JkAeChf8nkVft4pyzRutnkVWgUcuw3PlpnFvu+Ryv53CfeY/185PlDCNHehua2cqNBMW vYD72HfPyZCS/C+CZkDX8hBWh5RPCEycYBeg19sJ33+G68rdwpOLJedGF3Ew1q7xHzsg jCm4IMjYh4ISbcF56wsTbLdR6Q1ILXaYNTUwWax7WF04EeLv+p6uLbaTxkMjLPdWYT9e nvkg== 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=xgo+b5d7gmrH/D0rVqHTJaI2PVQHOg87vmYXyBXGhfg=; b=0OCGE4TLQAZpopchagrm7owhbGEXMwUeYVtTZ18Z/CZawNYO3XeXMvxjJ2+UEBqhmB 0foq46vmEmmf9puaQn+IWhpHLhBS90gQym5mo5ZZy4ACN+rzwueweWdHiV1E/QFK1oue WC9gbTMqVsEiPq4V7x0aH1LfeIp+GvmsPrucPXZWKGbKltCG/E5ADfLdMnvLY088dU8F QxTcX9v9Vr0nNjCc8M9+VbgrYWHQqkHJ9uW0fEHQGOIG1GDf2lSoQ2ldq/4vyw3X3BKj GUZITxf66XtZg6fiLEaBcb/wUy3Ouur/aYx+K0zn5oxCfrlIG66AWqhDjiMLzWz25vpB NVUw== 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 t28-v6si1636166pga.248.2018.10.16.08.04.57; Tue, 16 Oct 2018 08:05:14 -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 S1727361AbeJPWyx (ORCPT + 99 others); Tue, 16 Oct 2018 18:54:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:55672 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726760AbeJPWyu (ORCPT ); Tue, 16 Oct 2018 18:54:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0A0DDB03C; Tue, 16 Oct 2018 15:03:57 +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, devicetree@vger.kernel.org, robh+dt@kernel.org, tiwai@suse.de, nsaenzjulienne@suse.de Subject: [PATCH 3/9] staging: bcm2835-audio: reorder variable declarations & remove trivial comments Date: Tue, 16 Oct 2018 17:02:22 +0200 Message-Id: <20181016150228.16994-4-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016150228.16994-1-nsaenzjulienne@suse.de> References: <20181016150228.16994-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 --- .../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