[openwrt/openwrt] realtek: Fix self assignment

LEDE Commits lede-commits at lists.infradead.org
Fri Dec 11 07:58:16 EST 2020


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/848d668427c544d20f8aa3041fa11b4d4adc9bc8

commit 848d668427c544d20f8aa3041fa11b4d4adc9bc8
Author: Rafał Mikrut <mikrutrafal at protonmail.com>
AuthorDate: Tue Dec 8 21:54:40 2020 +0100

    realtek: Fix self assignment
    
    Cppcheck shows self initialization error, which is an obvious bug.
    
    Basing on logic of similar fragment below I assigned to this variable,
    value `RTL838X_LED_GLB_CTRL` which I think is proper.
    
    Signed-off-by: Rafał Mikrut <mikrutrafal at protonmail.com>
---
 target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c b/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c
index 92cf5f765a..8207e4bb73 100644
--- a/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c
+++ b/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c
@@ -357,7 +357,7 @@ static int rtl838x_gpio_probe(struct platform_device *pdev)
 	}
 
 	if (soc_info.family == RTL8380_FAMILY_ID) {
-		gpios->led_glb_ctrl = gpios->led_glb_ctrl;
+		gpios->led_glb_ctrl = RTL838X_LED_GLB_CTRL;
 		gpios->led_sw_ctrl = RTL838X_LED_SW_CTRL;
 		gpios->led_sw_p_ctrl = rtl838x_led_sw_p_ctrl;
 		gpios->led_sw_p_en_ctrl = rtl838x_led_sw_p_en_ctrl;



More information about the lede-commits mailing list