Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755095AbbEUKsG (ORCPT ); Thu, 21 May 2015 06:48:06 -0400 Received: from www.linutronix.de ([62.245.132.108]:37925 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754641AbbEUKsD (ORCPT ); Thu, 21 May 2015 06:48:03 -0400 Date: Thu, 21 May 2015 12:48:04 +0200 (CEST) From: Thomas Gleixner To: Feng Wu cc: joro@8bytes.org, dwmw2@infradead.org, jiang.liu@linux.intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [v6 3/8] iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip In-Reply-To: <1432191555-3516-4-git-send-email-feng.wu@intel.com> Message-ID: References: <1432191555-3516-1-git-send-email-feng.wu@intel.com> <1432191555-3516-4-git-send-email-feng.wu@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 28 On Thu, 21 May 2015, Feng Wu wrote: > +static int intel_ir_set_vcpu_affinity(struct irq_data *data, void *vcpu_info) > +{ > + struct intel_ir_data *ir_data = data->chip_data; > + struct irte *irte_pi = &ir_data->irte_pi_entry; > + struct vcpu_data *vcpu_pi_info; > + > + /* stop posting interrupts, back to remapping mode */ > + if (!vcpu_info) > + modify_irte(&ir_data->irq_2_iommu, &ir_data->irte_entry); > + else { We add braces to both branches if one requires it. > + vcpu_pi_info = (struct vcpu_data *)vcpu_info; > + memcpy(irte_pi, &ir_data->irte_entry, sizeof(struct irte)); This lacks a comment WHY you copy irte_entry to irte_pi_entry and WHY we have two seperate entries stored in ir_data. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/