All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yanfei Zhang <zhangyanfei@cn.fujitsu.com>
Cc: Avi Kivity <avi@redhat.com>,
	mtosatti@redhat.com, ebiederm@xmission.com, luto@mit.edu,
	Joerg Roedel <joerg.roedel@amd.com>,
	dzickus@redhat.com, paul.gortmaker@windriver.com,
	ludwig.nussel@suse.de, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, kexec@lists.infradead.org
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	[thread overview]
Message-ID: <20120704145245.GF23020@kroah.com> (raw)
In-Reply-To: <4FF4155F.6070508@cn.fujitsu.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

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Yanfei Zhang <zhangyanfei@cn.fujitsu.com>
Cc: dzickus@redhat.com, luto@mit.edu, kvm@vger.kernel.org,
	Joerg Roedel <joerg.roedel@amd.com>,
	mtosatti@redhat.com, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, paul.gortmaker@windriver.com,
	ludwig.nussel@suse.de, Avi Kivity <avi@redhat.com>,
	ebiederm@xmission.com
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	[thread overview]
Message-ID: <20120704145245.GF23020@kroah.com> (raw)
In-Reply-To: <4FF4155F.6070508@cn.fujitsu.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

  reply	other threads:[~2012-07-04 14:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04  9:58 [PATCH v4 0/3] Export offsets of VMCS fields as note information for kdump Yanfei Zhang
2012-07-04  9:58 ` Yanfei Zhang
2012-07-04 10:01 ` [PATCH v4 1/3] KVM: Export symbols for module vmcsinfo-intel Yanfei Zhang
2012-07-04 10:01   ` Yanfei Zhang
2012-07-04 10:05 ` [PATCH v4 2/3] KVM-INTEL: Add new module vmcsinfo-intel to fill VMCSINFO Yanfei Zhang
2012-07-04 10:05   ` Yanfei Zhang
2012-07-04 14:52   ` Greg KH [this message]
2012-07-04 14:52     ` Greg KH
2012-07-06  8:04   ` HATAYAMA Daisuke
2012-07-06  8:04     ` HATAYAMA Daisuke
2012-07-06  8:25     ` Wen Congyang
2012-07-06  8:25       ` Wen Congyang
2012-07-06  8:25       ` Wen Congyang
2012-07-06  8:38       ` HATAYAMA Daisuke
2012-07-06  8:38         ` HATAYAMA Daisuke
2012-07-06  8:38         ` HATAYAMA Daisuke
2012-07-10  1:04       ` HATAYAMA Daisuke
2012-07-10  1:04         ` HATAYAMA Daisuke
2012-07-10  1:28   ` HATAYAMA Daisuke
2012-07-10  1:28     ` HATAYAMA Daisuke
2012-07-04 10:06 ` [PATCH v4 3/3] Documentation: Add ABI entry for vmcs sysfs interface Yanfei Zhang
2012-07-04 10:06   ` Yanfei Zhang
2012-07-04 14:49   ` Greg KH
2012-07-04 14:49     ` Greg KH
2012-07-04 14:53   ` Greg KH
2012-07-04 14:53     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120704145245.GF23020@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=avi@redhat.com \
    --cc=dzickus@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=joerg.roedel@amd.com \
    --cc=kexec@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludwig.nussel@suse.de \
    --cc=luto@mit.edu \
    --cc=mtosatti@redhat.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=zhangyanfei@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.