Received: by 10.213.65.68 with SMTP id h4csp9012imn; Fri, 16 Mar 2018 15:29:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELtLSBdG0IbxbPE38Dk1XuUNcJbZp1hu8I2RQN5VSOcBN/nH+2nGfqbEwkZmpZr9wyvMHwsB X-Received: by 2002:a17:902:2e:: with SMTP id 43-v6mr3728814pla.282.1521239379559; Fri, 16 Mar 2018 15:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521239379; cv=none; d=google.com; s=arc-20160816; b=C/Sw0sMlTNXbEoU/BNUVYEC6bUegxjqQmXVne2eVVsVdPsvOWa5z1cQaUJBHqzhEgU M1ltYmyadK6sSPzF8JVy2GE0hivHEcMEerkxqc7hVy38jmualqEyFgvLd2n/BD/RffOb aVjHVELmEQrtwMKCVcPcVE4aHp7U4mdb9GdA2dYSeiCkdFtcxR75vUmv4kk0rnGsXpyi innfXPpAMydD5tyinBos/ZAhCSmukU/meX+BOoaeGM3ghFv0b7eRKDDcTALBBTdBG2FF 3Z4UCpDHr4g6xhv7ECmJEZJ16Pupr4Ndu0jWLOBvGGeTmUJbwFoVs+rr1v2nO5+ynq0E a6VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=pbL6R9yo8H2/KEYdvZyjeLfcVGibSjo0EzjMa/GE7Kc=; b=lHOlOwfw1Ro26/eQAdnvRs1o9qMckHBZEz6YLm0gRw2PjsjVdQIRGLNuoD6bZsG13K W4YzOjWVmEVjXf5JsrDw2zfSNxfn0cHUDXWvIzFt9xHlGr2ToQaBSCXrRL+ZKsViG/QX V/8t0f6jPMuYy/Q8QpGuc2hf+r3hY0KWzBPZlP+sMSSDsS7Ox3NKzOwN1lzkAtJ3xyBS IbGxG5+diPRrn7zrbi+3Hay4+Mo4EFcLAi3ZJf0yDEhwV5VURE00INKxicZN5wztlwSC ZP89jz8rJAvi7g4lLf4ZQdsjtzv6JeK7o6pyuUhkOVq/iDVsIRm1wNdi2PUimJGBtLTB CYzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si4954756pgv.261.2018.03.16.15.29.24; Fri, 16 Mar 2018 15:29:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752386AbeCPW23 (ORCPT + 99 others); Fri, 16 Mar 2018 18:28:29 -0400 Received: from mga14.intel.com ([192.55.52.115]:51360 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbeCPW21 (ORCPT ); Fri, 16 Mar 2018 18:28:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2018 15:28:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,317,1517904000"; d="scan'208";a="25372790" Received: from ray.jf.intel.com (HELO [10.7.201.16]) ([10.7.201.16]) by orsmga007.jf.intel.com with ESMTP; 16 Mar 2018 15:28:27 -0700 Subject: Re: [PATCH v12 16/22] selftests/vm: fix an assertion in test_pkey_alloc_exhaust() To: Ram Pai , shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> <1519264541-7621-17-git-send-email-linuxram@us.ibm.com> Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, akpm@linux-foundation.org, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, arnd@arndb.de From: Dave Hansen Message-ID: <98204562-7c91-23f0-101b-508954020353@intel.com> Date: Fri, 16 Mar 2018 15:28:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519264541-7621-17-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 05:55 PM, Ram Pai wrote: > +static inline int arch_reserved_keys(void) > +{ > +#if defined(__i386__) || defined(__x86_64__) /* arch */ > + return NR_RESERVED_PKEYS; > +#elif __powerpc64__ /* arch */ > + if (sysconf(_SC_PAGESIZE) == 4096) > + return NR_RESERVED_PKEYS_4K; > + else > + return NR_RESERVED_PKEYS_64K; > +#else /* arch */ > + NOT SUPPORTED > +#endif /* arch */ > +} Yeah, this is hideous. Please either do it in one header: #ifdef x86.. static inline int arch_reserved_keys(void) { } ... #elif ppc static inline int arch_reserved_keys(void) { } ... #else #error #endif Or in multiple: #ifdef x86.. #include #elif ppc #include #else #error #endif