Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp282065ybm; Tue, 26 May 2020 16:58:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqBkSEPxaiF+UT52EP69rDQTrx3txqCUvJwFWjjCi9UwyG7TXjVMXRdmBr/gmJFvAL0NAt X-Received: by 2002:a17:906:3a43:: with SMTP id a3mr578930ejf.121.1590537528210; Tue, 26 May 2020 16:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590537528; cv=none; d=google.com; s=arc-20160816; b=DdRRITl/1kpWymJw5+mVPmMNa31caAx0xFcKXDjhWEHz1XYFOsAWnLLTgeW3Y8R1aN ED/LfUjcKYADpqWjDwvzky1JNi0yzS0RaHcjZA413Bx8eyeFrVoErYbZH3tBk/sM9L/3 HxMols8GCcvvkybjw00vyPpItJIG/nbRyoi+mbKbHpBrijjmGGPdJ5yITvRxDFM11MeR M8gH2W9vzHxpEZ+vwknQ4n+bi/LDPeCI9CVEjZ+KLzNzCWSDsBbPJiXocVNmeT7BeLaQ hxPyODpAorUePbVVmmO79MnjNK3ht1TdOtjHdrFF5YG8yFXQyFRo5CWdZwFbg99bwBOv jCFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:dkim-signature; bh=u0/C7v5+LGS1dNrgUdA/qUU9ocxlk9X2eWlX2/tSl54=; b=TjHf+Ln1/vEQsRNfcWXBHJu5pDiNYMW2542sDg/DQwBIQzJTaYM75f8ShiQgDyd366 odwk0IS0yDdkxqzU1nSe0aT6MbTyhFYM7zC4x5b4UNQ9AuMoeqZQkygpItVaclrr0Dro lPKFMCcg7xyHhbuXWDrdTznWDVEUv3wiEd8GZ8mNwZhosSus6VeS+VX6JOGeeKWyrut/ tlyDpZx9z9pnzYpGirj61+wT3rgvya2s8RdRvHTP9uYSO4WxgeZgljSgxdAJ9TxLL1Ew NzcGEHQoWj1HYSvHF3q4Hu2eAYDjkXRCWrlW+E3H8BmhWuCDSMTN3jeuZ1ZjjHuTeQ+R /m9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cnt67Dt2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si776738ejx.250.2020.05.26.16.58.24; Tue, 26 May 2020 16:58:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cnt67Dt2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390240AbgEZTw3 (ORCPT + 99 others); Tue, 26 May 2020 15:52:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:39052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390187AbgEZTvb (ORCPT ); Tue, 26 May 2020 15:51:31 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 A0664207D8; Tue, 26 May 2020 19:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590522690; bh=ojp6/YpHEc1NW2ePcbFEVlErml7dvQ+2552G/h+0Ss4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cnt67Dt2wLXOxwpUvPU/At41OYlrB9eXq7uQQvCL07XpgX5MFuMc5h5hvOEQfaDN2 JKi8I23q0M8jv+IaPdhSIkuHfjwGNdmfxNILnDXv1VZ2yhHJ66/ch/jRyXIplwTCW5 Sh7daajd/aAVa9IgYUOtwQ7sCi64sYamhulyYmWE= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdfbk-00FVxX-OC; Tue, 26 May 2020 20:51:28 +0100 Date: Tue, 26 May 2020 20:51:27 +0100 Message-ID: <87sgfmzd8g.wl-maz@kernel.org> From: Marc Zyngier To: Oscar Carter Cc: Kees Cook , Thomas Gleixner , Jason Cooper , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drivers/irqchip: Remove function callback casts In-Reply-To: <20200526172527.GA3465@ubuntu> References: <20200524162220.10186-1-oscar.carter@gmx.com> <87tv04z3kq.wl-maz@kernel.org> <20200526172527.GA3465@ubuntu> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: oscar.carter@gmx.com, keescook@chromium.org, tglx@linutronix.de, jason@lakedaemon.net, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 May 2020 18:25:27 +0100, Oscar Carter wrote: > > On Mon, May 25, 2020 at 11:55:33AM +0100, Marc Zyngier wrote: > > On Sun, 24 May 2020 17:22:20 +0100, > > Oscar Carter wrote: > > > > > > include/linux/acpi.h | 11 +++++++++++ > > > > You now need to Cc the ACPI maintainers. > > Sorry for forgetting. No worries. In general, use scripts/get_maintainers.pl to find out who to Cc. > > > > include/linux/irqchip.h | 5 +++-- > > > 2 files changed, 14 insertions(+), 2 deletions(-) > > > > > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > > > index d661cd0ee64d..fed49b276a90 100644 > > > --- a/include/linux/acpi.h > > > +++ b/include/linux/acpi.h > > > @@ -1154,6 +1154,17 @@ struct acpi_probe_entry { > > > .driver_data = data, \ > > > } > > > > > > +#define ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(table, name, table_id, \ > > > + subtable, valid, data, fn) \ > > > + static const struct acpi_probe_entry __acpi_probe_##name \ > > > + __used __section(__##table##_acpi_probe_table) = { \ > > > + .id = table_id, \ > > > + .type = subtable, \ > > > + .subtable_valid = valid, \ > > > + .probe_subtbl = (acpi_tbl_entry_handler)fn, \ > > > > It strikes me that under the guise of removing function casts, you are > > actually adding one! And this cast is actually hiding all sorts of > > sins (remove it, and see things exploding). > > Yes, if I remove it I see things exploiding. I'm very sorry. No need to be sorry. We all learn from past mistakes. > > > I've fixed it with the patch below (ACPI is such a mess of data > > structure case...). > > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c > > index d7006ef18a0d..3870e9d4d3a8 100644 > > --- a/drivers/irqchip/irq-gic-v3.c > > +++ b/drivers/irqchip/irq-gic-v3.c > > @@ -2117,7 +2117,7 @@ static void __init gic_acpi_setup_kvm_info(void) > > } > > > > static int __init > > -gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end) > > +gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end) > > { > > struct acpi_madt_generic_distributor *dist; > > struct fwnode_handle *domain_handle; > > diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c > > index 30ab623343d3..fc431857ce90 100644 > > --- a/drivers/irqchip/irq-gic.c > > +++ b/drivers/irqchip/irq-gic.c > > @@ -1593,7 +1593,7 @@ static void __init gic_acpi_setup_kvm_info(void) > > gic_set_kvm_info(&gic_v2_kvm_info); > > } > > > > -static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, > > +static int __init gic_v2_acpi_init(union acpi_subtable_headers *header, > > const unsigned long end) > > { > > struct acpi_madt_generic_distributor *dist; > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > > index fed49b276a90..4f4ddbfce3d3 100644 > > --- a/include/linux/acpi.h > > +++ b/include/linux/acpi.h > > @@ -1150,7 +1150,7 @@ struct acpi_probe_entry { > > .id = table_id, \ > > .type = subtable, \ > > .subtable_valid = valid, \ > > - .probe_table = (acpi_tbl_table_handler)fn, \ > > + .probe_table = fn, \ > > .driver_data = data, \ > > } > > > > @@ -1161,7 +1161,7 @@ struct acpi_probe_entry { > > .id = table_id, \ > > .type = subtable, \ > > .subtable_valid = valid, \ > > - .probe_subtbl = (acpi_tbl_entry_handler)fn, \ > > + .probe_subtbl = fn, \ > > .driver_data = data, \ > > } > > > > Thanks for your help with this patch. I will do all the necessary changes > and I will resend a new version. > > Do you mind if I add these two lines: > > Co-developed-by: Marc Zyngier > Signed-off-by: Marc Zyngier > > in the next version to give you credit? Sure, that's very kind of you to offer. Thanks, M. -- Without deviation from the norm, progress is not possible.