[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=XdngrNhUn8jQ3FGitkBCkiQO1dXnPhCKj+S5Jo8_WUrQ@mail.gmail.com>
Date: Wed, 12 Mar 2025 08:47:59 -0700
From: Doug Anderson <dianders@...omium.org>
To: Anusha Srivatsa <asrivats@...hat.com>
Cc: Maxime Ripard <mripard@...nel.org>, Michael Trimarchi <michael@...rulasolutions.com>,
Neil Armstrong <neil.armstrong@...aro.org>, Jessica Zhang <quic_jesszhan@...cinc.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Tejas Vipin <tejasvipin76@...il.com>
Subject: Re: [PATCH v2] drm/panel/synaptics-r63353: Use _multi variants
Hi,
On Wed, Mar 12, 2025 at 8:06 AM Anusha Srivatsa <asrivats@...hat.com> wrote:
>
>> > @@ -106,53 +107,46 @@ static int r63353_panel_power_off(struct r63353_panel *rpanel)
>> > static int r63353_panel_activate(struct r63353_panel *rpanel)
>> > {
>> > struct mipi_dsi_device *dsi = rpanel->dsi;
>> > - struct device *dev = &dsi->dev;
>> > - int i, ret;
>> > + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>> > + int i;
>> >
>> > - ret = mipi_dsi_dcs_soft_reset(dsi);
>> > - if (ret < 0) {
>> > - dev_err(dev, "Failed to do Software Reset (%d)\n", ret);
>> > + mipi_dsi_dcs_soft_reset_multi(&dsi_ctx);
>> > + if (dsi_ctx.accum_err)
>> > goto fail;
>> > - }
>>
>> This changes was definitely not what the script is doing.
>
>
> It isnt. Using coccinelle for the major part of pattern matching and replacing the newer _multi variant API. Some handling (including a newline that it introduces) and the returns depend on a case by case basis, which had to be done manually.
...and now you're getting to see why I didn't think a coccinelle
script could fully handle this task. ;-) IMO instead of trying to get
a coccinelle script to do the full conversion, the right approach
would be to use a coccinelle script (or equivalent) to get the basics
done (just so you don't make any typos) and then cleanup the result
manually. Spending more time on the coccinelle script than it would
take to do the conversion manually is probably not the right approach.
If your patch wasn't fully generated by a coccinelle script you should
document that in the commit message. Something like "Initial patch was
generated by a coccinelle script and the result was cleaned up
manually." If the script is too long to fit in the commit message,
it's fine to put it somewhere online and provide a link. "Somewhere
online" could easily be a mailing list post.
-Doug
Powered by blists - more mailing lists