Linear inequalities and quadratic forms