Message ID | 20231121103829.10027-2-raag.jadav@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp528923vqb; Tue, 21 Nov 2023 02:39:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkcitKzL2f9pfEUmsIAbbQfA9PV1Xj8siccOgWZXRaObYdfA012SeIM4PitRPW48vni+BE X-Received: by 2002:a17:90b:4f4e:b0:27c:f8bd:9a98 with SMTP id pj14-20020a17090b4f4e00b0027cf8bd9a98mr6792397pjb.40.1700563169753; Tue, 21 Nov 2023 02:39:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700563169; cv=none; d=google.com; s=arc-20160816; b=CWPUJxbjQDiuxWY4epfqRfTMw57MB1HN8xGziScR8x41FS8J+QF3AuzBlfpDRFhKtm k2b9TI2j9ekhqCXq/9iqvqWnsSxK1Uxe25ZkubSMHboeKItCvCseTzZ5NB2AdZP/0JEx 9QyKt3rxdC+Fn0Q1SC+Hi/VjC/QFEOHbe7EdquZ+AJOu72xkDBI2WwCHYwjUwr6gDwnn Z9bFF3kH+zNU4COCmR4TNmK6j4v5T23kG7V4U+hGwNWWN3kO1V0pcB+sr8rwMO+33eOS q0TNdgsgi9ii4a2Lh4B8KcnPB7ZA3P9jZc/jhxCHdA7aAp16oEeTcC/8X3PhgsvhPq3t ONbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=UYuaGZUjxfzdAuLhB5OcrH7ivs9adYa42PE9cf+S7zQ=; fh=LrjGCQr9k+7CYyd6XEdJgJkCFIUW/cPwqK3zW8PbdHI=; b=qDwxtllONj6vPQG9L9sHCD8ywVkXXu4CTFNcwHy5Iy+pVKRw9nqp4KVhPZc3LdTI1U Sm/RjPOEnXud4LvzF7Ij01/rsy6l8x/UCOL3+024s197Y34gIIrKDLhTUsnzyFwN1HMI R9ooyQglOg0XyUl9bB7QNItCo6UkL5LyKeje8HkDsm9Xywjl71ywc35o7J/1L3kGk96I 2SWcVN0UgEEuoTMTx2qfHzyluL3mT+FUtMQvXcvw42krK3tfM5eEy1Zysyn+aZBlU9PK j6c+qXjY3AC12HSMdsGDFGgONP2tXc6vppph3wiar4n3x1mW/9Qy5ytvwOOpQ7Fj1Ao5 iqrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V0ATkxLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id jx17-20020a17090b46d100b0028534d6522asi2326315pjb.22.2023.11.21.02.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 02:39:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V0ATkxLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 10A9380443A4; Tue, 21 Nov 2023 02:39:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233819AbjKUKit (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Tue, 21 Nov 2023 05:38:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233815AbjKUKip (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Nov 2023 05:38:45 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D9FF12A; Tue, 21 Nov 2023 02:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700563122; x=1732099122; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=vkKEZYR1JQ2LvJYNE9fzcULsL9BK72aBp+vTKNFQKvk=; b=V0ATkxLAX2zb5epvwIRWvnnIjc7K4gP1JADnDtvS9t7ZJ/28zKIY+boV Qx8qVfTtmeYJtA49bBwArz1yXAaiHOgwxsKTuRvGW5IeSCBB1TNlyKToI fJUDeraEm2hV9mZZ8IoY0gDsxdTVICfoS0S8H8OCqlEt/uLkLk1rFWkYl gbhRXGxXV20s/BfQvvSdm8AIehMSuQFqJT3CbgIrSb2BnrAxql98vlHQ8 y0zgT7S3NbHklZJzJnhF5QHbt8ejAdTSVm/oRn3cBXEidMIRz3HPfHw5g KTQnDECW6GJaik9bfczUU0Emhuyfxg7dQ2lV6gZlnjF6JYRdHz6k2F+py A==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="371986859" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="371986859" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 02:38:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="14871920" Received: from inlubt0316.iind.intel.com ([10.191.20.213]) by fmviesa001.fm.intel.com with ESMTP; 21 Nov 2023 02:38:38 -0800 From: Raag Jadav <raag.jadav@intel.com> To: mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, rafael@kernel.org, lenb@kernel.org, robert.moore@intel.com, ardb@kernel.org, will@kernel.org, mark.rutland@arm.com Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com, Raag Jadav <raag.jadav@intel.com> Subject: [PATCH v2 1/6] compiler.h: Introduce helpers for identifying array and pointer types Date: Tue, 21 Nov 2023 16:08:24 +0530 Message-Id: <20231121103829.10027-2-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231121103829.10027-1-raag.jadav@intel.com> References: <20231121103829.10027-1-raag.jadav@intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 02:39:22 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783169726089218180 X-GMAIL-MSGID: 1783169726089218180 |
Series |
Support _UID matching for integer types
|
|
Commit Message
Raag Jadav
Nov. 21, 2023, 10:38 a.m. UTC
Introduce is_array_type() and is_pointer_type() helpers, which compare the
data type of provided argument against the enumeration values defined in
typeclass.h using __builtin_classify_type() function and identify array
and pointer types respectively.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
include/linux/compiler.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index bb1339c7057b..b4f656002c0f 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -242,6 +242,11 @@ static inline void *offset_to_ptr(const int *off) #define is_signed_type(type) (((type)(-1)) < (__force type)1) #define is_unsigned_type(type) (!is_signed_type(type)) +/* Classify data type based on enum values in typeclass.h */ +#define is_array_type(x) (__builtin_classify_type(x) == 14) +#define is_pointer_type(x) (__builtin_classify_type(x) == 5) +#define is_array_or_pointer_type(x) (is_array_type(x) || is_pointer_type(x)) + /* * This is needed in functions which generate the stack canary, see * arch/x86/kernel/smpboot.c::start_secondary() for an example.