On Hardy and Caffarelli-Kohn-Nirenberg inequalities