From patchwork Thu Oct 7 15:44:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77552 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVZ6-009LvZ-5U; Thu, 07 Oct 2021 15:44:12 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242411AbhJGPqD (ORCPT + 1 other); Thu, 7 Oct 2021 11:46:03 -0400 Received: from mga02.intel.com ([134.134.136.20]:27707 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242391AbhJGPqC (ORCPT ); Thu, 7 Oct 2021 11:46:02 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="213423790" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="213423790" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="657430583" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2021 08:44:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3E392291; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 1/7] kernel.h: Drop unneeded inclusion from other headers Date: Thu, 7 Oct 2021 18:44:01 +0300 Message-Id: <20211007154407.29746-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no There is no evidence we need kernel.h inclusion in certain headers. Drop unneeded inclusion from other headers. Signed-off-by: Andy Shevchenko --- include/linux/rwsem.h | 1 - include/linux/spinlock.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 352c6127cb90..f9348769e558 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -11,7 +11,6 @@ #include #include -#include #include #include #include diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 76a855b3ecde..c04e99edfe92 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include From patchwork Thu Oct 7 15:44:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77557 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVZI-009LxP-9m; Thu, 07 Oct 2021 15:44:24 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242419AbhJGPqE (ORCPT + 1 other); Thu, 7 Oct 2021 11:46:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:27707 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233463AbhJGPqC (ORCPT ); Thu, 7 Oct 2021 11:46:02 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="213423794" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="213423794" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="657430584" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2021 08:44:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 486BC299; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 2/7] kernel.h: Split out container_of() and typeof_member() macros Date: Thu, 7 Oct 2021 18:44:02 +0300 Message-Id: <20211007154407.29746-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no kernel.h is being used as a dump for all kinds of stuff for a long time. Here is the attempt cleaning it up by splitting out container_of() and typeof_member() macros. For time being include new header back to kernel.h to avoid twisted indirected includes for existing users. Note, there are _a lot_ of headers and modules that include kernel.h solely for one of these macros and this allows to unburden compiler for the twisted inclusion paths and to make new code cleaner in the future. Signed-off-by: Andy Shevchenko --- include/linux/container_of.h | 37 ++++++++++++++++++++++++++++++++++++ include/linux/kernel.h | 31 +----------------------------- 2 files changed, 38 insertions(+), 30 deletions(-) create mode 100644 include/linux/container_of.h diff --git a/include/linux/container_of.h b/include/linux/container_of.h new file mode 100644 index 000000000000..f6ee1be0e784 --- /dev/null +++ b/include/linux/container_of.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CONTAINER_OF_H +#define _LINUX_CONTAINER_OF_H + +#define typeof_member(T, m) typeof(((T*)0)->m) + +/** + * container_of - cast a member of a structure out to the containing structure + * @ptr: the pointer to the member. + * @type: the type of the container struct this is embedded in. + * @member: the name of the member within the struct. + * + */ +#define container_of(ptr, type, member) ({ \ + void *__mptr = (void *)(ptr); \ + BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ + !__same_type(*(ptr), void), \ + "pointer type mismatch in container_of()"); \ + ((type *)(__mptr - offsetof(type, member))); }) + +/** + * container_of_safe - cast a member of a structure out to the containing structure + * @ptr: the pointer to the member. + * @type: the type of the container struct this is embedded in. + * @member: the name of the member within the struct. + * + * If IS_ERR_OR_NULL(ptr), ptr is returned unchanged. + */ +#define container_of_safe(ptr, type, member) ({ \ + void *__mptr = (void *)(ptr); \ + BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ + !__same_type(*(ptr), void), \ + "pointer type mismatch in container_of()"); \ + IS_ERR_OR_NULL(__mptr) ? ERR_CAST(__mptr) : \ + ((type *)(__mptr - offsetof(type, member))); }) + +#endif /* _LINUX_CONTAINER_OF_H */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d416fe3165cb..ad9fdcce9dcf 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -482,36 +483,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } #define __CONCAT(a, b) a ## b #define CONCATENATE(a, b) __CONCAT(a, b) -/** - * container_of - cast a member of a structure out to the containing structure - * @ptr: the pointer to the member. - * @type: the type of the container struct this is embedded in. - * @member: the name of the member within the struct. - * - */ -#define container_of(ptr, type, member) ({ \ - void *__mptr = (void *)(ptr); \ - BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ - !__same_type(*(ptr), void), \ - "pointer type mismatch in container_of()"); \ - ((type *)(__mptr - offsetof(type, member))); }) - -/** - * container_of_safe - cast a member of a structure out to the containing structure - * @ptr: the pointer to the member. - * @type: the type of the container struct this is embedded in. - * @member: the name of the member within the struct. - * - * If IS_ERR_OR_NULL(ptr), ptr is returned unchanged. - */ -#define container_of_safe(ptr, type, member) ({ \ - void *__mptr = (void *)(ptr); \ - BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ - !__same_type(*(ptr), void), \ - "pointer type mismatch in container_of()"); \ - IS_ERR_OR_NULL(__mptr) ? ERR_CAST(__mptr) : \ - ((type *)(__mptr - offsetof(type, member))); }) - /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ #ifdef CONFIG_FTRACE_MCOUNT_RECORD # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD From patchwork Thu Oct 7 15:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77554 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVZB-009LwE-1n; Thu, 07 Oct 2021 15:44:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242433AbhJGPqE (ORCPT + 1 other); Thu, 7 Oct 2021 11:46:04 -0400 Received: from mga07.intel.com ([134.134.136.100]:40735 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242407AbhJGPqD (ORCPT ); Thu, 7 Oct 2021 11:46:03 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289784194" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="289784194" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="715196539" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 07 Oct 2021 08:44:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 526CA3A3; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 3/7] kunit: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:44:03 +0300 Message-Id: <20211007154407.29746-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko --- include/kunit/test.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/kunit/test.h b/include/kunit/test.h index 24b40e5c160b..d88d9f7ead0a 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -11,11 +11,21 @@ #include #include -#include + +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include -#include + +#include struct kunit_resource; From patchwork Thu Oct 7 15:44:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77553 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVZA-009LwE-5W; Thu, 07 Oct 2021 15:44:16 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242442AbhJGPqF (ORCPT + 1 other); Thu, 7 Oct 2021 11:46:05 -0400 Received: from mga02.intel.com ([134.134.136.20]:27707 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242421AbhJGPqE (ORCPT ); Thu, 7 Oct 2021 11:46:04 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="213423814" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="213423814" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="478610545" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2021 08:44:04 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5D01F3DB; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 4/7] list.h: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:44:04 +0300 Message-Id: <20211007154407.29746-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko --- include/linux/list.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/list.h b/include/linux/list.h index f2af4b4aa4e9..5dc679b373da 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -2,11 +2,13 @@ #ifndef _LINUX_LIST_H #define _LINUX_LIST_H +#include +#include #include #include #include -#include -#include + +#include /* * Circular doubly linked list implementation. From patchwork Thu Oct 7 15:44:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77558 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVs0-009NIh-DA; Thu, 07 Oct 2021 16:03:44 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242405AbhJGQFf (ORCPT + 1 other); Thu, 7 Oct 2021 12:05:35 -0400 Received: from mga05.intel.com ([192.55.52.43]:31298 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242330AbhJGQFf (ORCPT ); Thu, 7 Oct 2021 12:05:35 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="312493187" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="312493187" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="560607981" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 07 Oct 2021 08:44:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 68FD7489; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 5/7] llist: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:44:05 +0300 Message-Id: <20211007154407.29746-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko --- include/linux/llist.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/llist.h b/include/linux/llist.h index 24f207b0190b..85bda2d02d65 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -49,7 +49,9 @@ */ #include -#include +#include +#include +#include struct llist_head { struct llist_node *first; From patchwork Thu Oct 7 15:44:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77556 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVZE-009Lwn-Gu; Thu, 07 Oct 2021 15:44:20 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242493AbhJGPqM (ORCPT + 1 other); Thu, 7 Oct 2021 11:46:12 -0400 Received: from mga06.intel.com ([134.134.136.31]:45046 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242407AbhJGPqL (ORCPT ); Thu, 7 Oct 2021 11:46:11 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287168772" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="287168772" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="568676724" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 07 Oct 2021 08:44:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7595A554; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 6/7] plist: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:44:06 +0300 Message-Id: <20211007154407.29746-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko --- include/linux/plist.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/plist.h b/include/linux/plist.h index 66bab1bca35c..0f352c1d3c80 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h @@ -73,8 +73,11 @@ #ifndef _LINUX_PLIST_H_ #define _LINUX_PLIST_H_ -#include +#include #include +#include + +#include struct plist_head { struct list_head node_list; From patchwork Thu Oct 7 15:44:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77555 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYVZD-009Lwn-Am; Thu, 07 Oct 2021 15:44:19 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242476AbhJGPqK (ORCPT + 1 other); Thu, 7 Oct 2021 11:46:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:30725 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242458AbhJGPqH (ORCPT ); Thu, 7 Oct 2021 11:46:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249602644" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="249602644" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:44:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="524708629" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 07 Oct 2021 08:44:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 81F93561; Thu, 7 Oct 2021 18:44:10 +0300 (EEST) From: Andy Shevchenko To: Brendan Higgins , Andy Shevchenko , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda , jic23@kernel.org, linux@rasmusvillemoes.dk, Thorsten Leemhuis Subject: [PATCH v4 7/7] media: entity: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:44:07 +0300 Message-Id: <20211007154407.29746-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> References: <20211007154407.29746-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Acked-by: Sakari Ailus --- include/media/media-entity.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 09737b47881f..fea489f03d57 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -13,10 +13,11 @@ #include #include +#include #include -#include #include #include +#include /* Enums used internally at the media controller to represent graphs */