/* can detect all single or double bit errors */
int has_error(unsigned code)
{
- unsigned data = code >> PARITY_BITS;
unsigned parity = code & ((1 << PARITY_BITS) - 1);
-
- return (generate_parity(data) != parity);
+ return (generate_parity(code >> PARITY_BITS) != parity);
}
int has_double_error(unsigned code)