public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards
@ 2024-03-07 11:12 Richard Fitzgerald
  2024-03-07 11:12 ` [PATCH 2/2] ALSA: hda: hda_component: Include sound/hda_codec.h Richard Fitzgerald
  2024-03-07 16:28 ` [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2024-03-07 11:12 UTC (permalink / raw)
  To: tiwai; +Cc: linux-sound, alsa-devel, linux-kernel, patches,
	Richard Fitzgerald

Add the conventional include guards around the content of the
hda_component.h header file. This prevents double-declaration of
struct hda_component if the header gets included multiple times.

This isn't causing any problems with current code, so no need to
backport to older kernels.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/pci/hda/hda_component.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/pci/hda/hda_component.h b/sound/pci/hda/hda_component.h
index deae9dea01b4..a0fcc723483d 100644
--- a/sound/pci/hda/hda_component.h
+++ b/sound/pci/hda/hda_component.h
@@ -6,6 +6,9 @@
  *                    Cirrus Logic International Semiconductor Ltd.
  */
 
+#ifndef __HDA_COMPONENT_H__
+#define __HDA_COMPONENT_H__
+
 #include <linux/acpi.h>
 #include <linux/component.h>
 
@@ -82,3 +85,5 @@ static inline void hda_component_manager_unbind(struct hda_codec *cdc,
 {
 	component_unbind_all(hda_codec_dev(cdc), comps);
 }
+
+#endif /* ifndef __HDA_COMPONENT_H__ */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ALSA: hda: hda_component: Include sound/hda_codec.h
  2024-03-07 11:12 [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards Richard Fitzgerald
@ 2024-03-07 11:12 ` Richard Fitzgerald
  2024-03-07 16:28 ` [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2024-03-07 11:12 UTC (permalink / raw)
  To: tiwai; +Cc: linux-sound, alsa-devel, linux-kernel, patches,
	Richard Fitzgerald

hda_component.h uses hda_codec_dev from sound/hda_codec.h.
Include sound/hda_codec.h instead of assuming that it has already
been included by the parent .c file.

This isn't causing any problems with current code, so no need to
backport to older kernels.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/pci/hda/hda_component.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/hda_component.h b/sound/pci/hda/hda_component.h
index a0fcc723483d..c80a66691b5d 100644
--- a/sound/pci/hda/hda_component.h
+++ b/sound/pci/hda/hda_component.h
@@ -11,6 +11,7 @@
 
 #include <linux/acpi.h>
 #include <linux/component.h>
+#include <sound/hda_codec.h>
 
 #define HDA_MAX_COMPONENTS	4
 #define HDA_MAX_NAME_SIZE	50
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards
  2024-03-07 11:12 [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards Richard Fitzgerald
  2024-03-07 11:12 ` [PATCH 2/2] ALSA: hda: hda_component: Include sound/hda_codec.h Richard Fitzgerald
@ 2024-03-07 16:28 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2024-03-07 16:28 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: tiwai, linux-sound, alsa-devel, linux-kernel, patches

On Thu, 07 Mar 2024 12:12:15 +0100,
Richard Fitzgerald wrote:
> 
> Add the conventional include guards around the content of the
> hda_component.h header file. This prevents double-declaration of
> struct hda_component if the header gets included multiple times.
> 
> This isn't causing any problems with current code, so no need to
> backport to older kernels.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>

Applied both patches now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-08  3:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07 11:12 [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards Richard Fitzgerald
2024-03-07 11:12 ` [PATCH 2/2] ALSA: hda: hda_component: Include sound/hda_codec.h Richard Fitzgerald
2024-03-07 16:28 ` [PATCH 1/2] ALSA: hda: hda_component: Add missing #include guards Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox