ASoC: hdmi-codec: use sizeof_field rather than declaring hcp
authorColin Ian King <colin.king@canonical.com>
Mon, 18 Sep 2017 09:48:43 +0000 (10:48 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 19 Sep 2017 11:57:32 +0000 (12:57 +0100)
Use FIELD_SIZEOF rather than declaring and initializing hcp. Remove
unused variables. Cleans up clang warning:

warning: Value stored to 'hcp' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdmi-codec.c

index 3abf825..5672e51 100644 (file)
@@ -303,11 +303,8 @@ enum {
 static int hdmi_eld_ctl_info(struct snd_kcontrol *kcontrol,
                             struct snd_ctl_elem_info *uinfo)
 {
-       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
-       struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
-
        uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
-       uinfo->count = sizeof(hcp->eld);
+       uinfo->count = FIELD_SIZEOF(struct hdmi_codec_priv, eld);
 
        return 0;
 }