Some regularity results for a class of upper semicontinuous functions