lkml.org 
[lkml]   [2020]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/1] pwm: Convert period and duty cycle to u64
Hi Uwe,

On Tue, Jan 14, 2020 at 08:47:10AM +0100, Uwe Kleine-König wrote:
> I didn't thought about that much, but it would be great if we could
> prepare the affected drivers to work with both, int and u64 and switch
> in a separate commit. Reverting would then become cheaper.
> The conversion to 64-bit division macros could be done even without
> actually converting period and duty cycle, couldn't it?

I do agree that with such a two-step process the reverting (should the
need arise) would be much cheaper. I tried out your suggestion and saw
that this is not possible as the patch stands currently due to
compilation warning and errors that arise for various architectures:

warning: comparison of distinct pointer types lacks a cast
warning: right shift count >= width of type [-Wshift-count-overflow]
error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
note: expected 'uint64_t *' {aka 'long long unsigned int *'} but argument is of type 'unsigned int *'
warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'unsigned int' [-Wformat=]

Could you please indicate how we should proceed further?

> This Reported-by: looks wrong. It gave some hints about what had to be
> improved in an earlier revision of this patch, but usually this means
> that the patch is a fix for an earlier commit. So I would put this in
> the text, something like:
>
> The kbuild test robot helped to improve this patch series to
> (hopefully) catch all code sites having to be adapted.

Noted, will make this change.

> In ir-rx51.c you used DIV_ROUND_CLOSEST_ULL to replace
> DIV_ROUND_CLOSEST, here it is DIV64_U64_ROUND_CLOSEST. Maybe it is worth
> to describe the relevant difference shortly in the commit log.

Sure, will make a note of this in the commit log. In short, one is used
when only the numerator is 64-bit while the other is meant for the case
when both numerator and denominator are 64-bit.

Thank you.

Guru Das.

\
 
 \ /
  Last update: 2020-01-16 01:55    [W:0.068 / U:5.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site