<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Mar 12, 2025 at 11:48 AM Doug Anderson <<a href="mailto:dianders@chromium.org">dianders@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On Wed, Mar 12, 2025 at 8:06 AM Anusha Srivatsa <<a href="mailto:asrivats@redhat.com" target="_blank">asrivats@redhat.com</a>> wrote:<br>
><br>
>> > @@ -106,53 +107,46 @@ static int r63353_panel_power_off(struct r63353_panel *rpanel)<br>
>> >Â static int r63353_panel_activate(struct r63353_panel *rpanel)<br>
>> >Â {<br>
>> >Â Â Â Â struct mipi_dsi_device *dsi = rpanel->dsi;<br>
>> > -Â Â Â struct device *dev = &dsi->dev;<br>
>> > -Â Â Â int i, ret;<br>
>> > +Â Â Â struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };<br>
>> > +Â Â Â int i;<br>
>> ><br>
>> > -Â Â Â ret = mipi_dsi_dcs_soft_reset(dsi);<br>
>> > -Â Â Â if (ret < 0) {<br>
>> > -Â Â Â Â Â Â Â dev_err(dev, "Failed to do Software Reset (%d)\n", ret);<br>
>> > +Â Â Â mipi_dsi_dcs_soft_reset_multi(&dsi_ctx);<br>
>> > +Â Â Â if (dsi_ctx.accum_err)<br>
>> >Â Â Â Â Â Â Â Â goto fail;<br>
>> > -Â Â Â }<br>
>><br>
>> This changes was definitely not what the script is doing.<br>
><br>
><br>
> 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.<br>
<br>
...and now you're getting to see why I didn't think a coccinelle<br>
script could fully handle this task. ;-) IMO instead of trying to get<br>
a coccinelle script to do the full conversion, the right approach<br>
would be to use a coccinelle script (or equivalent) to get the basics<br>
done (just so you don't make any typos) and then cleanup the result<br>
manually. Spending more time on the coccinelle script than it would<br>
take to do the conversion manually is probably not the right approach.<br>
<br>
If your patch wasn't fully generated by a coccinelle script you should<br>
document that in the commit message. Something like "Initial patch was<br>
generated by a coccinelle script and the result was cleaned up<br>
manually." If the script is too long to fit in the commit message,<br>
it's fine to put it somewhere online and provide a link. "Somewhere<br>
online" could easily be a mailing list post.<br>
<br></blockquote><div><br></div><div>You know I have been thinking if it makes sense to have this script merged to coccinelle project and add those details in the commit log.... Was having an offline discussion with <a class="gmail_plusreply" id="plusReplyChip-2" href="mailto:mripard@redhat.com" tabindex="-1">@Maxime Ripard</a> today and he rightly pointed out that since it is too specific, once all the conversions are done , the script would not be further useable....</div><div>About having the script online and providing a link, something link a github link? <br></div><div><br></div><div><br></div><div>Anusha</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
</blockquote></div></div>