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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 03D60C433E0 for ; Tue, 26 May 2020 19:52:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D47962088E for ; Tue, 26 May 2020 19:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590522751; bh=ojp6/YpHEc1NW2ePcbFEVlErml7dvQ+2552G/h+0Ss4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=UvLQpHoesDfwb+oMksb5iyRdPAowlKYU/3Ttp4j/N40ZwbzhfbRJ1a9/oJQsIv1hZ E4JLknmo2xvxbZuJvlEmJTti/L7T32ErAHOqPJFFrLw6471aBVfeM+IfU8i+jDUfjf 3lWNYI0ifnAMU3R25DItPduu5+Y0gXzIhy3ePXpc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390562AbgEZTwa (ORCPT ); Tue, 26 May 2020 15:52:30 -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.