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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06663C46467 for ; Wed, 11 Jan 2023 18:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235650AbjAKST4 (ORCPT ); Wed, 11 Jan 2023 13:19:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235843AbjAKSTp (ORCPT ); Wed, 11 Jan 2023 13:19:45 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBF84392E2; Wed, 11 Jan 2023 10:19:36 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673461175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v9yLlw+CPPaFudmLWOnzXWazHzYK/LPnpzMb1fBBhH8=; b=qIkO8ofsmxcEhgHvSKYUo3KRpEnxCyaUcJAeHOCr57WMt9SO+scnZh75msdMhcBc71rb77 TkRGVISwdV9ZHeDzGic5SqSMhkPrqHgkJagOxeBy8pgcD8awaHqQTMQnAzFKL8hQuVsVFi 3Dsbkhob6qwN/WWaX67OGU52eaxSIlGmUzzrbop4drU8kCCHGuj9sfYgpumB0HW7jC301/ 5d94B/qZrL7IlZSZART3V/qapJqS4RQhiy2JNVKRfFLaKywUeRLYp8rFjDLEErJxUC0vcL 5Euadn7w9Z5GuAg35KgUuKmqaoVQJYMcf5d3alB7vzEYNfoCxvslr3yDbIQEWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673461175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v9yLlw+CPPaFudmLWOnzXWazHzYK/LPnpzMb1fBBhH8=; b=+HS771bu4wTJd8NyZ2Q0OZI+lfX2S4cwwJfn6qT9NPXQDhpNZT8oPhUU22ocg+lwT9jLiM PzkudHnDFis62OAg== To: Jason Gunthorpe , Alexander Gordeev , Alex Williamson , Lu Baolu , Christian Borntraeger , Cornelia Huck , David Woodhouse , Gerald Schaefer , Vasily Gorbik , Heiko Carstens , iommu@lists.linux.dev, Joerg Roedel , kvm@vger.kernel.org, linux-s390@vger.kernel.org, Marc Zyngier , Robin Murphy , Suravee Suthikulpanit , Sven Schnelle , Will Deacon Cc: Bharat Bhushan , Christian Borntraeger , Eric Auger , Eric Farman , Kevin Tian , Marc Zyngier , Matthew Rosato , Tomasz Nowicki , Will Deacon Subject: Re: [PATCH iommufd v3 2/9] iommu: Add iommu_group_has_isolated_msi() In-Reply-To: <2-v3-3313bb5dd3a3+10f11-secure_msi_jgg@nvidia.com> References: <2-v3-3313bb5dd3a3+10f11-secure_msi_jgg@nvidia.com> Date: Wed, 11 Jan 2023 19:19:34 +0100 Message-ID: <87eds1hr2h.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Jan 05 2023 at 15:33, Jason Gunthorpe wrote: > + > + mutex_lock(&group->mutex); > + list_for_each_entry(group_dev, &group->devices, list) > + ret &= msi_device_has_isolated_msi(group_dev->dev) || > + device_iommu_capable(group_dev->dev, > + IOMMU_CAP_INTR_REMAP); Nit. This really wants brackets even if they are not required by the language. Why? Brackets can be omitted for a single line statement in the loop/if path, but this > + ret &= msi_device_has_isolated_msi(group_dev->dev) || > + device_iommu_capable(group_dev->dev, > + IOMMU_CAP_INTR_REMAP); is visually a multi line statement. So having brackets makes visual parsing of this construct way clearer: list_for_each_entry(group_dev, &group->devices, list) { ret &= msi_device_has_isolated_msi(group_dev->dev) || device_iommu_capable(group_dev->dev, IOMMU_CAP_INTR_REMAP); } Also get rid of that extra line break. We lifted the 80 characters line length quite some while ago and made it 100. Thanks, tglx