Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5292594imm; Tue, 16 Oct 2018 08:06:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ivllFOjQ543ovASGcElPlpskrs15+uXIBHDJf4CpHQSB3epelQ9bmz6t4b6Jj0gCvRS2g X-Received: by 2002:a17:902:e088:: with SMTP id cb8-v6mr22041004plb.31.1539702408994; Tue, 16 Oct 2018 08:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539702408; cv=none; d=google.com; s=arc-20160816; b=QsTZWRYM2JgeaxDKqmnKgkL8dtJiOkRD3AkbNL6RYprrQ5vv733fMAwu2kgNp2pcXU onknNcnGf+PhIoGbTZ3hRiU44O1GsRib7ZO1caQP51RiM2+A/5o6Lvbp6K4XnSHDM4aI TFpESGRMCV+18OBOnJSkUeVrv7+wVc4AnwLj8wTwzr49M3qr3T9UC3/6v23tfBrOUjIb 9n4btHWDGOQZPOciJe8eMPYq1jvSP9UIIQZ23xpi3kvwkRjtMcLdZhQq/fq7qzNiEHu3 kHZT/w0qssm6L0MvXj7M117DV74LaZetKniafKtkv4v/rTSLgNdg72PikLGpXjoRzoyf DEtw== 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=uAZGMJBmhXB1wh5OWU6N13xZUqsYWaRT5WrA0O0380Q=; b=xlekP++m84bzklHnV1evxEjPlRCUNp7/D1C+cH0oAMPdJXo1RiczE/+1Y/RdDwN0Ab ncLbkhL6GQOmS+RDQdDW8rpioS1YNBfv9nOSDDZT6Ml4B2FRKmXSu7A89O7dFE6L5MF8 tmZqjYBpIDZAuihCQs4mFQy6qZtm/Gwt0XFfXz8LIGbMeGhEUMmbdP2Vfh97438+M1X5 zlsMe/+52UC1XEu+LjG9wdt31tfMgvTuwHJWAvyHHJ64IHz/sYq5QWRrRfmcZor59Vgu p6vSZQGa4RyuiV/fm2hJdxVYLuJq1oab1HxbDyZc4RLPQy7kkvrSj+nxyZN83DqIM91Q vwgw== 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 p126-v6si14915283pfp.234.2018.10.16.08.06.30; Tue, 16 Oct 2018 08:06:48 -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 S1727294AbeJPWyw (ORCPT + 99 others); Tue, 16 Oct 2018 18:54:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:55696 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727059AbeJPWyv (ORCPT ); Tue, 16 Oct 2018 18:54:51 -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 B5BC2B06D; 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 4/9] staging: bcm2835-audio: use anonymous union in struct vc_audio_msg Date: Tue, 16 Oct 2018 17:02:23 +0200 Message-Id: <20181016150228.16994-5-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 In this case explicitly naming the union doesn't help overall code comprehension and clutters it. Signed-off-by: Nicolas Saenz Julienne --- .../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