Thread (75 messages) 75 messages, 11 authors, 2021-09-26

Re: [RFC 03/11] hte: Add tegra194 HTE kernel provider

From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: 2021-07-08 23:33:44
Also in: linux-devicetree, linux-gpio, linux-tegra, lkml

On Fri, Jun 25, 2021 at 04:55:24PM -0700, Dipen Patel wrote:
Tegra194 device has multiple HTE instances also known as GTE
(Generic hardware Timestamping Engine) which can timestamp subset of
SoC lines/signals. This provider driver focuses on IRQ and GPIO lines
and exposes timestamping ability on those lines to the consumers
through HTE subsystem.
[...]
+	ret = of_property_read_u32(dev->of_node, "slices", &slices);
+	if (ret != 0) {
+		dev_err(dev, "Could not read slices\n");
+		return -EINVAL;
+	}
+
+	hte_dev->sl = devm_kzalloc(dev, sizeof(struct hte_slices) * slices,
+				   GFP_KERNEL);
Nit: There is devm_kcalloc() that will check for overflow in the
multiply in case @slices from DT is broken.

Best Regards
Michał Mirosław
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help