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