Shouldn't be an issue going from 40t to 38t up front. You may not even need to shorten the existing chain.
You may not gain much for the climbs, though; I ride 2x with a 34/40 climbing gear on my gravel bike. That gets me up most of the steeper stuff. Over the years I've gone from a 28t, 32t, and 36t large cog in the back, to the 40t I have now. I can probably get away with just having a 34/36 climbing gear but the 34/40 removes all (most) doubt.