From: Takashi Iwai <tiwai@suse.de>
To: intel-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org
Cc: Mengdong Lin <mengdong.lin@linux.intel.com>,
Vinod Koul <vinod.koul@intel.com>,
Daniel Vetter <daniel.vetter@intel.com>,
David Henningsson <david.henningsson@canonical.com>
Subject: [PATCH 6/7] ALSA: hda - Do zero-clear in snd_hdmi_parse_eld() itself
Date: Mon, 30 Nov 2015 14:37:50 +0100 [thread overview]
Message-ID: <1448890671-2983-7-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1448890671-2983-1-git-send-email-tiwai@suse.de>
Instead of doing in each caller side, snd_hdmi_parse_eld() does
zero-clear of the parsed data by itself. This is safer and simplifies
the code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/pci/hda/hda_eld.c | 1 +
sound/pci/hda/patch_hdmi.c | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 563984dd2562..bc2e08257c2e 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -253,6 +253,7 @@ int snd_hdmi_parse_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e,
int mnl;
int i;
+ memset(e, 0, sizeof(*e));
e->eld_ver = GRAB_BITS(buf, 0, 3, 5);
if (e->eld_ver != ELD_VER_CEA_861D &&
e->eld_ver != ELD_VER_PARTIAL) {
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 8378c31e0b4f..23a4292c355f 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1628,7 +1628,6 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
&eld->eld_size) < 0)
eld->eld_valid = false;
else {
- memset(&eld->info, 0, sizeof(struct parsed_hdmi_eld));
if (snd_hdmi_parse_eld(codec, &eld->info, eld->eld_buffer,
eld->eld_size) < 0)
eld->eld_valid = false;
@@ -2118,7 +2117,6 @@ static void sync_eld_via_acomp(struct hda_codec *codec,
eld->eld_buffer,
ELD_MAX_SIZE);
if (size > 0) {
- memset(&eld->info, 0, sizeof(eld->info));
if (snd_hdmi_parse_eld(codec, &eld->info,
eld->eld_buffer, size) < 0)
size = -EINVAL;
--
2.6.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-30 13:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 13:37 [PATCH 0/7] Add get_eld audio component for i915/HD-audio Takashi Iwai
2015-11-30 13:37 ` [PATCH 1/7] drm/i915: Remove superfluous NULL check Takashi Iwai
2015-11-30 13:37 ` [PATCH 2/7] drm/i915: Add get_eld audio component Takashi Iwai
2015-11-30 14:11 ` Daniel Vetter
2015-11-30 14:17 ` Daniel Vetter
2015-11-30 15:55 ` Takashi Iwai
2015-11-30 16:31 ` Daniel Vetter
2015-11-30 14:54 ` Takashi Iwai
2015-11-30 15:24 ` Ville Syrjälä
2015-11-30 15:29 ` Takashi Iwai
2015-11-30 15:34 ` David Henningsson
2015-11-30 15:45 ` Takashi Iwai
2015-11-30 16:09 ` Ville Syrjälä
2015-11-30 16:34 ` Daniel Vetter
2015-11-30 16:48 ` Ville Syrjälä
2015-11-30 16:53 ` Takashi Iwai
2015-11-30 13:37 ` [PATCH 3/7] drm/i915: refactoring audio component functions Takashi Iwai
2015-11-30 14:14 ` Daniel Vetter
2015-11-30 14:57 ` Takashi Iwai
2015-11-30 13:37 ` [PATCH 4/7] ALSA: hda - Split ELD update code from hdmi_present_sense() Takashi Iwai
2015-11-30 16:00 ` Vinod Koul
2015-11-30 16:03 ` Takashi Iwai
2015-11-30 13:37 ` [PATCH 5/7] ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling Takashi Iwai
2015-11-30 16:42 ` Vinod Koul
2015-11-30 16:44 ` Takashi Iwai
2015-11-30 13:37 ` Takashi Iwai [this message]
2015-11-30 13:37 ` [PATCH 7/7] ALSA: hda - Skip ELD notification during PM process Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1448890671-2983-7-git-send-email-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=daniel.vetter@intel.com \
--cc=david.henningsson@canonical.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mengdong.lin@linux.intel.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox