Skip to contentSkip to conversation

serial: stm32: fix a type issue

PATCH In review Dan Carpenter 3 participants 4 messages Oct 12, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: stm32: fix a type issue

We store UNDEF_REG in a u8. It causes a problem in functions like stm32_tx_dma_complete() where we check "if (ofs->icr = UNDEF_REG)".

Fixes 3489187204eb ('serial: stm32: adding dma support')
drivers/tty/serial/stm32-usart.h +1 -1
index 41d9749..f9887cc 100644
@@ -31,7 +31,7 @@ struct stm32_usart_info {
 	struct stm32_usart_config cfg;
 };
 
-#define UNDEF_REG ~0
+#define UNDEF_REG 0xFF
 
 /* Register offsets */
 struct stm32_usart_info stm32f4_info = {
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan and thanks for the patch

Quoted 12 lines · Dan Carpenter

We store UNDEF_REG in a u8. It causes a problem in functions like stm32_tx_dma_complete() where we check "if (ofs->icr = UNDEF_REG)".

Fixes 3489187204eb ('serial: stm32: adding dma support')
drivers/tty/serial/stm32-usart.h +0 -0
index 41d9749..f9887cc 100644

drivers/tty/serial/stm32-usart.h struct stm32_usart_info { · line 37

Quoted 8 lines
drivers/tty/serial/stm32-usart.h +1 -1
@@ -31,7 +31,7 @@ struct stm32_usart_info {
 	struct stm32_usart_config cfg;
 };
 
-#define UNDEF_REG ~0
+#define UNDEF_REG 0xFF
 
 /* Register offsets */
 struct stm32_usart_info stm32f4_info = {
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

We store UNDEF_REG in a u8. It causes a problem in functions like stm32_tx_dma_complete() where we check "if (ofs->icr = UNDEF_REG)".

Fixes 3489187204eb ('serial: stm32: adding dma support')

Correct form is:

Fixes 12-digit-hash ("summary line")
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#3 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 4 lines · Dan Carpenter

We store UNDEF_REG in a u8. It causes a problem in functions like stm32_tx_dma_complete() where we check "if (ofs->icr = UNDEF_REG)".

Fixes 3489187204eb ('serial: stm32: adding dma support')

Correct form is:

Fixes 12-digit-hash ("summary line")

When I originally created the Fixes tag format, I used single quotes. I don't remember why though and I can change with the times. :)

regards,
dan carpenter