lkml.org 
[lkml]   [2020]   [Jan]   [16]   [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,

[added linux-pwm to Cc:]

On Wed, Jan 15, 2020 at 04:55:03PM -0800, Guru Das Srinagesh wrote:
> 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=]

This should be managable with appropriate casting. Maybe it's also a
good idea to add a greppable keyword (e.g. "PWM-TYPE-CONVERSION") and a
short comment at the places that are expected to be touched again after
the conversion is known to last. (e.g. to remuch such casts).

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |

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