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] [day] [month] [year] [list]
Message-ID: <20201021211648.GE444962@dtor-ws>
Date:   Wed, 21 Oct 2020 14:16:48 -0700
From:   dmitry.torokhov@...il.com
To:     kholk11@...il.com
Cc:     robh+dt@...nel.org, rydberg@...math.org, priv.luk@...il.com,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        marijns95@...il.com, konradybcio@...il.com,
        martin.botka1@...il.com, phone-devel@...r.kernel.org,
        devicetree@...r.kernel.org, krzk@...nel.org
Subject: Re: [PATCH v5 2/3] Input: Add Novatek NT36xxx touchscreen driver

Hi AngeloGioacchino,

[obviously not a complete review, but wanted to call out regmap concern]

On Sat, Oct 17, 2020 at 09:01:51PM +0200, kholk11@...il.com wrote:
> +static int nt36xxx_read_pid(struct nt36xxx_i2c *ts)
> +{
> +	u8 buf[2] = { 0 };

	__be16 pid;

> +	int ret = 0;
> +
> +	ret = nt36xxx_set_page(ts, ts->mmap->evtbuf_addr);
> +	if (unlikely(ret < 0))
> +		return ret;

regmap is supposed to help with the paged registers, that is why I
recommended using it.

> +
> +	ret = regmap_noinc_read(ts->fw_regmap, NT36XXX_EVT_PROJECTID,
> +				buf, sizeof(buf));
> +	if (unlikely(ret < 0))
> +		return ret;
> +
> +	ts->fw_info.nvt_pid = (buf[1] << 8) + buf[0];

	ts->fw_info.nvt_pid = be16_to_cpu(pid);

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ