Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933052AbcDYQDh (ORCPT ); Mon, 25 Apr 2016 12:03:37 -0400 Received: from foss.arm.com ([217.140.101.70]:47815 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933016AbcDYQDc (ORCPT ); Mon, 25 Apr 2016 12:03:32 -0400 Date: Mon, 25 Apr 2016 17:03:25 +0100 From: Mark Rutland To: Matt Fleming Cc: Ard Biesheuvel , Robin Murphy , "linux-efi@vger.kernel.org" , Russell King - ARM Linux , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , Leif Lindholm , "mingo@redhat.com" , "hpa@zytor.com" , "tglx@linutronix.de" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCHv3 1/5] efi/runtime-wrappers: detect FW irq flag corruption Message-ID: <20160425160324.GB24831@leverpostej> References: <1461591994-14918-1-git-send-email-mark.rutland@arm.com> <1461591994-14918-2-git-send-email-mark.rutland@arm.com> <571E25B1.8070305@arm.com> <20160425141557.GA2829@codeblueprint.co.uk> <20160425142435.GB2829@codeblueprint.co.uk> <20160425142735.GA14974@leverpostej> <20160425155922.GC2829@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160425155922.GC2829@codeblueprint.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 665 Lines: 29 On Mon, Apr 25, 2016 at 04:59:22PM +0100, Matt Fleming wrote: > On Mon, 25 Apr, at 03:27:35PM, Mark Rutland wrote: > > > > I have no strong preference so long as the code is correct. > > > > Another option is to get rid of the bool entirely: > > > > flags ^= cur_flags; > > if (!WARN_ON(flags & ARCH_EFI_IRQ_FLAGS_MASK)) > > return; > > OK, let's do the following because we need flags to be preserved for > printing, > > --- > > unsigned long cur_flags, mismatch; > > local_save_flags(cur_flags); > > mismatch = flags ^ cur_flags; > if (!WARN_ON_ONCE(mismatch & ARCH_EFI_IRQ_FLAGS_MASK)) > return; > Sure; that looks good to me. Cheers, Mark.