Re: [PATCH v2 10/10] clk: at91: fix warning about missing const-safety

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Sam,

On 1/4/19 22:48, Sam Ravnborg wrote:
> Hi Ahmad.
> 
> On Mon, Apr 01, 2019 at 11:31:06AM +0200, Ahmad Fatoum wrote:
>> compiling clk-main.c results in:
>>
>> warning: passing argument 1 of 'memcpy' discards 'const' qualifier from
>> pointer target type [-Wdiscarded-qualifiers]
>>   memcpy(clkmain->clk.parent_names, parent_names, parents_array_size);
>>            ~~~~~~~~~~~~^~~~~~~~~~~~~
>>
>> Avoid this by replacing the xzalloc+memcpy pair with xmemdup.
>> Zero-initialization of the buffer isn't necessary, because
>> memcpy spans the whole buffer.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
> 
> It looks like clk-generated.c would suffer from the same
> if you managed to build it.
> Could you maybe verify and fix this too?

Indeed. I've sent a patch as reply to this thread.

Cheers
Ahmad

> 
> 	Sam
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux