]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
powerpc/mpc5200: Bugfix on handling variable sized buffer descriptors
authorGrant Likely <grant.likely@secretlab.ca>
Sun, 21 Dec 2008 09:54:27 +0000 (02:54 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Sun, 21 Dec 2008 09:54:27 +0000 (02:54 -0700)
commit622882455aa718cfbd6785cc5fbc479f1d976095
tree6c8fe006241810845419f17a80b4e82dc03aed11
parentdd952cbb3dae9ea2dc47cc902b796e1e2bf806f0
powerpc/mpc5200: Bugfix on handling variable sized buffer descriptors

The buffer descriptors for the ATA BestComm task are larger than the
current definition for bcom_bd.  This causes problems because the
various bcom_... functions dereference the buffer descriptor pointer
by using the array operator which doesn't work when the buffer
descriptors are a different size.

This patch adds the bcom_get_bd() function which uses the value in
bcom_task.bd_size to calculate the offset into the BD table.  This
patch also changes the definition of bcom_bd to specify a data size
of 0 instead of 1 so that it will never work if anyone attempts to
dereference the bd list as an array (as opposed to something that
might work even though it is wrong).

Finally, this patch moves the definition of bcom_bd up in the file
to eliminate a forward declaration.

Based on patch originally written by Tim Yamin.

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
arch/powerpc/sysdev/bestcomm/bestcomm.h