Skip to contentSkip to conversation

staging: sm750fb: remove dead code and redundant definitions

PATCH New Jiaqi Shi 1 participant 4 messages Nov 19

Subsystems (3)
lore
Share & tools
lore

Jiaqi Shi

author
#0 lore raw

cover staging: sm750fb: remove dead code and redundant definitions

This series addresses part of the cleanup item in the sm750fb TODO by removing dead code and a redundant definition:

- an unused MHZ macro;
- struct fields that are never read;
- a duplicate SM750LE_REVISION_ID definition.

Each patch was build-tested with W=1 on arm64. Sparse checks were run without warnings. No hardware runtime testing was performed.

Jiaqi Shi (3):
staging: sm750fb: remove unused MHZ macro
staging: sm750fb: remove more unused struct fields
staging: sm750fb: remove duplicate SM750LE_REVISION_ID definition

 drivers/staging/sm750fb/ddk750_mode.h |  2 --
 drivers/staging/sm750fb/sm750.c       |  2 --
 drivers/staging/sm750fb/sm750.h       | 15 ---------------
 3 files changed, 19 deletions(-)

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.53.0
author
#1 lore raw

PATCH 1/3 staging: sm750fb: remove unused MHZ macro

The MHZ(x) macro has no users in the driver. Remove it.

---
 drivers/staging/sm750fb/sm750.h | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/sm750fb/sm750.h +0 -2
index fd1cf9eb5797..7511fab2e0e3 100644
@@ -5,8 +5,6 @@
 
 #define FB_ACCEL_SMI 0xab
 
-#define MHZ(x) ((x) * 1000000)
-
 #define DEFAULT_SM750_CHIP_CLOCK	290
 #define DEFAULT_SM750LE_CHIP_CLOCK	333
 #ifndef SM750LE_REVISION_ID
Signature · 1 line
2.53.0
author
#2 lore raw

PATCH 2/3 staging: sm750fb: remove more unused struct fields

In reply to Jiaqi Shi

The hw_cursor, o_cursor, dpms, horizontal_frequency and vertical_frequency fields are never read. Remove them and the only assignment to hw_cursor.

---
 drivers/staging/sm750fb/ddk750_mode.h |  2 --
 drivers/staging/sm750fb/sm750.c       |  2 --
 drivers/staging/sm750fb/sm750.h       | 10 ----------
 3 files changed, 14 deletions(-)
drivers/staging/sm750fb/ddk750_mode.h +0 -2
index 1b70885f85e5..f52f893c6a6d 100644
@@ -26,8 +26,6 @@ struct mode_parameter {
 
 	/* Refresh timing. */
 	unsigned long pixel_clock;
-	unsigned long horizontal_frequency;
-	unsigned long vertical_frequency;
 
 	/* Clock Phase. This clock phase only applies to Panel. */
 	enum spolarity clock_phase_polarity;
drivers/staging/sm750fb/sm750.c +0 -2
index 21e310274330..99d410e184bd 100644
@@ -584,8 +584,6 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 		crtc->vidmem_size >>= 1;
 
 	/* setup crtc and output member */
-	sm750_dev->hw_cursor = g_hwcursor;
-
 	crtc->line_pad = 16;
 	crtc->xpanstep = 8;
 	crtc->ypanstep = 1;
drivers/staging/sm750fb/sm750.h +0 -10
index 7511fab2e0e3..ea8f445b5fd4 100644
@@ -95,14 +95,6 @@ struct sm750_dev {
 	enum sm750_pnltype pnltype;
 	enum sm750_dataflow dataflow;
 	int nocrt;
-
-	/*
-	 * 0: no hardware cursor
-	 * 1: primary crtc hw cursor enabled,
-	 * 2: secondary crtc hw cursor enabled
-	 * 3: both ctrc hw cursor enabled
-	 */
-	int hw_cursor;
 };
 
 struct lynx_cursor {
@@ -123,7 +115,6 @@ struct lynx_cursor {
 struct lynxfb_crtc {
 	unsigned char __iomem *v_cursor; /* virtual address of cursor */
 	unsigned char __iomem *v_screen; /* virtual address of on_screen */
-	int o_cursor; /* cursor address offset in vidmem */
 	int o_screen; /* onscreen address offset in vidmem */
 	int channel;/* which channel this crtc stands for*/
 	resource_size_t vidmem_size;/* this view's video memory max size */
@@ -139,7 +130,6 @@ struct lynxfb_crtc {
 };
 
 struct lynxfb_output {
-	int dpms;
 	int paths;
 	/*
 	 * which paths(s) this output stands for,for sm750:
Signature · 1 line
2.53.0
author
#3 lore raw

PATCH 3/3 staging: sm750fb: remove duplicate SM750LE_REVISION_ID definition

In reply to Jiaqi Shi

sm750.h includes ddk750_chip.h, which already defines SM750LE_REVISION_ID. Remove the redundant conditional definition from sm750.h.

---
 drivers/staging/sm750fb/sm750.h | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/sm750fb/sm750.h +0 -3
index ea8f445b5fd4..32f58bd7b547 100644
@@ -7,9 +7,6 @@
 
 #define DEFAULT_SM750_CHIP_CLOCK	290
 #define DEFAULT_SM750LE_CHIP_CLOCK	333
-#ifndef SM750LE_REVISION_ID
-#define SM750LE_REVISION_ID ((unsigned char)0xfe)
-#endif
 
 enum sm750_pnltype {
 	SM750_24TFT = 0,	/* 24bit tft */
Signature · 1 line
2.53.0