From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B024DC07E96 for ; Tue, 13 Jul 2021 11:23:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 966FE611C0 for ; Tue, 13 Jul 2021 11:23:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235914AbhGMLZ4 (ORCPT ); Tue, 13 Jul 2021 07:25:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235881AbhGMLZz (ORCPT ); Tue, 13 Jul 2021 07:25:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3D966117A; Tue, 13 Jul 2021 11:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626175384; bh=Aae1Qk7FDHxDqCGXiyf7ZTDCvIv9/biiOfm0a9nKJLc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qsivhSf/eXgBzA3V5pV8jl3cs0+TKjdEJl3F/882r9uc0MpHVbf4q2AhlBXYEqfJt 8Vwd/Mreg1/FRkqj4xTkRbQra3RJEjeVutP0dhSkgD4zANW5171+Xrq4iU+DoWQpnv qg0YaE6hvhQuoCd5zoLqL+dLdFpwHFerqDn7he+I= Date: Tue, 13 Jul 2021 13:23:01 +0200 From: Greg Kroah-Hartman To: Andy Shevchenko Cc: Brendan Higgins , Peter Zijlstra , Alexey Dobriyan , Miguel Ojeda , Mauro Carvalho Chehab , Herbert Xu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Steven Rostedt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Thomas Graf , Andrew Morton , jic23@kernel.org, linux@rasmusvillemoes.dk Subject: Re: [PATCH v1 3/3] kernel.h: Split out container_of() and typeof_memeber() macros Message-ID: References: <20210713084541.7958-1-andriy.shevchenko@linux.intel.com> <20210713084541.7958-3-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Tue, Jul 13, 2021 at 02:16:17PM +0300, Andy Shevchenko wrote: > On Tue, Jul 13, 2021 at 12:37:46PM +0200, Greg Kroah-Hartman wrote: > > On Tue, Jul 13, 2021 at 11:45:41AM +0300, Andy Shevchenko wrote: > > > 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_memeber() macros. > > > > That feels messy, why? > > Because the headers in the kernel are messy. Life is messy and can not easily be partitioned into tiny pieces. That way usually ends up being even messier in the end... > > Reading one .h file for these common > > macros/defines is fine, why are container_of and typeof somehow > > deserving of their own .h files? > > It's explained here. There are tons of drivers that includes kernel.h for only > a few or even solely for container_of() macro. And why is that really a problem? kernel.h is in the cache and I would be amazed if splitting this out actually made anything build faster. > > What speedups are you seeing by > > splitting this up? > > C preprocessing. Numbers please. greg k-h