ALSA: hda - Optimize audio component check in patch_hdmi.c
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Dec 2015 12:01:28 +0000 (13:01 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Dec 2015 12:01:28 +0000 (13:01 +0100)
The audio component is enabled only when CONFIG_SND_HDA_I915 is set.
Give a dummy macro for allowing the compiler optimize out the relevant
codes when this Kconfig isn't set.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_hdmi.c

index 85342d261043325c5084fd8a8723de22e67815d8..44d0d2374bb67ecc735a7075d7c262e336090318 100644 (file)
@@ -152,8 +152,12 @@ struct hdmi_spec {
        struct i915_audio_component_audio_ops i915_audio_ops;
 };
 
+#ifdef CONFIG_SND_HDA_I915
 #define codec_has_acomp(codec) \
        ((codec)->bus->core.audio_component != NULL)
+#else
+#define codec_has_acomp(codec) false
+#endif
 
 struct hdmi_audio_infoframe {
        u8 type; /* 0x84 */