lkml.org 
[lkml]   [2023]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/6] firmware: arm_scmi: Simplify enable/disable Clock operations
From
Date
Quoting Cristian Marussi (2023-08-24 07:25:21)
> On Wed, Aug 23, 2023 at 11:01:17AM -0700, Stephen Boyd wrote:
> >
> > Perhaps we need a local variable to make it more readable.
> >
> > static int scmi_clk_enable(struct clk_hw *hw)
> > {
> > bool can_sleep = false;
> > struct scmi_clk *clk = to_scmi_clk(hw);
> >
> > return scmi_proto_clk_ops->enable(clk->ph, clk->id, can_sleep);
> > }
> >
> > This let's the reader quickly understand what the parameter means. I'm
> > OK with adding the function parameter, but a plain 'true' or 'false'
> > doesn't help with clarity.
>
> Thanks for the suggestion, it would help definitely making it more
> readable, maybe a local define or enum could make it without even
> putting anything on the stack.
>

Surely the compiler can optimize that so there isn't stack local
storage for a local variable used as an argument to a function call?

\
 
 \ /
  Last update: 2023-08-24 20:45    [W:0.057 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site