Re: [PATCH v2 0/5] usb: cdc-wdm: subdriver support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag, 27. Februar 2012, 14:13:37 schrieb Bjørn Mork:
> > +/* using a counter to merge subdriver requests with our own into a combined state */
> >  static int qmi_wwan_manage_power(struct usbnet *dev, int on)
> >  {
> > -     dev->intf->needs_remote_wakeup = on;
> > -     return 0;
> > +     atomic_t *pmcount = (void *)&dev->data[1];
> >
> > Where is this initialized?
> 
> struct usbnet is allocated as a private part of the netdev by
>   usbnet_probe => alloc_etherdev => alloc_netdev_mqs => kzalloc
> So the whole data[5] array should already be properly initialized to 0

Hi,

strictly speaking atomic variables must be initialized. One cannot depend
on a binary 0 meaning that an atomic ariable is 0 and ready to use.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux