Fixes coding style.

This commit is contained in:
Andrea Mazzoleni 2013-12-28 17:26:27 +01:00
parent b7a8858233
commit eb08995834
3 changed files with 12 additions and 12 deletions

View file

@ -465,13 +465,13 @@ void raid_rec_dataonly(int nr, const int *id, const int *ip, int nd, size_t size
if (nr != 0) {
/* if there is a waste buffer, use it to save unused parities */
if (raid_waste_block != 0) {
void * p[RAID_PARITY_MAX];
void *p[RAID_PARITY_MAX];
int i, j;
int np;
/* number of parities used */
np = ip[nr - 1] + 1;
/* set unused parities to the waste buffer */
for (i = 0, j = 0; i < np; ++i) {
p[i] = v[nd+i];

View file

@ -82,7 +82,7 @@ void raid_waste(void *zero);
* Computes the parity.
*
* \param nd Number of data disks.
* \param np Number of parities to compute.
* \param np Number of parities to compute.
* \param size Size of the blocks pointed by ::v. It must be a multipler of 64.
* \param v Vector of pointers to the blocks for disks and parities.
* It has (::nd + ::np) elements. The first elements are the blocks for
@ -152,7 +152,7 @@ void raid_rec_dataonly(int nr, const int *id, const int *ip, int nd, size_t size
* \param n Number of integers. No more than RAID_PARITY_MAX.
* \paran v Vector of integers.
*/
void raid_sort(int n, int* v);
void raid_sort(int n, int *v);
#endif

View file

@ -26,26 +26,26 @@
} \
} while (0)
void raid_sort(int n, int* v)
void raid_sort(int n, int *v)
{
/* sorting networks generated with the Batcher's Merge-Exchange algorithm */
/* sorting networks generated with Batcher's Merge-Exchange */
switch (n) {
case 2 :
case 2:
RAID_SWAP(0, 1);
break;
case 3 :
case 3:
RAID_SWAP(0, 2);
RAID_SWAP(0, 1);
RAID_SWAP(1, 2);
break;
case 4 :
case 4:
RAID_SWAP(0, 2);
RAID_SWAP(1, 3);
RAID_SWAP(0, 1);
RAID_SWAP(2, 3);
RAID_SWAP(1, 2);
break;
case 5 :
case 5:
RAID_SWAP(0, 4);
RAID_SWAP(0, 2);
RAID_SWAP(1, 3);
@ -56,7 +56,7 @@ void raid_sort(int n, int* v)
RAID_SWAP(1, 2);
RAID_SWAP(3, 4);
break;
case 6 :
case 6:
RAID_SWAP(0, 4);
RAID_SWAP(1, 5);
RAID_SWAP(0, 2);