* [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code
@ 2026-07-18 6:20 Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 1/2] staging: sm750fb: remove dead VALIDATION_CHIP conditionals Nils Lehnen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Nils Lehnen @ 2026-07-18 6:20 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
VALIDATION_CHIP is defined nowhere in the tree, yet fourteen
preprocessor conditionals in the sm750fb DDK files still test it.
Patch 1 resolves all of them (dead branches dropped, always-true
branches kept), as the driver TODO asks under "remove unused code";
patch 2 cleans up the indentation and blank lines the removal leaves
behind.
Verification, both patches: the disassembly of all ten sm750fb object
files (objdump -d, x86, CONFIG_FB_SM750=m) is bit-identical across the
series. Compile-tested only; no SM750 hardware available.
All English text in this series (cover letter, commit messages, code
comments) was translated from a German draft with the assistance of
Claude Fable 5.
v2: resend of v1 -- patch 1/2 of v1 arrived with an empty subject due
to a local send mishap; no code changes.
v1: https://lore.kernel.org/r/20260718055132.441-1-nils.lehnen@proton.me
Nils Lehnen (2):
staging: sm750fb: remove dead VALIDATION_CHIP conditionals
staging: sm750fb: unindent defines left by conditional removal
drivers/staging/sm750fb/ddk750_reg.h | 84 ++++++++------------------
drivers/staging/sm750fb/ddk750_chip.c | 4 --
drivers/staging/sm750fb/ddk750_power.c | 6 --
3 files changed, 24 insertions(+), 70 deletions(-)
base-commit: 64276d9bfe4d1fdd5cf2636f1065f7ea55c2defb
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] staging: sm750fb: remove dead VALIDATION_CHIP conditionals
2026-07-18 6:20 [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Nils Lehnen
@ 2026-07-18 6:21 ` Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 2/2] staging: sm750fb: unindent defines left by conditional removal Nils Lehnen
2026-07-18 6:31 ` [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Nils Lehnen @ 2026-07-18 6:21 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
VALIDATION_CHIP is defined nowhere in the tree and no Makefile passes
-DVALIDATION_CHIP, so every #ifdef VALIDATION_CHIP block is dead code
and every #ifndef VALIDATION_CHIP condition is always true. Resolve all
fourteen conditionals accordingly (dead branches dropped, live branches
kept), as the driver TODO asks under "remove unused code".
No functional change: the disassembly of all ten sm750fb object files
is bit-identical before and after this patch.
All English text in this patch (commit message and code comments) was
translated from a German draft with the assistance of Claude Fable 5.
Assisted-by: Claude:claude-fable-5 sparse unifdef
Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
---
drivers/staging/sm750fb/ddk750_reg.h | 34 --------------------------
drivers/staging/sm750fb/ddk750_chip.c | 4 ---
drivers/staging/sm750fb/ddk750_power.c | 6 -----
3 files changed, 44 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index fe412ead72e5..4bcede37584a 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -294,29 +294,15 @@
#define CURRENT_GATE 0x000040
#define CURRENT_GATE_MCLK_MASK (0x3 << 14)
-#ifdef VALIDATION_CHIP
- #define CURRENT_GATE_MCLK_112MHZ (0x0 << 14)
- #define CURRENT_GATE_MCLK_84MHZ (0x1 << 14)
- #define CURRENT_GATE_MCLK_56MHZ (0x2 << 14)
- #define CURRENT_GATE_MCLK_42MHZ (0x3 << 14)
-#else
#define CURRENT_GATE_MCLK_DIV_3 (0x0 << 14)
#define CURRENT_GATE_MCLK_DIV_4 (0x1 << 14)
#define CURRENT_GATE_MCLK_DIV_6 (0x2 << 14)
#define CURRENT_GATE_MCLK_DIV_8 (0x3 << 14)
-#endif
#define CURRENT_GATE_M2XCLK_MASK (0x3 << 12)
-#ifdef VALIDATION_CHIP
- #define CURRENT_GATE_M2XCLK_336MHZ (0x0 << 12)
- #define CURRENT_GATE_M2XCLK_168MHZ (0x1 << 12)
- #define CURRENT_GATE_M2XCLK_112MHZ (0x2 << 12)
- #define CURRENT_GATE_M2XCLK_84MHZ (0x3 << 12)
-#else
#define CURRENT_GATE_M2XCLK_DIV_1 (0x0 << 12)
#define CURRENT_GATE_M2XCLK_DIV_2 (0x1 << 12)
#define CURRENT_GATE_M2XCLK_DIV_3 (0x2 << 12)
#define CURRENT_GATE_M2XCLK_DIV_4 (0x3 << 12)
-#endif
#define CURRENT_GATE_VGA BIT(10)
#define CURRENT_GATE_PWM BIT(9)
#define CURRENT_GATE_I2C BIT(8)
@@ -376,9 +362,6 @@
#define MODE1_GATE_DMA BIT(0)
#define POWER_MODE_CTRL 0x00004C
-#ifdef VALIDATION_CHIP
- #define POWER_MODE_CTRL_336CLK BIT(4)
-#endif
#define POWER_MODE_CTRL_OSC_INPUT BIT(3)
#define POWER_MODE_CTRL_ACPI BIT(2)
#define POWER_MODE_CTRL_MODE_MASK (0x3 << 0)
@@ -400,15 +383,10 @@
#define PLL_CTRL_BYPASS BIT(18)
#define PLL_CTRL_POWER BIT(17)
#define PLL_CTRL_INPUT BIT(16)
-#ifdef VALIDATION_CHIP
- #define PLL_CTRL_OD_SHIFT 14
- #define PLL_CTRL_OD_MASK (0x3 << 14)
-#else
#define PLL_CTRL_POD_SHIFT 14
#define PLL_CTRL_POD_MASK (0x3 << 14)
#define PLL_CTRL_OD_SHIFT 12
#define PLL_CTRL_OD_MASK (0x3 << 12)
-#endif
#define PLL_CTRL_N_SHIFT 8
#define PLL_CTRL_N_MASK (0xf << 8)
#define PLL_CTRL_M_SHIFT 0
@@ -422,7 +400,6 @@
#define SCRATCH_DATA 0x00006c
-#ifndef VALIDATION_CHIP
#define MXCLK_PLL_CTRL 0x000070
@@ -431,7 +408,6 @@
#define VGA_CONFIGURATION_PLL BIT(2)
#define VGA_CONFIGURATION_MODE BIT(1)
-#endif
#define GPIO_DATA 0x010000
#define GPIO_DATA_31 BIT(31)
@@ -1020,9 +996,7 @@
#define CRT_DISPLAY_CTRL_CRTSELECT BIT(25)
#define CRT_DISPLAY_CTRL_RGBBIT BIT(24)
-#ifndef VALIDATION_CHIP
#define CRT_DISPLAY_CTRL_CENTERING BIT(24)
-#endif
#define CRT_DISPLAY_CTRL_LOCK_TIMING BIT(23)
#define CRT_DISPLAY_CTRL_EXPANSION BIT(22)
#define CRT_DISPLAY_CTRL_VERTICAL_MODE BIT(21)
@@ -1121,22 +1095,17 @@
/* This vertical expansion below start at 0x080240 ~ 0x080264 */
#define CRT_VERTICAL_EXPANSION 0x080240
-#ifndef VALIDATION_CHIP
#define CRT_VERTICAL_CENTERING_VALUE_MASK (0xff << 24)
-#endif
#define CRT_VERTICAL_EXPANSION_COMPARE_VALUE_MASK (0xff << 16)
#define CRT_VERTICAL_EXPANSION_LINE_BUFFER_MASK (0xf << 12)
#define CRT_VERTICAL_EXPANSION_SCALE_FACTOR_MASK 0xfff
/* This horizontal expansion below start at 0x080268 ~ 0x08027C */
#define CRT_HORIZONTAL_EXPANSION 0x080268
-#ifndef VALIDATION_CHIP
#define CRT_HORIZONTAL_CENTERING_VALUE_MASK (0xff << 24)
-#endif
#define CRT_HORIZONTAL_EXPANSION_COMPARE_VALUE_MASK (0xff << 16)
#define CRT_HORIZONTAL_EXPANSION_SCALE_FACTOR_MASK 0xfff
-#ifndef VALIDATION_CHIP
/* Auto Centering */
#define CRT_AUTO_CENTERING_TL 0x080280
#define CRT_AUTO_CENTERING_TL_TOP_MASK (0x7ff << 16)
@@ -1146,7 +1115,6 @@
#define CRT_AUTO_CENTERING_BR_BOTTOM_MASK (0x7ff << 16)
#define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT 16
#define CRT_AUTO_CENTERING_BR_RIGHT_MASK 0x7ff
-#endif
/* sm750le new register to control panel output */
#define DISPLAY_CONTROL_750LE 0x80288
@@ -1326,9 +1294,7 @@
#define ZV0_CAPTURE_BUF1_ADDRESS_ADDRESS_MASK 0x3ffffff
#define ZV0_CAPTURE_BUF_OFFSET 0x090014
-#ifndef VALIDATION_CHIP
#define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD (0x3ff << 16)
-#endif
#define ZV0_CAPTURE_BUF_OFFSET_OFFSET_MASK 0xffff
#define ZV0_CAPTURE_FIFO_CTRL 0x090018
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 0bb56bbec43f..ab8b68076dec 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -387,9 +387,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig,
unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
{
-#ifndef VALIDATION_CHIP
unsigned int POD = p_PLL->POD;
-#endif
unsigned int OD = p_PLL->OD;
unsigned int M = p_PLL->M;
unsigned int N = p_PLL->N;
@@ -401,9 +399,7 @@ unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
* applied to any PLL in the calling function.
*/
return PLL_CTRL_POWER |
-#ifndef VALIDATION_CHIP
((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
-#endif
((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index eaba3bc2e01a..d617f554f58d 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -58,14 +58,8 @@ void sm750_set_power_mode(unsigned int mode)
/* Set up other fields in Power Control Register */
if (mode == POWER_MODE_CTRL_MODE_SLEEP) {
ctrl &= ~POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
- ctrl &= ~POWER_MODE_CTRL_336CLK;
-#endif
} else {
ctrl |= POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
- ctrl |= POWER_MODE_CTRL_336CLK;
-#endif
}
/* Program new power mode. */
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] staging: sm750fb: unindent defines left by conditional removal
2026-07-18 6:20 [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 1/2] staging: sm750fb: remove dead VALIDATION_CHIP conditionals Nils Lehnen
@ 2026-07-18 6:21 ` Nils Lehnen
2026-07-18 6:31 ` [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Nils Lehnen @ 2026-07-18 6:21 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Nils Lehnen
The preceding removal of the VALIDATION_CHIP conditionals left the
surviving define blocks and one comment indented by four spaces, and
two double blank lines where conditional lines went away. Move the
now-unconditional defines to column zero while keeping the aligned
value column untouched, and collapse the blank lines.
No functional change: whitespace and preprocessor layout only; the
disassembly of all ten sm750fb object files stays bit-identical.
All English text in this patch (commit message and code comments) was
translated from a German draft with the assistance of Claude Fable 5.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Nils Lehnen <nils.lehnen@proton.me>
---
drivers/staging/sm750fb/ddk750_reg.h | 50 +++++++++++++---------------
1 file changed, 24 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_reg.h b/drivers/staging/sm750fb/ddk750_reg.h
index 4bcede37584a..2888ffe32fa2 100644
--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -294,15 +294,15 @@
#define CURRENT_GATE 0x000040
#define CURRENT_GATE_MCLK_MASK (0x3 << 14)
- #define CURRENT_GATE_MCLK_DIV_3 (0x0 << 14)
- #define CURRENT_GATE_MCLK_DIV_4 (0x1 << 14)
- #define CURRENT_GATE_MCLK_DIV_6 (0x2 << 14)
- #define CURRENT_GATE_MCLK_DIV_8 (0x3 << 14)
+#define CURRENT_GATE_MCLK_DIV_3 (0x0 << 14)
+#define CURRENT_GATE_MCLK_DIV_4 (0x1 << 14)
+#define CURRENT_GATE_MCLK_DIV_6 (0x2 << 14)
+#define CURRENT_GATE_MCLK_DIV_8 (0x3 << 14)
#define CURRENT_GATE_M2XCLK_MASK (0x3 << 12)
- #define CURRENT_GATE_M2XCLK_DIV_1 (0x0 << 12)
- #define CURRENT_GATE_M2XCLK_DIV_2 (0x1 << 12)
- #define CURRENT_GATE_M2XCLK_DIV_3 (0x2 << 12)
- #define CURRENT_GATE_M2XCLK_DIV_4 (0x3 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_1 (0x0 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_2 (0x1 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_3 (0x2 << 12)
+#define CURRENT_GATE_M2XCLK_DIV_4 (0x3 << 12)
#define CURRENT_GATE_VGA BIT(10)
#define CURRENT_GATE_PWM BIT(9)
#define CURRENT_GATE_I2C BIT(8)
@@ -383,10 +383,10 @@
#define PLL_CTRL_BYPASS BIT(18)
#define PLL_CTRL_POWER BIT(17)
#define PLL_CTRL_INPUT BIT(16)
- #define PLL_CTRL_POD_SHIFT 14
- #define PLL_CTRL_POD_MASK (0x3 << 14)
- #define PLL_CTRL_OD_SHIFT 12
- #define PLL_CTRL_OD_MASK (0x3 << 12)
+#define PLL_CTRL_POD_SHIFT 14
+#define PLL_CTRL_POD_MASK (0x3 << 14)
+#define PLL_CTRL_OD_SHIFT 12
+#define PLL_CTRL_OD_MASK (0x3 << 12)
#define PLL_CTRL_N_SHIFT 8
#define PLL_CTRL_N_MASK (0xf << 8)
#define PLL_CTRL_M_SHIFT 0
@@ -400,7 +400,6 @@
#define SCRATCH_DATA 0x00006c
-
#define MXCLK_PLL_CTRL 0x000070
#define VGA_CONFIGURATION 0x000088
@@ -408,7 +407,6 @@
#define VGA_CONFIGURATION_PLL BIT(2)
#define VGA_CONFIGURATION_MODE BIT(1)
-
#define GPIO_DATA 0x010000
#define GPIO_DATA_31 BIT(31)
#define GPIO_DATA_30 BIT(30)
@@ -996,7 +994,7 @@
#define CRT_DISPLAY_CTRL_CRTSELECT BIT(25)
#define CRT_DISPLAY_CTRL_RGBBIT BIT(24)
- #define CRT_DISPLAY_CTRL_CENTERING BIT(24)
+#define CRT_DISPLAY_CTRL_CENTERING BIT(24)
#define CRT_DISPLAY_CTRL_LOCK_TIMING BIT(23)
#define CRT_DISPLAY_CTRL_EXPANSION BIT(22)
#define CRT_DISPLAY_CTRL_VERTICAL_MODE BIT(21)
@@ -1095,26 +1093,26 @@
/* This vertical expansion below start at 0x080240 ~ 0x080264 */
#define CRT_VERTICAL_EXPANSION 0x080240
- #define CRT_VERTICAL_CENTERING_VALUE_MASK (0xff << 24)
+#define CRT_VERTICAL_CENTERING_VALUE_MASK (0xff << 24)
#define CRT_VERTICAL_EXPANSION_COMPARE_VALUE_MASK (0xff << 16)
#define CRT_VERTICAL_EXPANSION_LINE_BUFFER_MASK (0xf << 12)
#define CRT_VERTICAL_EXPANSION_SCALE_FACTOR_MASK 0xfff
/* This horizontal expansion below start at 0x080268 ~ 0x08027C */
#define CRT_HORIZONTAL_EXPANSION 0x080268
- #define CRT_HORIZONTAL_CENTERING_VALUE_MASK (0xff << 24)
+#define CRT_HORIZONTAL_CENTERING_VALUE_MASK (0xff << 24)
#define CRT_HORIZONTAL_EXPANSION_COMPARE_VALUE_MASK (0xff << 16)
#define CRT_HORIZONTAL_EXPANSION_SCALE_FACTOR_MASK 0xfff
- /* Auto Centering */
- #define CRT_AUTO_CENTERING_TL 0x080280
- #define CRT_AUTO_CENTERING_TL_TOP_MASK (0x7ff << 16)
- #define CRT_AUTO_CENTERING_TL_LEFT_MASK 0x7ff
+/* Auto Centering */
+#define CRT_AUTO_CENTERING_TL 0x080280
+#define CRT_AUTO_CENTERING_TL_TOP_MASK (0x7ff << 16)
+#define CRT_AUTO_CENTERING_TL_LEFT_MASK 0x7ff
- #define CRT_AUTO_CENTERING_BR 0x080284
- #define CRT_AUTO_CENTERING_BR_BOTTOM_MASK (0x7ff << 16)
- #define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT 16
- #define CRT_AUTO_CENTERING_BR_RIGHT_MASK 0x7ff
+#define CRT_AUTO_CENTERING_BR 0x080284
+#define CRT_AUTO_CENTERING_BR_BOTTOM_MASK (0x7ff << 16)
+#define CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT 16
+#define CRT_AUTO_CENTERING_BR_RIGHT_MASK 0x7ff
/* sm750le new register to control panel output */
#define DISPLAY_CONTROL_750LE 0x80288
@@ -1294,7 +1292,7 @@
#define ZV0_CAPTURE_BUF1_ADDRESS_ADDRESS_MASK 0x3ffffff
#define ZV0_CAPTURE_BUF_OFFSET 0x090014
- #define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD (0x3ff << 16)
+#define ZV0_CAPTURE_BUF_OFFSET_YCLIP_ODD_FIELD (0x3ff << 16)
#define ZV0_CAPTURE_BUF_OFFSET_OFFSET_MASK 0xffff
#define ZV0_CAPTURE_FIFO_CTRL 0x090018
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code
2026-07-18 6:20 [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 1/2] staging: sm750fb: remove dead VALIDATION_CHIP conditionals Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 2/2] staging: sm750fb: unindent defines left by conditional removal Nils Lehnen
@ 2026-07-18 6:31 ` Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-18 6:31 UTC (permalink / raw)
To: Nils Lehnen
Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
linux-kernel
On Sat, Jul 18, 2026 at 06:20:56AM +0000, Nils Lehnen wrote:
> VALIDATION_CHIP is defined nowhere in the tree, yet fourteen
> preprocessor conditionals in the sm750fb DDK files still test it.
> Patch 1 resolves all of them (dead branches dropped, always-true
> branches kept), as the driver TODO asks under "remove unused code";
> patch 2 cleans up the indentation and blank lines the removal leaves
> behind.
>
> Verification, both patches: the disassembly of all ten sm750fb object
> files (objdump -d, x86, CONFIG_FB_SM750=m) is bit-identical across the
> series. Compile-tested only; no SM750 hardware available.
>
> All English text in this series (cover letter, commit messages, code
> comments) was translated from a German draft with the assistance of
> Claude Fable 5.
>
> v2: resend of v1 -- patch 1/2 of v1 arrived with an empty subject due
> to a local send mishap; no code changes.
> v1: https://lore.kernel.org/r/20260718055132.441-1-nils.lehnen@proton.me
Please wait a day or so between new versions, gives people a chance to
review what you sent and you to make changes based on it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-18 6:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-18 6:20 [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 1/2] staging: sm750fb: remove dead VALIDATION_CHIP conditionals Nils Lehnen
2026-07-18 6:21 ` [PATCH v2 2/2] staging: sm750fb: unindent defines left by conditional removal Nils Lehnen
2026-07-18 6:31 ` [PATCH v2 0/2] staging: sm750fb: remove dead VALIDATION_CHIP code Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox