Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754757AbcDYOSo (ORCPT ); Mon, 25 Apr 2016 10:18:44 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:35821 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752389AbcDYOSm (ORCPT ); Mon, 25 Apr 2016 10:18:42 -0400 MIME-Version: 1.0 In-Reply-To: <20160425141557.GA2829@codeblueprint.co.uk> 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> Date: Mon, 25 Apr 2016 16:18:41 +0200 Message-ID: Subject: Re: [PATCHv3 1/5] efi/runtime-wrappers: detect FW irq flag corruption From: Ard Biesheuvel To: Matt Fleming Cc: Robin Murphy , Mark Rutland , "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" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 797 Lines: 20 On 25 April 2016 at 16:15, Matt Fleming wrote: > On Mon, 25 Apr, at 03:12:01PM, Robin Murphy wrote: >> >+static void efi_call_virt_check_flags(unsigned long flags, const char *call) >> >+{ >> >+ unsigned long cur_flags; >> >+ bool mismatch; >> >+ >> >+ local_save_flags(cur_flags); >> >+ >> >+ mismatch = !!((cur_flags ^ flags) & ARCH_EFI_IRQ_FLAGS_MASK); >> >> nit: the assignment itself is already a conversion to bool, so the >> excitement is redundant here. > > This was intentional. I asked Mark to make this change so that it's > explicit for the developer that we're performing the type conversion. But replacing an implicit boolean cast with an explicit one makes little sense, no? Don't we simply want '!= 0' here if you need a boolean expression?