Remarks on the energy equality for weak solutions to Navier--Stokes equations