Received: by 10.213.65.68 with SMTP id h4csp7381imn; Fri, 16 Mar 2018 15:25:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELu7mamkIWdDwDAn3iWftd7nPJn1rQZAc4Lg2Nj++lllTOGJp55YlhCBbxvS3SKS0N6AMdWX X-Received: by 10.99.4.214 with SMTP id 205mr2688867pge.375.1521239120545; Fri, 16 Mar 2018 15:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521239120; cv=none; d=google.com; s=arc-20160816; b=j6tDA50EI9M+6G7eMSUuRzxymBrPvhDH4HlXHTD0s4trYKFcJew7UycmmZ1Z0hu/5h VA6ckWXSX+ZBQxSOPr7P2BUd6Qca4QVNPmdMAC4oThflcWkJmFAxGSN5tYJWPN6UVGdM /KRfF68Rd4Ybj9Aqf7fml9Ahu5k/dprqO61xCSyeWE7L9FxTZ8Mr6+neeJjUWhWCquh2 A1xRaIVMp1zfyJyzPkMs/V9cgd17f1VzX6LzScSPoV7hZYIiU3GGhYSCPsxnpGg8SBcI 66atKwW5aZpU9lVm73OrpGe7POhdQOJRWm9iVqUuS/+8eFC2701srGj1+LXEmfMgudOQ rLoA== 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=R6cAzCb/3TrRtT1oK/umW9mVVQ9pVuPyLfqeHcSl3Qc=; b=oJ2jXdLEimGgzsZ8U6c+Jv8+kxZgrrvZ8suHEoheGhu4Sy4ksnMMhPIXV+gnL66wcd LuCu+qXyLEw3drigMB14JzmZEiDGnw1JtrtUzx1cQ+Ptd1sDZh2HYvcAACaJZvO2V3Ho pqikPG+MURtRFsnPfUWfqvR3GekGRyAliLKtO9CopZLPXJM2XUM6eaQRW8z2TPwfrS9t t+vXXYyiAGex3G54Z+zF6eNIDlV+Gyq1qd5m8sc+ntJnuCJRvL/2hKskKk41WB+MhIn1 tEA0VVA//du77d6ndKft29vSEBzOZWL1hKFDG0j6TMwZBGI8xeaeuOr5dtTgTgP3iHXU 1hGQ== 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 t9-v6si6878852plq.321.2018.03.16.15.25.04; Fri, 16 Mar 2018 15:25:20 -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 S1752216AbeCPWXj (ORCPT + 99 others); Fri, 16 Mar 2018 18:23:39 -0400 Received: from mga04.intel.com ([192.55.52.120]:37918 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbeCPWXh (ORCPT ); Fri, 16 Mar 2018 18:23:37 -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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2018 15:23:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,317,1517904000"; d="scan'208";a="25371971" 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:23:36 -0700 Subject: Re: [PATCH v12 13/22] selftests/vm: powerpc implementation for generic abstraction 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-14-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: <5e27e966-d1b9-e56d-45cd-43524fd4448c@intel.com> Date: Fri, 16 Mar 2018 15:23:28 -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-14-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 u32 pkey_to_shift(int pkey) > { > +#if defined(__i386__) || defined(__x86_64__) /* arch */ > return pkey * PKEY_BITS_PER_PKEY; > +#elif __powerpc64__ /* arch */ > + return (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY; > +#endif /* arch */ > } I really detest the #if #else style. Can't we just have a pkey_ppc.h and a pkey_x86.h or something?