Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp420700ybs; Sun, 24 May 2020 09:21:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyndVs6deopW/4WtQVjbZ6aFp3tO7KhZ9OPY7C6SXZ3HR66HjlG0whrtUm/mm+L7Qn9lzxQ X-Received: by 2002:a17:906:eb02:: with SMTP id mb2mr15278252ejb.507.1590337260240; Sun, 24 May 2020 09:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590337260; cv=none; d=google.com; s=arc-20160816; b=sNoTgRRRf+N7Pta4wQH6f6p5rSNpr37+77uCPBj3w3khPwviccMVT3lOcbCGYDVeSY Sb5mQ3H1NLIvWM+pW/nt9wwnq0E9pbdl0Ravqa7ujq7biRTXNwprkOQL+5mVZcA9Kk6j SBrTILgjovNJASOtDoGP90v4sKcv6yn046Gy3SRSp8PIAvKJCuxNluskJszJ1sjM8aRd 6rBrFOU8DP0vuthgcBR40e9c5jGsI8TMdWMvYPA+4IHh5Sv3n8D/2LHK0balL+cSpuoa m/1IwLa3V2Spcw6SW2QUe2QQbsw6pBOU9+VAvIkyvkDvrNtrSJqYvUQxYD+J2lgfrdGL uzfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=l5OGXxMRg1Wtchn9/ZgG+w1aUDjgjJwsA4GpGgceyIc=; b=r9jdcuE7TF48tDeQk1cJ5lxybvzus5A9u3wMpm6jh+z5gdwweZQwoWZmWVpQdcKkD0 LN8LMVqSrLYqH1m5rnGcqD6AktGeu7djc6sgwg6JSMdgd5Q7jyyCPQuLeltAD4jfJe5f ZSmDMnbKcgNnQzQ+s8FMms5+2wd6De9I1W1RlLuWMpVKeO3Ruaw583m+P9kDwrCoN9Ii Cad+RZtFBB5JimlFa9IQHaiSe4Uxl9+gq7OcQBNLJQ1fvX0YGmVywuy9BalCcNzAem73 vsj4/vMQutJQjuuq9qAu1mlO0BIdYIOgXh7u+K16lZeoMM+PO5jT06uqxlhACQPpfVYL /euQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Zxw/yjuE"; 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 ce7si8267673edb.483.2020.05.24.09.20.35; Sun, 24 May 2020 09:21:00 -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="Zxw/yjuE"; 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 S1728564AbgEXQQo (ORCPT + 99 others); Sun, 24 May 2020 12:16:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727899AbgEXQQo (ORCPT ); Sun, 24 May 2020 12:16:44 -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 2D4CF20776; Sun, 24 May 2020 16:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590337003; bh=5rzhJWqGS7NxsVv+AenK5F0yLsoR3FozPAo0q/n1BlA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Zxw/yjuEnd1TJ34Mmso2+2K+95mZ9xIe13l8Vu7CAlN609PuYXCMGSEG21mTX/Lo1 BYVNx00q+409RPowbZmgVVHUJTDFF2KWvSJkuOuEoP/2RXZfoCDs5W7iY0TD6/LOPp o6T2sYn5scy0oil03GuFNkGqL9dhVxd3eTkSDNl4= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jctIn-00Eya2-Hv; Sun, 24 May 2020 17:16:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 24 May 2020 17:16:41 +0100 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] drivers/irqchip: Remove function callback casts In-Reply-To: <20200524160626.GA30346@ubuntu> References: <20200524080910.13087-1-oscar.carter@gmx.com> <20200524124634.113203f6@why> <20200524160626.GA30346@ubuntu> User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 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 2020-05-24 17:06, Oscar Carter wrote: > Hi Marc, > > On Sun, May 24, 2020 at 12:46:34PM +0100, Marc Zyngier wrote: >> On Sun, 24 May 2020 10:09:10 +0200 >> Oscar Carter wrote: >> >> Hi Oscar, >> >> Thanks for this. Comments below. >> >> > In an effort to enable -Wcast-function-type in the top-level Makefile to >> > support Control Flow Integrity builds, remove all the function callback >> > casts. >> > >> > To do this, modify the IRQCHIP_ACPI_DECLARE macro initializing the >> > acpi_probe_entry struct directly instead of use the existent macro >> > ACPI_DECLARE_PROBE_ENTRY. >> > >> > In this new initialization use the probe_subtbl field instead of the >> > probe_table field use in the ACPI_DECLARE_PROBE_ENTRY macro. >> >> Please add *why* this is a valid transformation (probe_table and >> probe_subtbl are part of a union). > > Ok, I will add a more detailed explanation. > >> > Signed-off-by: Oscar Carter >> > --- >> > include/linux/irqchip.h | 10 ++++++++-- >> > 1 file changed, 8 insertions(+), 2 deletions(-) >> > >> > diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h >> > index 950e4b2458f0..1f464fd10df0 100644 >> > --- a/include/linux/irqchip.h >> > +++ b/include/linux/irqchip.h >> > @@ -39,8 +39,14 @@ >> > * @fn: initialization function >> > */ >> > #define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \ >> > - ACPI_DECLARE_PROBE_ENTRY(irqchip, name, ACPI_SIG_MADT, \ >> > - subtable, validate, data, fn) >> > + static const struct acpi_probe_entry __acpi_probe_##name \ >> > + __used __section(__irqchip_acpi_probe_table) = { \ >> > + .id = ACPI_SIG_MADT, \ >> > + .type = subtable, \ >> > + .subtable_valid = validate, \ >> > + .probe_subtbl = (acpi_tbl_entry_handler)fn, \ >> > + .driver_data = data, \ >> > + } >> > >> >> I'd rather you add an ACPI_DECLARE_SUBTABLE_PROBE_ENTRY to acpi.h, and >> use that here so that we can keep the ACPI gunk in a single place. > > Ok, I will do the changes you suggested and I will resend a new > version. > Later, I will also send a series to clean up the checkpatch warnings > and > errors for the acpi.h header. Not necessarily a good idea. Churn for the sake of keeping checkpatch at bay is pretty pointless. Do fix bugs if you spot any, but please exercise judgement. Thanks, M. -- Jazz is not dead. It just smells funny...