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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 437B9C4332E for ; Fri, 20 Mar 2020 14:59:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1400C20777 for ; Fri, 20 Mar 2020 14:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584716356; bh=Hd3zAvAezuFSVlozOz44ullhVT1eSajSxemMLbZxlBE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=obuUakSJswXCsZ6S/NIbMum8vgMzNZiExatmohj16KS/Z8zZhTgl8fAsrzqdpCVe3 o8PSfc8or7r/dBSrxkXaiZAxEYuKCS8J+x26NHzoFqEfmgZ97/kulHSMlGTQMK+L8g usJsdQShCSHrZMcO6fTwQm6QouUKUR2CXcEafXDM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbgCTO7P (ORCPT ); Fri, 20 Mar 2020 10:59:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:49012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgCTO7P (ORCPT ); Fri, 20 Mar 2020 10:59:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99F7A2072D; Fri, 20 Mar 2020 14:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584716354; bh=Hd3zAvAezuFSVlozOz44ullhVT1eSajSxemMLbZxlBE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ff33wKiw1HbXy93zCGoh1lWvVOk00lgxJdeoknvNzKnVdJSPvefa0ML3LysbJ4nTO 6rAp6ASm4qt4uUIq2mtTpgvdRMDHrrSeBb59UaWhHjcJKEKHYeRpe3xmrMj7LtAtPD nmjVJ+xUohzhMq/MhLV3uoj+bRi4FVjkP6UigI8o= Date: Fri, 20 Mar 2020 15:59:06 +0100 From: Greg Kroah-Hartman To: Thomas Gleixner Cc: LKML , x86@kernel.org, Mark Gross , Tony Luck , Paolo Bonzini , Darren Hart , Andy Shevchenko , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, Viresh Kumar , linux-pm@vger.kernel.org, Srinivas Pandruvada , linux-edac@vger.kernel.org, platform-driver-x86@vger.kernel.org, Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, Zhang Rui , Daniel Lezcano , Amit Kucheria , Chanwoo Choi , Jacob Pan , Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Takashi Iwai , alsa-devel@alsa-project.org, Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org Subject: Re: [patch 00/22] x86/treewide: Consolidate CPU match macro maze and get rid of C89 (sic!) initializers Message-ID: <20200320145906.GA762057@kroah.com> References: <20200320131345.635023594@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200320131345.635023594@linutronix.de> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org On Fri, Mar 20, 2020 at 02:13:45PM +0100, Thomas Gleixner wrote: > The x86 CPU matching based on struct x86_cpu_id: > > - is using an inconsistent macro mess with pointlessly duplicated and > slightly different local macros. Finding the places is an art as there > is no consistent name space at all. > > - is still mostly based on C89 struct initializers which rely on the > ordering of the struct members. That's proliferated forever as every > new driver just copies the mess from some exising one. > > A recent offlist conversation about adding more match criteria to the CPU > matching logic instead of creating yet another set of horrors, reminded me > of a pile of scripts and patches which I hacked on a few years ago when I > tried to add something to struct x86_cpu_id. > > That stuff was finally not needed and ended up in my ever growing todo list > and collected dust and cobwebs, but (un)surprisingly enough most of it > still worked out of the box. The copy & paste machinery still works as it > did years ago. > > There are a few places which needed extra care due to new creative macros, > new check combinations etc. and surprisingly ONE open coded proper C99 > initializer. > > It was reasonably simple to make it at least compile and pass a quick > binary equivalence check. > > The result is a X86_MATCH prefix based set of macros which are reflecting > the needs of the usage sites and shorten the base macro which takes all > possible parameters (vendor, family, model, feature, data) and uses proper > C99 initializers. > > So extensions of the match logic are trivial after that. > > The patch set is against Linus tree and has trivial conflicts against > linux-next. > > The diffstat is: > 71 files changed, 525 insertions(+), 472 deletions(-) > > but the extra lines are pretty much kernel-doc documentation which I added > to each of the new macros. The usage sites diffstat is: > > 70 files changed, 393 insertions(+), 471 deletions(-) > > Thoughts? Much nicer looking, thanks for cleaning up this mess: Reviewed-by: Greg Kroah-Hartman From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Subject: Re: [patch 00/22] x86/treewide: Consolidate CPU match macro maze and get rid of C89 (sic!) initializers Date: Fri, 20 Mar 2020 15:59:06 +0100 Message-ID: <20200320145906.GA762057@kroah.com> References: <20200320131345.635023594@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200320131345.635023594@linutronix.de> Sender: linux-hwmon-owner@vger.kernel.org To: Thomas Gleixner Cc: LKML , x86@kernel.org, Mark Gross , Tony Luck , Paolo Bonzini , Darren Hart , Andy Shevchenko , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, Viresh Kumar , linux-pm@vger.kernel.org, Srinivas Pandruvada , linux-edac@vger.kernel.org, platform-driver-x86@vger.kernel.org, Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, Zhang Rui , Daniel Lezcano , Amit Kucheria , Chanwoo Choi List-Id: platform-driver-x86.vger.kernel.org On Fri, Mar 20, 2020 at 02:13:45PM +0100, Thomas Gleixner wrote: > The x86 CPU matching based on struct x86_cpu_id: > > - is using an inconsistent macro mess with pointlessly duplicated and > slightly different local macros. Finding the places is an art as there > is no consistent name space at all. > > - is still mostly based on C89 struct initializers which rely on the > ordering of the struct members. That's proliferated forever as every > new driver just copies the mess from some exising one. > > A recent offlist conversation about adding more match criteria to the CPU > matching logic instead of creating yet another set of horrors, reminded me > of a pile of scripts and patches which I hacked on a few years ago when I > tried to add something to struct x86_cpu_id. > > That stuff was finally not needed and ended up in my ever growing todo list > and collected dust and cobwebs, but (un)surprisingly enough most of it > still worked out of the box. The copy & paste machinery still works as it > did years ago. > > There are a few places which needed extra care due to new creative macros, > new check combinations etc. and surprisingly ONE open coded proper C99 > initializer. > > It was reasonably simple to make it at least compile and pass a quick > binary equivalence check. > > The result is a X86_MATCH prefix based set of macros which are reflecting > the needs of the usage sites and shorten the base macro which takes all > possible parameters (vendor, family, model, feature, data) and uses proper > C99 initializers. > > So extensions of the match logic are trivial after that. > > The patch set is against Linus tree and has trivial conflicts against > linux-next. > > The diffstat is: > 71 files changed, 525 insertions(+), 472 deletions(-) > > but the extra lines are pretty much kernel-doc documentation which I added > to each of the new macros. The usage sites diffstat is: > > 70 files changed, 393 insertions(+), 471 deletions(-) > > Thoughts? Much nicer looking, thanks for cleaning up this mess: Reviewed-by: Greg Kroah-Hartman 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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 3A875C4332B for ; Mon, 23 Mar 2020 13:53:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAE252072D for ; Mon, 23 Mar 2020 13:53:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="XIdXp1C1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ff33wKiw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAE252072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 23998950; Mon, 23 Mar 2020 14:53:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 23998950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1584971634; bh=Hd3zAvAezuFSVlozOz44ullhVT1eSajSxemMLbZxlBE=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XIdXp1C1z6QfrUbb9ReLEIuk1hlY32r4hNQRNKq1HJcquxgptzj2aE8XvU2LKzE3R enoZtAG0ZONUrqYMLk17WmAj9Nje2hykOTsmdkNgxhipRSSXEUKveStrZPj1NXbKb7 D87174hyf/fqUR1g+QoCoQCMMhUWDLu0e+OwwRGE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E30AEF802DC; Mon, 23 Mar 2020 14:47:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 570CCF8015B; Fri, 20 Mar 2020 15:59:23 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F3E0FF800C0 for ; Fri, 20 Mar 2020 15:59:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3E0FF800C0 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ff33wKiw" Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99F7A2072D; Fri, 20 Mar 2020 14:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584716354; bh=Hd3zAvAezuFSVlozOz44ullhVT1eSajSxemMLbZxlBE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ff33wKiw1HbXy93zCGoh1lWvVOk00lgxJdeoknvNzKnVdJSPvefa0ML3LysbJ4nTO 6rAp6ASm4qt4uUIq2mtTpgvdRMDHrrSeBb59UaWhHjcJKEKHYeRpe3xmrMj7LtAtPD nmjVJ+xUohzhMq/MhLV3uoj+bRi4FVjkP6UigI8o= Date: Fri, 20 Mar 2020 15:59:06 +0100 From: Greg Kroah-Hartman To: Thomas Gleixner Subject: Re: [patch 00/22] x86/treewide: Consolidate CPU match macro maze and get rid of C89 (sic!) initializers Message-ID: <20200320145906.GA762057@kroah.com> References: <20200320131345.635023594@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200320131345.635023594@linutronix.de> X-Mailman-Approved-At: Mon, 23 Mar 2020 14:47:37 +0100 Cc: Ulf Hansson , x86@kernel.org, Viresh Kumar , alsa-devel@alsa-project.org, platform-driver-x86@vger.kernel.org, Jacob Pan , Srinivas Pandruvada , Amit Kucheria , Mark Gross , Herbert Xu , linux-acpi@vger.kernel.org, Daniel Lezcano , Chanwoo Choi , linux-pci@vger.kernel.org, Darren Hart , Zhang Rui , Guenter Roeck , Len Brown , Jean Delvare , linux-pm@vger.kernel.org, linux-mmc@vger.kernel.org, Bjorn Helgaas , Takashi Iwai , Adrian Hunter , linux-edac@vger.kernel.org, linux-hwmon@vger.kernel.org, Tony Luck , "Rafael J. Wysocki" , LKML , linux-crypto@vger.kernel.org, Paolo Bonzini , "David S. Miller" , Andy Shevchenko X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, Mar 20, 2020 at 02:13:45PM +0100, Thomas Gleixner wrote: > The x86 CPU matching based on struct x86_cpu_id: > > - is using an inconsistent macro mess with pointlessly duplicated and > slightly different local macros. Finding the places is an art as there > is no consistent name space at all. > > - is still mostly based on C89 struct initializers which rely on the > ordering of the struct members. That's proliferated forever as every > new driver just copies the mess from some exising one. > > A recent offlist conversation about adding more match criteria to the CPU > matching logic instead of creating yet another set of horrors, reminded me > of a pile of scripts and patches which I hacked on a few years ago when I > tried to add something to struct x86_cpu_id. > > That stuff was finally not needed and ended up in my ever growing todo list > and collected dust and cobwebs, but (un)surprisingly enough most of it > still worked out of the box. The copy & paste machinery still works as it > did years ago. > > There are a few places which needed extra care due to new creative macros, > new check combinations etc. and surprisingly ONE open coded proper C99 > initializer. > > It was reasonably simple to make it at least compile and pass a quick > binary equivalence check. > > The result is a X86_MATCH prefix based set of macros which are reflecting > the needs of the usage sites and shorten the base macro which takes all > possible parameters (vendor, family, model, feature, data) and uses proper > C99 initializers. > > So extensions of the match logic are trivial after that. > > The patch set is against Linus tree and has trivial conflicts against > linux-next. > > The diffstat is: > 71 files changed, 525 insertions(+), 472 deletions(-) > > but the extra lines are pretty much kernel-doc documentation which I added > to each of the new macros. The usage sites diffstat is: > > 70 files changed, 393 insertions(+), 471 deletions(-) > > Thoughts? Much nicer looking, thanks for cleaning up this mess: Reviewed-by: Greg Kroah-Hartman