Re: [patch 1/2] Staging: vme: remove an unused array

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

 



On Fri, Jul 06, 2012 at 11:32:51AM +0100, Martyn Welch wrote:
> On 06/07/12 09:15, Dan Carpenter wrote:
> > We don't use the "bus" array or the "bus_num" variable which store the
> > number of elements in the array.  The only user was removed in
> > 5d6abf379d ('staging: vme: make match() driver specific to improve
> > non-VME64x support').
> > 
> 
> Hmm, without a parameter to specify the bus (i.e. a specific vme bridge) to
> which vme_user is to bind, vme_user will bind to all bridges it finds, hogging
> resources on them all.
> 
> Ok, so the current implementation of vme_user can only bind to one bus, so
> it's worse than that, it will only every bind to the first bridge when more
> than one are available.
> 
> It appears that the real problem here is that vme_user_match is wrong.
> 
> Rather than:
> 
> 	static int vme_user_match(struct vme_dev *vdev)
> 	{
> 		if (vdev->num >= VME_USER_BUS_MAX)
> 			return 0;
> 		return 1;
> 	}
> 
> It should be something like:
> 
> 	static int vme_user_match(struct vme_dev *vdev)
> 	{
> 		int i;
> 
> 		for (i = 0; i < VME_USER_BUS_MAX; i++)
> 			if (vdev->num == bus[i])
> 				return 1;
> 		return 0;
> 	}
> 

So the default behavior way should be to bind to the first bus or to
all?

Obviously, we should do your fix.  The problem is that I don't want
to be the one to sign off on something that changes how the code
works when I can't test it.  Can you send for a patch for this?

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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