diff mbox series

pcxhr: "fix" PCXHR_REG_TO_PORT definition

Message ID YUCCv47sm4zf9OVO@localhost.localdomain
State New
Headers show
Series pcxhr: "fix" PCXHR_REG_TO_PORT definition | expand

Commit Message

Alexey Dobriyan Sept. 14, 2021, 11:08 a.m. UTC
The following preprocessor directive is non-compliant:

	#undef PCXHR_REG_TO_PORT(x)

gcc warns about extra tokens but nobody sees them as they are under if
branch which is never parsed.

Make it an #error, it is not clear to me what the author meant.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 sound/pci/pcxhr/pcxhr_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Takashi Iwai Sept. 16, 2021, 9:09 a.m. UTC | #1
On Tue, 14 Sep 2021 13:08:47 +0200,
Alexey Dobriyan wrote:
> 
> The following preprocessor directive is non-compliant:
> 
> 	#undef PCXHR_REG_TO_PORT(x)
> 
> gcc warns about extra tokens but nobody sees them as they are under if
> branch which is never parsed.
> 
> Make it an #error, it is not clear to me what the author meant.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Thanks, applied.


Takashi
diff mbox series

Patch

--- a/sound/pci/pcxhr/pcxhr_core.c
+++ b/sound/pci/pcxhr/pcxhr_core.c
@@ -52,7 +52,7 @@ 
 #define PCXHR_DSP 2
 
 #if (PCXHR_DSP_OFFSET_MAX > PCXHR_PLX_OFFSET_MIN)
-#undef  PCXHR_REG_TO_PORT(x)
+#error  PCXHR_REG_TO_PORT(x)
 #else
 #define PCXHR_REG_TO_PORT(x)	((x)>PCXHR_DSP_OFFSET_MAX ? PCXHR_PLX : PCXHR_DSP)
 #endif