Re: [PATCH] firmware: qcom_scm: Fix coccinelle warning

From: Konrad Dybcio

Date: Thu Feb 05 2026 - 06:05:01 EST


On 2/5/26 9:23 AM, Mukesh Ojha wrote:
> On Mon, Feb 02, 2026 at 12:51:31PM +0100, Konrad Dybcio wrote:
>> On 2/2/26 12:32 PM, Mukesh Ojha wrote:
>>> Fix coccinelle warning of allocation and memory copying to allocated
>>> memory by replacing with kmemdup.
>>>
>>> cocci warnings: (new ones prefixed by >>)
>>>>> drivers/firmware/qcom/qcom_scm.c:916:11-18: WARNING opportunity for kmemdup
>>>
>>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>>> Closes: https://lore.kernel.org/oe-kbuild-all/202601142144.HvSlBSI9-lkp@xxxxxxxxx/
>>> Signed-off-by: Mukesh Ojha <mukesh.ojha@xxxxxxxxxxxxxxxx>
>>> ---
>>
>> Preferably the subject would say something like 'don't opencode kmemdup',
>> but that's minor
>
> Thanks, Just checking if the tool name like coccinelle, smatch, sparse
> who may find some issue is not preferrable to get mentioned in commit at all ?

I think it's even required to mention it somewhere in the message..
I can't find the actual reference, but Greg said this last week:

https://lore.kernel.org/linux-arm-msm/2026012748-unblock-vacation-70b8@gregkh/

Konrad