Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1025712imm; Wed, 17 Oct 2018 12:03:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV63oJjrEbGsaPDjppqguJgYsz9OUDzsO+R12/W2rggsZXIPjPeZbOv0R/GleURccFShD6VjV X-Received: by 2002:a17:902:5ac9:: with SMTP id g9-v6mr27342459plm.311.1539803007847; Wed, 17 Oct 2018 12:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539803007; cv=none; d=google.com; s=arc-20160816; b=YY6LzfurX5C3t/SlnqhlxsoovmENYAGqnZdU5+kiqTxmU+fMaO7PK2RDA5oDljI3nv u2vmoTk4DBeFRk7dC5vD9Z+3U/nkVugFVZyUmhiiF/v/irP13qUndcGKn71m1U1jtn8S F+Pv3M4Bxw4MmGFYMkhri/uznAMkV5p4oShFZulS5J3AenZJGh+xqNbzdeiYtCAjSkz9 RWyiiMCw6gwca7IuiAyWZROF/XGnwxNasFScL5TFqoWvSdozTb1o0ea1UU7j7Hf5+q/9 KsNGxwNR7D85FVlwuJI/UDbXKxZL5U4qmCR9qwrJimJ6p0c4LGWbEMB8hLAXMaCrN12r HNPQ== 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=mCb56NwLKn0YDT1v9RPFaostXzCcuTilKLiK/kwSjvk=; b=pSvK8mWDRGVcIuGr8dovC8vyAXqzp6Vn3yak/IyuAA65mgGvcyj5yzvw/cT6zaQdS0 UAsJuHfYThBiL6wuQB8VIpV36nDiUmbjHdPV6k2kGivn2NqBLSzA1RtG20K28x7CzoVd 8ESRx9znYdg3XzgqIvjCSUsHdxa6VwP5wnOtkWcDIsf3rDuNdUHnGIVjKRQH2zhZl0WH Iu+P9HSc/jWyXqhslvtjj3LJX61TUMTPOfZgCTidYbRh6n00ECx7A98m/iss2ZSV1Tu/ nn26BaIWDAeczj2ywBluKV1A1g5P9BhmHpq1a9I4GwIMtqeDwXfpZCjP51MR9SJhgWM6 aOZA== 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 w20-v6si18296293pgh.571.2018.10.17.12.03.12; Wed, 17 Oct 2018 12:03:27 -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 S1728405AbeJRC7o (ORCPT + 99 others); Wed, 17 Oct 2018 22:59:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:42514 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727053AbeJRC7Y (ORCPT ); Wed, 17 Oct 2018 22:59:24 -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 0FC80B063; Wed, 17 Oct 2018 19:02:20 +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 4/7] staging: bcm2835-audio: use anonymous union in struct vc_audio_msg Date: Wed, 17 Oct 2018 21:01:53 +0200 Message-Id: <20181017190156.30010-5-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 In this case explicitly naming the union doesn't help overall code comprehension and clutters it. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Takashi Iwai Acked-by: Stefan Wahren --- .../bcm2835-audio/bcm2835-vchiq.c | 30 +++++++++---------- .../bcm2835-audio/vc_vchi_audioserv_defs.h | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 932ef12ac5d2..0db412fd7c55 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -104,15 +104,15 @@ static void audio_vchi_callback(void *param, status = vchi_msg_dequeue(instance->vchi_handle, &m, sizeof(m), &msg_len, VCHI_FLAGS_NONE); if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { - instance->result = m.u.result.success; + instance->result = m.result.success; complete(&instance->msg_avail_comp); } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { - if (m.u.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 || - m.u.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2) + if (m.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 || + m.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2) dev_err(instance->dev, "invalid cookie\n"); else bcm2835_playback_fifo(instance->alsa_stream, - m.u.complete.count); + m.complete.count); } else { dev_err(instance->dev, "unexpected callback type=%d\n", m.type); } @@ -249,11 +249,11 @@ int bcm2835_audio_set_ctls(struct bcm2835_alsa_stream *alsa_stream) struct vc_audio_msg m = {}; m.type = VC_AUDIO_MSG_TYPE_CONTROL; - m.u.control.dest = chip->dest; + m.control.dest = chip->dest; if (!chip->mute) - m.u.control.volume = CHIP_MIN_VOLUME; + m.control.volume = CHIP_MIN_VOLUME; else - m.u.control.volume = alsa2chip(chip->volume); + m.control.volume = alsa2chip(chip->volume); return bcm2835_audio_send_msg(alsa_stream->instance, &m, true); } @@ -264,9 +264,9 @@ int bcm2835_audio_set_params(struct bcm2835_alsa_stream *alsa_stream, { struct vc_audio_msg m = { .type = VC_AUDIO_MSG_TYPE_CONFIG, - .u.config.channels = channels, - .u.config.samplerate = samplerate, - .u.config.bps = bps, + .config.channels = channels, + .config.samplerate = samplerate, + .config.bps = bps, }; int err; @@ -294,7 +294,7 @@ int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream) { struct vc_audio_msg m = { .type = VC_AUDIO_MSG_TYPE_STOP, - .u.stop.draining = 1, + .stop.draining = 1, }; return bcm2835_audio_send_msg(alsa_stream->instance, &m, false); @@ -322,10 +322,10 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream, struct bcm2835_audio_instance *instance = alsa_stream->instance; struct vc_audio_msg m = { .type = VC_AUDIO_MSG_TYPE_WRITE, - .u.write.count = size, - .u.write.max_packet = instance->max_packet, - .u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1, - .u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2, + .write.count = size, + .write.max_packet = instance->max_packet, + .write.cookie1 = VC_AUDIO_WRITE_COOKIE1, + .write.cookie2 = VC_AUDIO_WRITE_COOKIE2, }; unsigned int count; int err, status; diff --git a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h index dc62875cfdca..d6401e914ac9 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h +++ b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h @@ -93,7 +93,7 @@ struct vc_audio_msg { struct vc_audio_write write; struct vc_audio_result result; struct vc_audio_complete complete; - } u; + }; }; #endif /* _VC_AUDIO_DEFS_H_ */ -- 2.19.1