re: Staging: VME Framework for the Linux Kernel

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

 



Hello Martyn Welch,

The patch a17a75e2666f: "Staging: VME Framework for the Linux Kernel"
from Jul 31, 2009, leads to the following static checker warning:

	drivers/vme/vme.c:161 vme_get_size()
	error: uninitialized variable 'size'.

drivers/vme/vme.c
   149  size_t vme_get_size(struct vme_resource *resource)
   150  {
   151          int enabled, retval;
   152          unsigned long long base, size;
   153          dma_addr_t buf_base;
   154          u32 aspace, cycle, dwidth;
   155  
   156          switch (resource->type) {
   157          case VME_MASTER:
   158                  retval = vme_master_get(resource, &enabled, &base, &size,
   159                          &aspace, &cycle, &dwidth);
   160  
   161                  return size;

Probably we should say something like:

			if (retval)
				return 0;
			return size;

   162                  break;
   163          case VME_SLAVE:
   164                  retval = vme_slave_get(resource, &enabled, &base, &size,
   165                          &buf_base, &aspace, &cycle);
   166  
   167                  return size;

Same here.

   168                  break;
   169          case VME_DMA:
   170                  return 0;
   171                  break;
   172          default:
   173                  printk(KERN_ERR "Unknown resource type\n");
   174                  return 0;
   175                  break;
   176          }
   177  }
   178  EXPORT_SYMBOL(vme_get_size);


regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux