On Tue, Feb 27, 2024 at 06:27:51PM +0200, Bitterblue Smith wrote: > Adding Sean Mollet because I forgot earlier. > > On 27/02/2024 14:56, Sascha Hauer wrote: > > On Tue, Feb 27, 2024 at 02:18:20PM +0200, Bitterblue Smith wrote: > >> + if (addr < 0xFE00) { > >> + if (addr <= 0xff) > >> + current_reg_sec = REG_ON_SEC; > >> + else if (0x1000 <= addr && addr <= 0x10ff) > >> + current_reg_sec = REG_ON_SEC; > >> + else > >> + current_reg_sec = REG_OFF_SEC; > >> + } else { > >> + current_reg_sec = REG_LOCAL_SEC; > >> + } > >> + > >> + if (current_reg_sec != REG_ON_SEC) > >> + return; > > > > Is there something we want to do with current_reg_sec == REG_LOCAL_SEC > > or current_reg_sec == REG_OFF_SEC later? If not the above could be > > rewritten as: > > > > if (addr > 0xff && addr < 0x1000) > > return; > > if (addr > 0x10ff) > > return; > > > > ... > > Dunno, I just copied the code from the other drivers: > > https://github.com/morrownr/8821cu-20210916/blob/5b39398e2de146edeb76716420f3288f508bea61/os_dep/linux/usb_ops_linux.c#L171 Ok, nothing is done with current_reg_sec here as well, so I suggest rewriting the check like I suggested. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |