From 9e2a7cd9838685b528f41ccdaed9a0940cd21f5e Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 12 Nov 2024 16:06:42 +0900 Subject: [PATCH] Remvo "dumprun" functions from various LCD drivers * It seems that they assume up_putc() and syslog() outputs to the same device. Depending on the system and configurations, it's wrong. * They are wrapped with "#if 0" and unused. Fixes https://github.com/apache/nuttx/issues/14694 --- boards/arm/sam34/sam4e-ek/src/sam_ili9325.c | 33 --------------- boards/arm/sam34/sam4e-ek/src/sam_ili9341.c | 33 --------------- .../arm/samv7/samv71-xult/src/sam_ili9488.c | 33 --------------- boards/arm/stm32/shenzhou/src/stm32_ili93xx.c | 33 --------------- .../arm/stm32/stm3210e-eval/src/stm32_lcd.c | 33 --------------- .../arm/stm32/stm3220g-eval/src/stm32_lcd.c | 33 --------------- .../arm/stm32/stm3240g-eval/src/stm32_lcd.c | 33 --------------- drivers/lcd/mio283qt2.c | 34 ---------------- drivers/lcd/mio283qt9a.c | 34 ---------------- drivers/lcd/ra8875.c | 8 ---- drivers/lcd/ssd1289.c | 40 ------------------- 11 files changed, 347 deletions(-) diff --git a/boards/arm/sam34/sam4e-ek/src/sam_ili9325.c b/boards/arm/sam34/sam4e-ek/src/sam_ili9325.c index fc140e9c69ecd..60685acd246c1 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_ili9325.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_ili9325.c @@ -537,39 +537,6 @@ static void sam_set_cursor(uint16_t col, uint16_t row) sam_write_reg(ILI9325_VERTICAL_GRAM_ADDR_SET, col); } -/**************************************************************************** - * Name: sam_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void sam_dumprun(const char *msg, uint16_t *run, - size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: sam_disable_backlight * diff --git a/boards/arm/sam34/sam4e-ek/src/sam_ili9341.c b/boards/arm/sam34/sam4e-ek/src/sam_ili9341.c index 4119a4c5a6e07..d3100ec7460ed 100644 --- a/boards/arm/sam34/sam4e-ek/src/sam_ili9341.c +++ b/boards/arm/sam34/sam4e-ek/src/sam_ili9341.c @@ -571,39 +571,6 @@ static inline sam_color_t sam_gram_read(void) (sam_color_t)buffer[2]); } -/**************************************************************************** - * Name: sam_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void sam_dumprun(const char *msg, uint16_t *run, - size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: sam_disable_backlight * diff --git a/boards/arm/samv7/samv71-xult/src/sam_ili9488.c b/boards/arm/samv7/samv71-xult/src/sam_ili9488.c index f4097d1de8a07..acd863f3077c0 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_ili9488.c +++ b/boards/arm/samv7/samv71-xult/src/sam_ili9488.c @@ -691,39 +691,6 @@ static int sam_setwindow(struct sam_dev_s *priv, sam_color_t row, return sam_sendcmd(priv, ILI9488_CMD_NOP); } -/**************************************************************************** - * Name: sam_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void sam_dumprun(const char *msg, uint16_t *run, - size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: sam_disable_backlight * diff --git a/boards/arm/stm32/shenzhou/src/stm32_ili93xx.c b/boards/arm/stm32/shenzhou/src/stm32_ili93xx.c index 5105784d25967..c7c72f3c4f7b1 100644 --- a/boards/arm/stm32/shenzhou/src/stm32_ili93xx.c +++ b/boards/arm/stm32/shenzhou/src/stm32_ili93xx.c @@ -808,39 +808,6 @@ static void stm32_setcursor(struct stm32_dev_s *priv, } } -/**************************************************************************** - * Name: stm32_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void stm32_dumprun(const char *msg, - uint16_t *run, size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: stm32_putrun * diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c b/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c index a41dd2978ec8b..2a919d7ae335b 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c @@ -669,39 +669,6 @@ static void stm3210e_setcursor(uint16_t col, uint16_t row) stm3210e_writereg(LCD_REG_33, col); /* GRAM vertical address */ } -/**************************************************************************** - * Name: stm3210e_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void stm3210e_dumprun(const char *msg, uint16_t *run, - size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: stm3210e_putrun * diff --git a/boards/arm/stm32/stm3220g-eval/src/stm32_lcd.c b/boards/arm/stm32/stm3220g-eval/src/stm32_lcd.c index 48f82f54ab17a..7899e6b8b47ee 100644 --- a/boards/arm/stm32/stm3220g-eval/src/stm32_lcd.c +++ b/boards/arm/stm32/stm3220g-eval/src/stm32_lcd.c @@ -508,39 +508,6 @@ static void stm3220g_setcursor(uint16_t col, uint16_t row) stm3220g_writereg(LCD_REG_33, col); /* GRAM vertical address */ } -/**************************************************************************** - * Name: stm3220g_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void stm3220g_dumprun(const char *msg, - uint16_t *run, size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: stm3220g_putrun * diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_lcd.c b/boards/arm/stm32/stm3240g-eval/src/stm32_lcd.c index 658efd6ee94fe..b5c38321872b0 100644 --- a/boards/arm/stm32/stm3240g-eval/src/stm32_lcd.c +++ b/boards/arm/stm32/stm3240g-eval/src/stm32_lcd.c @@ -507,39 +507,6 @@ static void stm3240g_setcursor(uint16_t col, uint16_t row) stm3240g_writereg(LCD_REG_33, col); /* GRAM vertical address */ } -/**************************************************************************** - * Name: stm3240g_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void stm3240g_dumprun(const char *msg, - uint16_t *run, size_t npixels) -{ - int i; - int j; - - syslog(LOG_DEBUG, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_DEBUG, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_DEBUG, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: stm3240g_putrun * diff --git a/drivers/lcd/mio283qt2.c b/drivers/lcd/mio283qt2.c index 34e0e75650368..0b10e6fbd4eb1 100644 --- a/drivers/lcd/mio283qt2.c +++ b/drivers/lcd/mio283qt2.c @@ -475,40 +475,6 @@ static void mio283qt2_setarea(FAR struct mio283qt2_lcd_s *lcd, mio283qt2_putreg(lcd, 0x08, (y1 >> 8)); /* set y1 */ } -/**************************************************************************** - * Name: mio283qt2_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void mio283qt2_dumprun(FAR const char *msg, - FAR uint16_t *run, - size_t npixels) -{ - int i; - int j; - - syslog(LOG_INFO, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_INFO, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_INFO, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: mio283qt2_putrun * diff --git a/drivers/lcd/mio283qt9a.c b/drivers/lcd/mio283qt9a.c index 0fdafdb1618ba..5e8356b633f5a 100644 --- a/drivers/lcd/mio283qt9a.c +++ b/drivers/lcd/mio283qt9a.c @@ -378,40 +378,6 @@ static void mio283qt9a_setarea(FAR struct mio283qt9a_lcd_s *lcd, lcd->write(lcd, (y1 & 0xff)); /* Set y1 */ } -/**************************************************************************** - * Name: mio283qt9a_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void mio283qt9a_dumprun(FAR const char *msg, - FAR uint16_t *run, - size_t npixels) -{ - int i; - int j; - - syslog(LOG_INFO, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_INFO, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_INFO, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: mio283qt9a_putrun * diff --git a/drivers/lcd/ra8875.c b/drivers/lcd/ra8875.c index 8d759e6ac5b51..b48f1b3fe5f5a 100644 --- a/drivers/lcd/ra8875.c +++ b/drivers/lcd/ra8875.c @@ -245,14 +245,6 @@ static void ra8875_clearmem(FAR struct ra8875_lcd_s *lcd); /* LCD Data Transfer Methods */ -#if 0 /* Sometimes useful */ -static void ra8875_dumprun(FAR const char *msg, - FAR uint16_t *run, - size_t npixels); -#else -# define ra8875_dumprun(m,r,n) -#endif - #ifdef CONFIG_DEBUG_LCD static void ra8875_showrun(FAR struct ra8875_dev_s *priv, fb_coord_t row, fb_coord_t col, size_t npixels, bool put); diff --git a/drivers/lcd/ssd1289.c b/drivers/lcd/ssd1289.c index 9263dba2103df..0daf06b802fe8 100644 --- a/drivers/lcd/ssd1289.c +++ b/drivers/lcd/ssd1289.c @@ -281,13 +281,6 @@ static void ssd1289_setcursor(FAR struct ssd1289_lcd_s *lcd, /* LCD Data Transfer Methods */ -#if 0 /* Sometimes useful */ -static void ssd1289_dumprun(FAR const char *msg, FAR uint16_t *run, - size_t npixels); -#else -# define ssd1289_dumprun(m,r,n) -#endif - #ifdef CONFIG_DEBUG_LCD static void ssd1289_showrun(FAR struct ssd1289_dev_s *priv, fb_coord_t row, fb_coord_t col, size_t npixels, bool put); @@ -483,39 +476,6 @@ static void ssd1289_setcursor(FAR struct ssd1289_lcd_s *lcd, #endif } -/**************************************************************************** - * Name: ssd1289_dumprun - * - * Description: - * Dump the contexts of the run buffer: - * - * run - The buffer in containing the run read to be dumped - * npixels - The number of pixels to dump - * - ****************************************************************************/ - -#if 0 /* Sometimes useful */ -static void ssd1289_dumprun(FAR const char *msg, - FAR uint16_t *run, size_t npixels) -{ - int i; - int j; - - syslog(LOG_INFO, "\n%s:\n", msg); - for (i = 0; i < npixels; i += 16) - { - up_putc(' '); - syslog(LOG_INFO, " "); - for (j = 0; j < 16; j++) - { - syslog(LOG_INFO, " %04x", *run++); - } - - up_putc('\n'); - } -} -#endif - /**************************************************************************** * Name: ssd1289_showrun *