[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] x86/irq: remove duplicated clear_domain_irq_pirq calls


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Tue, 26 Jan 2021 12:06:04 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tj9G+ZPOM5GhSqTrORF1JHjlXTqOQed8RxWo2oyGvwA=; b=jIkvadiPbaDV/X0OrScfch1VFAgaoL+kk0YxS0ZtNHC6uk/gJwbReb4XnEqetH3ids5Y/qucDaoCgyXvoR/Rg1AI/ydwQqv/e1snU1gDhh3PQsPaFwyUitnV/Xu2gnH9t5HITYFsbzUfdwhoD4kfM6QMjikvDpcnhBp9LzfHg3e2liL4QDFyvAGsYUBLGI6a/5Q01/2ud6sGlrXswE+/AuUP9yPxoLxKJtS5cIMF3HLm6cg9URp+RReonotrSe5jzW7qom0JgQEJezfB0CIEilnhh7nTX52N4TlTsjyoQovvnElRZ7y2O/S6QSAP7AHCXtOkoe9aPKRavG8wQYwY7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C8dIJmvb0+H6nZpww90fGOav2D+MPpfPFT82oKGWiLSPTKjL0162Ys53S4MS3ACYnmNF37ePlmnGszj9zdQJI88Gs1KrO+x8HE/nyFo0f5kdWuHwjYXvOgb29CFG/CrQUShaevOBCfWmbunBmlZ28ce3Eyk3s4aOPfMCMX4T7Su4DKYIbKbRew4XziMRa/0Nq86Bd5PneAXOoD4CXhVZuIaEAuS7XDWKV1K/eZvoTfybQ3pl+roobvS17OsUgcdSmRuIW11JODA8arhjF1HbDNCMGuyZTVb2n4ne31+Kqt8ylLPZIX64fuhj1JgNotlebXVPJTucb06iPdf/hxbTew==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 26 Jan 2021 11:08:12 +0000
  • Ironport-sdr: LEkt/X8pwcb8RL5WYSVmkgThUhlvnObBn1YfV7yX3tnijZa4FUjor8P3R60XyZjtw09ea05iZ4 QEad4+LjOWkCWt6AVaCJZndTKpHRmuz6Wl1vsvxc+Dwe5Ws+UsR/Z0gG3WZ26xsxFaQdzjDGCM aTFFgbA/XXTA2WlO1Uvg2mXyG5V0XSE7AcMzb6DREOxrxV/rJxxIsopOI3Fxkgqg9f/KuteCmG GUL8NOoc7PRh5hOCk96Om0j2nv7BUmI20Kv9I1lGrf9cXtWqCMuRoz0/DrVZX0TjFBUcFUtyQ6 YKA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

There are two duplicated calls to cleanup_domain_irq_pirq in
unmap_domain_pirq.

The first one in the for loop will be called with exactly the same
arguments as the call placed closer to the loop start.

The second one will only be executed when desc != NULL, and that's
already covered by the first call in the for loop above, as any
attempt to unmap a multi vector MSI range will have nr != 1 and thus
always exit the loop with desc == NULL.

Note that those calls are harmless, but make the code harder to read.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
The logic used in the loop seems extremely complex to follow IMO,
there are several breaks for exiting the loop, and the index (i) is
also updated in different places.
---
 xen/arch/x86/irq.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 032fe82167..49849bd7d3 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2383,9 +2383,6 @@ int unmap_domain_pirq(struct domain *d, int pirq)
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
-        if ( !forced_unbind )
-           cleanup_domain_irq_pirq(d, irq, info);
-
         rc = irq_deny_access(d, irq);
         if ( rc )
         {
@@ -2419,9 +2416,6 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     {
         spin_unlock_irqrestore(&desc->lock, flags);
 
-        if ( !forced_unbind )
-            cleanup_domain_irq_pirq(d, irq, info);
-
         rc = irq_deny_access(d, irq);
         if ( rc )
         {
-- 
2.29.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.