The weight distribution of some quasi-cyclic codes