--- initial
+++ final
@@ -1,115 +1,115 @@
 static int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src, struct vme_dma_attr *dest, size_t count) {
   struct tsi148_dma_entry *entry, *prev;
   u32 address_high, address_low, val;
   struct vme_dma_pattern *pattern_attr;
   struct vme_dma_pci *pci_attr;
   struct vme_dma_vme *vme_attr;
   int retval = 0;
   struct vme_bridge *tsi148_bridge;
   tsi148_bridge = list->parent->parent;
   /* Descriptor must be aligned on 64-bit boundaries */
-  entry = kmalloc(sizeof(struct tsi148_dma_entry), GFP_KERNEL);
+  entry = kmalloc(sizeof(*entry), GFP_KERNEL);
   if (entry == NULL) {
     retval = -ENOMEM;
     goto err_mem;
   }
   /* Test descriptor alignment */
   if ((unsigned long)&entry->descriptor & 0x7) {
     dev_err(tsi148_bridge->parent,
             "Descriptor not aligned to 8 "
             "byte boundary as required: %p\n",
             &entry->descriptor);
     retval = -EINVAL;
     goto err_align;
   }
   /* Given we are going to fill out the structure, we probably don't
    * need to zero it, but better safe than sorry for now.
    */
-  memset(&entry->descriptor, 0, sizeof(struct tsi148_dma_descriptor));
+  memset(&entry->descriptor, 0, sizeof(entry->descriptor));
   /* Fill out source part */
   switch (src->type) {
   case VME_DMA_PATTERN:
     pattern_attr = src->private;
     entry->descriptor.dsal = cpu_to_be32(pattern_attr->pattern);
     val = TSI148_LCSR_DSAT_TYP_PAT;
     /* Default behaviour is 32 bit pattern */
     if (pattern_attr->type & VME_DMA_PATTERN_BYTE) val |= TSI148_LCSR_DSAT_PSZ;
     /* It seems that the default behaviour is to increment */
     if ((pattern_attr->type & VME_DMA_PATTERN_INCREMENT) == 0) val |= TSI148_LCSR_DSAT_NIN;
     entry->descriptor.dsat = cpu_to_be32(val);
     break;
   case VME_DMA_PCI:
     pci_attr = src->private;
     reg_split((unsigned long long)pci_attr->address, &address_high, &address_low);
     entry->descriptor.dsau = cpu_to_be32(address_high);
     entry->descriptor.dsal = cpu_to_be32(address_low);
     entry->descriptor.dsat = cpu_to_be32(TSI148_LCSR_DSAT_TYP_PCI);
     break;
   case VME_DMA_VME:
     vme_attr = src->private;
     reg_split((unsigned long long)vme_attr->address, &address_high, &address_low);
     entry->descriptor.dsau = cpu_to_be32(address_high);
     entry->descriptor.dsal = cpu_to_be32(address_low);
     entry->descriptor.dsat = cpu_to_be32(TSI148_LCSR_DSAT_TYP_VME);
     retval = tsi148_dma_set_vme_src_attributes(tsi148_bridge->parent, &entry->descriptor.dsat, vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
     if (retval < 0) goto err_source;
     break;
   default:
     dev_err(tsi148_bridge->parent, "Invalid source type\n");
     retval = -EINVAL;
     goto err_source;
     break;
   }
   /* Assume last link - this will be over-written by adding another */
   entry->descriptor.dnlau = cpu_to_be32(0);
   entry->descriptor.dnlal = cpu_to_be32(TSI148_LCSR_DNLAL_LLA);
   /* Fill out destination part */
   switch (dest->type) {
   case VME_DMA_PCI:
     pci_attr = dest->private;
     reg_split((unsigned long long)pci_attr->address, &address_high, &address_low);
     entry->descriptor.ddau = cpu_to_be32(address_high);
     entry->descriptor.ddal = cpu_to_be32(address_low);
     entry->descriptor.ddat = cpu_to_be32(TSI148_LCSR_DDAT_TYP_PCI);
     break;
   case VME_DMA_VME:
     vme_attr = dest->private;
     reg_split((unsigned long long)vme_attr->address, &address_high, &address_low);
     entry->descriptor.ddau = cpu_to_be32(address_high);
     entry->descriptor.ddal = cpu_to_be32(address_low);
     entry->descriptor.ddat = cpu_to_be32(TSI148_LCSR_DDAT_TYP_VME);
     retval = tsi148_dma_set_vme_dest_attributes(tsi148_bridge->parent, &entry->descriptor.ddat, vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
     if (retval < 0) goto err_dest;
     break;
   default:
     dev_err(tsi148_bridge->parent, "Invalid destination type\n");
     retval = -EINVAL;
     goto err_dest;
     break;
   }
   /* Fill out count */
   entry->descriptor.dcnt = cpu_to_be32((u32)count);
   /* Add to list */
   list_add_tail(&entry->list, &list->entries);
-  entry->dma_handle = dma_map_single(tsi148_bridge->parent, &entry->descriptor, sizeof(struct tsi148_dma_descriptor), DMA_TO_DEVICE);
+  entry->dma_handle = dma_map_single(tsi148_bridge->parent, &entry->descriptor, sizeof(entry->descriptor), DMA_TO_DEVICE);
   if (dma_mapping_error(tsi148_bridge->parent, entry->dma_handle)) {
     dev_err(tsi148_bridge->parent, "DMA mapping error\n");
     retval = -EINVAL;
     goto err_dma;
   }
   /* Fill out previous descriptors "Next Address" */
   if (entry->list.prev != &list->entries) {
     reg_split((unsigned long long)entry->dma_handle, &address_high, &address_low);
     prev = list_entry(entry->list.prev, struct tsi148_dma_entry, list);
     prev->descriptor.dnlau = cpu_to_be32(address_high);
     prev->descriptor.dnlal = cpu_to_be32(address_low);
   }
   return 0;
 err_dma:
 err_dest:
 err_source:
 err_align:
   kfree(entry);
 err_mem:
   return retval;
 }<sep>@@
expression e1,e2;
type T;
@@

memset (&e1,e2,
- sizeof(T)
+ sizeof(e1)
  )

@@
expression e1,e2;
type T;
@@

e1 = kmalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)

@@
expression e1,e2,e3;
type T;
@@

	dma_map_single(e1,&e2,
-		sizeof(T)
+		sizeof(e2)
		,e3)