On a generalized Fan inequality