lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZHPY32XPGyc96jJS@surfacebook>
Date:   Mon, 29 May 2023 01:42:39 +0300
From:   andy.shevchenko@...il.com
To:     Astrid Rost <astrid.rost@...s.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...s.com,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Mathieu Othacehe <m.othacehe@...il.com>
Subject: Re: [PATCH v4 3/7] iio: light: vcnl4000: Add als_it for vcnl4040/4200

Mon, May 22, 2023 at 04:26:17PM +0200, Astrid Rost kirjoitti:
> Add illuminance integration time for vcnl4040 and vcnl4200.
> Add read/write attribute for illuminance integration time and read
> attribute for available integration times.
> Set scale and sampling rate according to the integration time.

...

> +	data->vcnl4200_al.sampling_rate = ktime_set(0, val * 1200000);
> +	if (data->id == VCNL4200)
> +		/* 24000 µlux/step * 50000 µs / val  */
> +		data->al_scale = div_u64(1200000000, val);

Without type these constant are integers. Is this okay with 32-bit builds?

> +	else
> +		/* 100000 µlux/step * 80000 µs / val */
> +		data->al_scale = div_u64(8000000000, val);

Ditto.

Also, can you use constants from units.h (KILO) and time.h (USEC_PER_MSEC)?

...

> +out:

out_unlock:

> +	mutex_unlock(&data->vcnl4000_lock);
> +	return ret;

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ