[PATCH v2] pwm: th1520: Fix 32-bit build with COMPILE_TEST

FUJITA Tomonori tomo at flapping.org
Wed Sep 30 15:02:15 PDT 2026


On Wed, 30 Sep 2026 13:57:31 +0200
Uwe Kleine-König <ukleinek at kernel.org> wrote:

>> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
>> index 729776086879..abecd95b0c3c 100644
>> --- a/drivers/pwm/Kconfig
>> +++ b/drivers/pwm/Kconfig
>> @@ -772,7 +772,7 @@ config PWM_TEGRA
>>  
>>  config PWM_TH1520
>>  	tristate "TH1520 PWM support"
>> -	depends on ARCH_THEAD || COMPILE_TEST
>> +	depends on ARCH_THEAD || (COMPILE_TEST && 64BIT)
>>  	depends on RUST
>>  	depends on HAS_IOMEM && COMMON_CLK
>>  	select RUST_PWM_ABSTRACTIONS
> 
> Can't we do better than that? For C code the right thing to do is to use
> one of the div helpers instead of a plain / for types bigger than long.

Indeed. Rust code already uses some div helpers. However, the kernel
crate does not have Rust wrappers for the helpers this driver needs,
such as mul_u64_u64_div_u64(), so we need to add them first. The
changes would be too large for stable.

So how about merging this as a fix? I will work on patches to use div
helpers in the driver.




More information about the linux-riscv mailing list