On Mon, Jun 09, 2025 at 09:08:17AM +0800, Li Jun wrote: > the reset_control_assert(wkupm3->rsts) should assign a value > to 'error' before it is return, so the var don't need init > to 0. >
The zero-initialization is indeed unnecessary, but your commit message describe a problem that doesn't exist. The current code matches the style of the Linux kernel better, with local variables declared before the body of the function. Regards, Bjorn > Signed-off-by: Li Jun <[email protected]> > --- > drivers/remoteproc/wkup_m3_rproc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/remoteproc/wkup_m3_rproc.c > b/drivers/remoteproc/wkup_m3_rproc.c > index d8be21e71721..24d72fcc26f9 100644 > --- a/drivers/remoteproc/wkup_m3_rproc.c > +++ b/drivers/remoteproc/wkup_m3_rproc.c > @@ -77,9 +77,7 @@ static int wkup_m3_rproc_stop(struct rproc *rproc) > struct platform_device *pdev = wkupm3->pdev; > struct device *dev = &pdev->dev; > struct wkup_m3_platform_data *pdata = dev_get_platdata(dev); > - int error = 0; > - > - error = reset_control_assert(wkupm3->rsts); > + int error = reset_control_assert(wkupm3->rsts); > > if (!wkupm3->rsts && pdata->assert_reset(pdev, pdata->reset_name)) { > dev_err(dev, "Unable to assert reset of wkup_m3!\n"); > -- > 2.25.1 >
