[PATCH v2] drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode()

Jyri Sarha jsarha at ti.com
Fri Oct 13 12:00:44 UTC 2017



Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 10/13/17 14:04, Tomi Valkeinen wrote:
>> +uint tilcdc_mode_hvtotal(const struct drm_display_mode *mode)
>> +{
>> +	uint ret;
>> +
>> +	ret = (uint) div_u64(1000llu * mode->htotal * mode->vtotal,
>> +			     mode->clock);
>> +
>> +	return ret;
>> +}
> I don't think "uint" is recommended. Just use u32. And drop the ret
> variable, just one-line return statement should be enough.
> 

The ret variable can of course be dropped, but how u32 is better than
uint? If the driver would ever be used in 64bit architecture (highly
unlikely), then it would automatically use the higher precision, and on
32-bit architecture there is no difference.

Also the data member in the private struct is uint and so are the other
similar data members like lcd_fck_rate.

So why change?

Best regards,
Jyri

> Otherwise:
> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen at ti.com>
> 
>  Tomi




More information about the dri-devel mailing list