Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578AbcKGX5w (ORCPT ); Mon, 7 Nov 2016 18:57:52 -0500 Received: from ozlabs.org ([103.22.144.67]:46233 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbcKGX5u (ORCPT ); Mon, 7 Nov 2016 18:57:50 -0500 From: Michael Ellerman To: Dmitry Safonov <0x7f454c46@gmail.com>, Benjamin Herrenschmidt , Paul Mackerras Cc: Dmitry Safonov , linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, open list Subject: Re: [PATCHv3 0/8] powerpc/mm: refactor vDSO mapping code In-Reply-To: References: <20161027170948.8279-1-dsafonov@virtuozzo.com> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Tue, 08 Nov 2016 10:57:49 +1100 Message-ID: <87pom6lu6a.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1222 Lines: 47 Dmitry Safonov <0x7f454c46@gmail.com> writes: > 2016-10-27 20:09 GMT+03:00 Dmitry Safonov : > > ping? There's another series doing some similar changes: http://www.spinics.net/lists/linux-mm/msg115860.html And I don't like all the macro games in 3/8, eg: +#ifndef BITS +#define BITS 32 +#endif + +#undef Elf_Ehdr +#undef Elf_Sym +#undef Elf_Shdr + +#define _CONCAT3(a, b, c) a ## b ## c +#define CONCAT3(a, b, c) _CONCAT3(a, b, c) +#define Elf_Ehdr CONCAT3(Elf, BITS, _Ehdr) +#define Elf_Sym CONCAT3(Elf, BITS, _Sym) +#define Elf_Shdr CONCAT3(Elf, BITS, _Shdr) +#define VDSO_LBASE CONCAT3(VDSO, BITS, _LBASE) +#define vdso_kbase CONCAT3(vdso, BITS, _kbase) +#define vdso_pages CONCAT3(vdso, BITS, _pages) + +#undef pr_fmt +#define pr_fmt(fmt) "vDSO" __stringify(BITS) ": " fmt + +#define lib_elfinfo CONCAT3(lib, BITS, _elfinfo) + +#define find_section CONCAT3(find_section, BITS,) +static void * __init find_section(Elf_Ehdr *ehdr, const char *secname, + unsigned long *size) I'd rather we kept the duplication of code than the obfuscation those macros add. If we can come up with a way to share more of the code without having to do all those tricks then I'd be interested. cheers