From patchwork Thu Oct 7 15:03:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77544 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUxK-009JPa-FT; Thu, 07 Oct 2021 15:05:10 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242293AbhJGPHC (ORCPT + 1 other); Thu, 7 Oct 2021 11:07:02 -0400 Received: from mga01.intel.com ([192.55.52.88]:26555 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242289AbhJGPHB (ORCPT ); Thu, 7 Oct 2021 11:07:01 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249590777" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="249590777" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="484548000" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 07 Oct 2021 08:03:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EFB35B7; Thu, 7 Oct 2021 18:03:42 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 1/7] kernel.h: Drop unneeded inclusion from other headers Date: Thu, 7 Oct 2021 18:03:33 +0300 Message-Id: <20211007150339.28910-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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:03:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77543 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUx5-009JP0-1v; Thu, 07 Oct 2021 15:04:55 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242281AbhJGPGq (ORCPT + 1 other); Thu, 7 Oct 2021 11:06:46 -0400 Received: from mga09.intel.com ([134.134.136.24]:18349 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242269AbhJGPGp (ORCPT ); Thu, 7 Oct 2021 11:06:45 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="226171657" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="226171657" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="458820312" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 07 Oct 2021 08:03:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0C468299; Thu, 7 Oct 2021 18:03:43 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 2/7] kernel.h: Split out container_of() and typeof_member() macros Date: Thu, 7 Oct 2021 18:03:34 +0300 Message-Id: <20211007150339.28910-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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 +----------------------------- include/linux/kobject.h | 1 + 3 files changed, 39 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 diff --git a/include/linux/kobject.h b/include/linux/kobject.h index efd56f990a46..bf8371e58b17 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -15,6 +15,7 @@ #ifndef _KOBJECT_H_ #define _KOBJECT_H_ +#include #include #include #include From patchwork Thu Oct 7 15:03:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77541 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUws-009JOV-65; Thu, 07 Oct 2021 15:04:43 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242236AbhJGPGd (ORCPT + 1 other); Thu, 7 Oct 2021 11:06:33 -0400 Received: from mga18.intel.com ([134.134.136.126]:1647 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233341AbhJGPGd (ORCPT ); Thu, 7 Oct 2021 11:06:33 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="213220633" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="213220633" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="560593617" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 07 Oct 2021 08:03:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1982A3A3; Thu, 7 Oct 2021 18:03:43 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 3/7] kunit: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:03:35 +0300 Message-Id: <20211007150339.28910-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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:03:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77545 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUxY-009JPa-EM; Thu, 07 Oct 2021 15:05:26 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242302AbhJGPHQ (ORCPT + 1 other); Thu, 7 Oct 2021 11:07:16 -0400 Received: from mga11.intel.com ([192.55.52.93]:55497 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242290AbhJGPHQ (ORCPT ); Thu, 7 Oct 2021 11:07:16 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="223671745" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="223671745" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="522625855" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 07 Oct 2021 08:03:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 26EA23DB; Thu, 7 Oct 2021 18:03:43 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 4/7] list.h: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:03:36 +0300 Message-Id: <20211007150339.28910-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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:03:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77547 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUyI-009JdE-UX; Thu, 07 Oct 2021 15:06:11 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242325AbhJGPIC (ORCPT + 1 other); Thu, 7 Oct 2021 11:08:02 -0400 Received: from mga17.intel.com ([192.55.52.151]:18813 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242291AbhJGPIB (ORCPT ); Thu, 7 Oct 2021 11:08:01 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="207083083" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="207083083" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="545757983" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 07 Oct 2021 08:03:41 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 33C94489; Thu, 7 Oct 2021 18:03:43 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 5/7] llist: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:03:37 +0300 Message-Id: <20211007150339.28910-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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:03:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77548 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUzT-009JeW-6O; Thu, 07 Oct 2021 15:07:23 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242236AbhJGPJO (ORCPT + 1 other); Thu, 7 Oct 2021 11:09:14 -0400 Received: from mga04.intel.com ([192.55.52.120]:44482 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242244AbhJGPJJ (ORCPT ); Thu, 7 Oct 2021 11:09:09 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="225043770" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="225043770" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="524693076" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 07 Oct 2021 08:03:41 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 40664554; Thu, 7 Oct 2021 18:03:43 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 6/7] plist: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:03:38 +0300 Message-Id: <20211007150339.28910-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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:03:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 77546 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mYUxf-009JPa-2h; Thu, 07 Oct 2021 15:05:31 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242313AbhJGPHW (ORCPT + 1 other); Thu, 7 Oct 2021 11:07:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:55509 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242309AbhJGPHW (ORCPT ); Thu, 7 Oct 2021 11:07:22 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="223671781" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="223671781" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:03:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="715183567" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 07 Oct 2021 08:03:41 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4C989561; Thu, 7 Oct 2021 18:03:43 +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: Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Andrew Morton , Miguel Ojeda Subject: [PATCH v3 7/7] media: entity: Replace kernel.h with the necessary inclusions Date: Thu, 7 Oct 2021 18:03:39 +0300 Message-Id: <20211007150339.28910-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007150339.28910-1-andriy.shevchenko@linux.intel.com> References: <20211007150339.28910-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/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 */