We study the effect of superconducting fluctuations on the conductivity of metals at arbitrary temperatures T and impurity scattering rates τ-1. Using the standard diagrammatic technique but in the Keldysh representation, we derive the general expression for the fluctuation correction to the dc conductivity applicable for any space dimensionality and analyze it in the case of the film geometry. We observe that the usual classification in terms of the Aslamazov-Larkin, Maki-Thompson, and density-of-states diagrams is to some extent artificial since these contributions produce similar terms, which partially cancel each other. In the diffusive limit, our results fully coincide with recent calculations in the Keldysh technique. In the ballistic limit near the transition, we demonstrate the absence of a divergent term (Tτ)2 attributed previously to the density-of-states contribution. In the ballistic limit far above the transition, the temperature-dependent part of the conductivity correction is shown to grow as Tτ/ln(T/Tc), where Tc is the critical temperature.