Re: [PATCH] media: ipu3: don't use recursion at the Kernel

From: Sakari Ailus
Date: Thu Dec 02 2021 - 07:51:19 EST


Hi Mauro,

On Thu, Dec 02, 2021 at 12:44:26PM +0100, Mauro Carvalho Chehab wrote:
> The Kernel stack is too small. Doing recursions there is a very
> bad idea, as, if something gets wrong, it could lead to data
> corruption. So, re-implement cio2_check_fwnode_graph() to avoid
> recursion.

Any decent compiler should be able to optimise out tail recursion.

But is checking the secondary pointer even needed these days?
fwnode_graph_get_next_endpoint() does that already, it's not something
drivers should be required to do.

--
Kind regards,

Sakari Ailus