From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-gh0-f177.google.com ([209.85.160.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SmR39-0006Mz-OE for kexec@lists.infradead.org; Wed, 04 Jul 2012 14:59:28 +0000 Received: by ghbf11 with SMTP id f11so7068689ghb.36 for ; Wed, 04 Jul 2012 07:59:10 -0700 (PDT) Date: Wed, 4 Jul 2012 07:52:45 -0700 From: Greg KH Subject: Re: [PATCH v4 2/3] KVM-INTEL: Add new module vmcsinfo-intel to fill VMCSINFO Message-ID: <20120704145245.GF23020@kroah.com> References: <4FF413D2.4030006@cn.fujitsu.com> <4FF4155F.6070508@cn.fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4FF4155F.6070508@cn.fujitsu.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Yanfei Zhang Cc: dzickus@redhat.com, luto@mit.edu, kvm@vger.kernel.org, Joerg Roedel , mtosatti@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, paul.gortmaker@windriver.com, ludwig.nussel@suse.de, Avi Kivity , ebiederm@xmission.com On Wed, Jul 04, 2012 at 06:05:19PM +0800, Yanfei Zhang wrote: > +int vmcs_sysfs_add(struct device *dev) > +{ > + return sysfs_create_group(&dev->kobj, &vmcs_attr_group); > +} > + > +void vmcs_sysfs_remove(struct device *dev) > +{ > + sysfs_remove_group(&dev->kobj, &vmcs_attr_group); > +} Why are these "add" and "remove" functions here? Shouldn't you just write the lines out where you call them instead, as they are only called once. And does this race with adding new cpus to the system (is the uevent being sent to userspace before the attributes are added?) If so, please fix that. thanks, greg k-h _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: [PATCH v4 2/3] KVM-INTEL: Add new module vmcsinfo-intel to fill VMCSINFO Date: Wed, 4 Jul 2012 07:52:45 -0700 Message-ID: <20120704145245.GF23020@kroah.com> References: <4FF413D2.4030006@cn.fujitsu.com> <4FF4155F.6070508@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , mtosatti@redhat.com, ebiederm@xmission.com, luto@mit.edu, Joerg Roedel , dzickus@redhat.com, paul.gortmaker@windriver.com, ludwig.nussel@suse.de, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kexec@lists.infradead.org To: Yanfei Zhang Return-path: Content-Disposition: inline In-Reply-To: <4FF4155F.6070508@cn.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Jul 04, 2012 at 06:05:19PM +0800, Yanfei Zhang wrote: > +int vmcs_sysfs_add(struct device *dev) > +{ > + return sysfs_create_group(&dev->kobj, &vmcs_attr_group); > +} > + > +void vmcs_sysfs_remove(struct device *dev) > +{ > + sysfs_remove_group(&dev->kobj, &vmcs_attr_group); > +} Why are these "add" and "remove" functions here? Shouldn't you just write the lines out where you call them instead, as they are only called once. And does this race with adding new cpus to the system (is the uevent being sent to userspace before the attributes are added?) If so, please fix that. thanks, greg k-h