Re: drivers/firmware/efi/libstub/efi-stub-helper.c:599:2: warning: implicit declaration of function 'memcpy'

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

 



2015-09-17 22:37 GMT+03:00 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>:
> On Thu, 17 Sep 2015 09:17:56 +0800 kbuild test robot <fengguang.wu@xxxxxxxxx> wrote:
>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   72714841b705a5b9bccf37ee85a62352bee3a3ef
>> commit: 393f203f5fd54421fddb1e2a263f64d3876eeadb x86_64: kasan: add interceptors for memset/memmove/memcpy functions
>> date:   7 months ago
>> config: i386-randconfig-i0-201537 (attached as .config)
>> reproduce:
>>   git checkout 393f203f5fd54421fddb1e2a263f64d3876eeadb
>>   # save the attached .config to linux build tree
>>   make ARCH=i386
>>
>> All warnings (new ones prefixed by >>):
>>
>>    drivers/firmware/efi/libstub/efi-stub-helper.c: In function 'efi_relocate_kernel':
>> >> drivers/firmware/efi/libstub/efi-stub-helper.c:599:2: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
>>      memcpy((void *)new_addr, (void *)cur_image_addr, image_size);
>
> I can't reproduce this.
>
> But whatever.  I'll do this:
>
> --- a/drivers/firmware/efi/libstub/efi-stub-helper.c~drivers-firmware-efi-libstub-efi-stub-helperc-needs-stringh
> +++ a/drivers/firmware/efi/libstub/efi-stub-helper.c
> @@ -11,6 +11,7 @@
>   */
>
>  #include <linux/efi.h>
> +#include <linux/string.h>

This won't help.
arch/x86/include/asm/string_32.h has several variants of #define memcpy()
But it doesn't have declaration of memcpy function like:
            void memcpy(const void *to, const void *from, size_t len);
Thus '#undef memcpy' causes this warning, and including
<linux/string.h> won't help (It probably already included)

Patch from KASAN for arm64 series:
http://marc.info/?l=linux-mm&m=144248270719929&w=2 ([PATCH v6 3/6]
x86, efi, kasan: #undef memset/memcpy/memmove per arch.)
should fix this warning, as it moves '#undef memcpy' under #ifdef
X86_64 in arch/x86/include/asm/efi.h

>  #include <asm/efi.h>
>
>  #include "efistub.h"
> _
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]