[PATCH 7/7] nvme: Send change uevent when AEN completes
Keith Busch
keith.busch at intel.com
Tue Jul 11 07:43:53 PDT 2017
On Mon, Jul 10, 2017 at 04:57:43PM -0700, James Smart wrote:
> On 7/7/2017 9:23 AM, Keith Busch wrote:
> > +void nvme_aen_uevent(struct nvme_ctrl *ctrl)
> > +{
> > + char buffer[20]; /* NVME_AEN=0xffffffff\0 */
> > + char *envp[2] = {buffer, NULL};
> > + u32 aen = ctrl->aen;
> > +
> > + ctrl->aen = 0;
> > + if (!aen)
> > + return;
> > +
> > + snprintf(buffer, sizeof(buffer), "NVME_AEN=%#08x", aen);
> > + kobject_uevent_env(&ctrl->device->kobj, KOBJ_CHANGE, envp);
> > +}
> > +
>
> Passing on a comment from Christoph received on a similar fc udev event:
> "Please use kasprintf so that we have a dynamic allocation and don't need to
> hardcode buffer sizes"
I agree that usage for dynamic strings is better, but this is a fixed
sized string that will always be 20 bytes.
More information about the Linux-nvme
mailing list