From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbcBKLSe (ORCPT ); Thu, 11 Feb 2016 06:18:34 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:43908 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751240AbcBKLSd (ORCPT ); Thu, 11 Feb 2016 06:18:33 -0500 Date: Thu, 11 Feb 2016 11:49:03 +0100 From: Ralf Baechle To: Daniel Wagner Cc: "Maciej W. Rozycki" , linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH v4 2/2] mips: Differentiate between 32 and 64 bit ELF header Message-ID: <20160211104903.GD11091@linux-mips.org> References: <56BAD881.9000208@bmw-carit.de> <1455096081-7176-1-git-send-email-daniel.wagner@bmw-carit.de> <1455096081-7176-3-git-send-email-daniel.wagner@bmw-carit.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1455096081-7176-3-git-send-email-daniel.wagner@bmw-carit.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2016 at 10:21:21AM +0100, Daniel Wagner wrote: > Depending on the configuration either the 32 or 64 bit version of > elf_check_arch() is defined. parse_crash_elf{32|64}_headers() does > some basic verification of the ELF header via > vmcore_elf{32|64}_check_arch() which happen to map to elf_check_arch(). > Since the implementation 32 and 64 bit version of elf_check_arch() > differ, we use the wrong type: > > In file included from include/linux/elf.h:4:0, > from fs/proc/vmcore.c:13: > fs/proc/vmcore.c: In function 'parse_crash_elf64_headers': > >> arch/mips/include/asm/elf.h:228:23: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] > struct elfhdr *__h = (hdr); \ > ^ > include/linux/crash_dump.h:41:37: note: in expansion of macro 'elf_check_arch' > #define vmcore_elf64_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) > ^ > fs/proc/vmcore.c:1015:4: note: in expansion of macro 'vmcore_elf64_check_arch' > !vmcore_elf64_check_arch(&ehdr) || > ^ > > Therefore, we rather define vmcore_elf{32|64}_check_arch() as a > basic machine check and use it also in binfm_elf?32.c as well. > > Signed-off-by: Daniel Wagner > Suggested-by: Maciej W. Rozycki > Reviewed-by: Maciej W. Rozycki > Reported-by: Fengguang Wu Thanks, applied. I'm getting a less spectacular warning from gcc 5.2: CC fs/proc/vmcore.o fs/proc/vmcore.c: In function ‘parse_crash_elf64_headers’: fs/proc/vmcore.c:939:47: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] Ralf