alloc_netdev() and 32 byte or 32 bit alignment???

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

 



Hi ,

following code snippet is self evident in what it does -

truct net_device *alloc_netdev(int sizeof_priv, const char *name,
              void (*setup)(struct net_device *))
{
      void *p;
      struct net_device *dev;
      int alloc_size;

      /* ensure 32-byte alignment of both the device and private area */
      alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST;
      alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;

      p = kzalloc(alloc_size, GFP_KERNEL);
      if (!p) {
              printk(KERN_ERR "alloc_dev: Unable to allocate device.\n");
              return NULL;
      }
[snip]

Is the comment correct?
Why is it 'ensure 32 byte alignment', instead of 32 bit alignment?

What am i missing here?

Thank you
--psr

--
play the game

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux