Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

md: raid6: Fix mktable.c

Make both mktables.c and its output CodingStyle compliant. Update the
copyright notice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

H. Peter Anvin and committed by
Linus Torvalds
98ec302b 54212cf4

+17 -26
+17 -26
drivers/md/mktables.c
··· 1 - #ident "$Id: mktables.c,v 1.2 2002/12/12 22:41:27 hpa Exp $" 2 - /* ----------------------------------------------------------------------- * 1 + /* -*- linux-c -*- ------------------------------------------------------- * 3 2 * 4 - * Copyright 2002 H. Peter Anvin - All Rights Reserved 3 + * Copyright 2002-2007 H. Peter Anvin - All Rights Reserved 5 4 * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation, Inc., 53 Temple Place Ste 330, 9 - * Bostom MA 02111-1307, USA; either version 2 of the License, or 10 - * (at your option) any later version; incorporated herein by reference. 5 + * This file is part of the Linux kernel, and is made available under 6 + * the terms of the GNU General Public License version 2 or (at your 7 + * option) any later version; incorporated herein by reference. 11 8 * 12 9 * ----------------------------------------------------------------------- */ 13 10 ··· 70 73 for (j = 0; j < 256; j += 8) { 71 74 printf("\t\t"); 72 75 for (k = 0; k < 8; k++) 73 - printf("0x%02x, ", gfmul(i, j+k)); 74 - printf("\n"); 76 + printf("0x%02x,%c", gfmul(i, j + k), 77 + (k == 7) ? '\n' : ' '); 75 78 } 76 79 printf("\t},\n"); 77 80 } ··· 80 83 /* Compute power-of-2 table (exponent) */ 81 84 v = 1; 82 85 printf("\nconst u8 __attribute__((aligned(256)))\n" 83 - "raid6_gfexp[256] =\n" 84 - "{\n"); 86 + "raid6_gfexp[256] =\n" "{\n"); 85 87 for (i = 0; i < 256; i += 8) { 86 88 printf("\t"); 87 89 for (j = 0; j < 8; j++) { 88 - exptbl[i+j] = v; 89 - printf("0x%02x, ", v); 90 + exptbl[i + j] = v; 91 + printf("0x%02x,%c", v, (j == 7) ? '\n' : ' '); 90 92 v = gfmul(v, 2); 91 93 if (v == 1) 92 94 v = 0; /* For entry 255, not a real entry */ 93 95 } 94 - printf("\n"); 95 96 } 96 97 printf("};\n"); 97 98 98 99 /* Compute inverse table x^-1 == x^254 */ 99 100 printf("\nconst u8 __attribute__((aligned(256)))\n" 100 - "raid6_gfinv[256] =\n" 101 - "{\n"); 101 + "raid6_gfinv[256] =\n" "{\n"); 102 102 for (i = 0; i < 256; i += 8) { 103 103 printf("\t"); 104 104 for (j = 0; j < 8; j++) { 105 - v = gfpow(i+j, 254); 106 - invtbl[i+j] = v; 107 - printf("0x%02x, ", v); 105 + invtbl[i + j] = v = gfpow(i + j, 254); 106 + printf("0x%02x,%c", v, (j == 7) ? '\n' : ' '); 108 107 } 109 - printf("\n"); 110 108 } 111 109 printf("};\n"); 112 110 113 111 /* Compute inv(2^x + 1) (exponent-xor-inverse) table */ 114 112 printf("\nconst u8 __attribute__((aligned(256)))\n" 115 - "raid6_gfexi[256] =\n" 116 - "{\n"); 113 + "raid6_gfexi[256] =\n" "{\n"); 117 114 for (i = 0; i < 256; i += 8) { 118 115 printf("\t"); 119 116 for (j = 0; j < 8; j++) 120 - printf("0x%02x, ", invtbl[exptbl[i+j]^1]); 121 - printf("\n"); 117 + printf("0x%02x,%c", invtbl[exptbl[i + j] ^ 1], 118 + (j == 7) ? '\n' : ' '); 122 119 } 123 - printf("};\n\n"); 120 + printf("};\n"); 124 121 125 122 return 0; 126 123 }