I've heard of some that made the conversion. The barrel opening in the slide has to bored out to fit the barrel & I think the recoil spring has to be changed as I understand it. Of course you'd also need .40 cal mags. I don't know how successful the conversion was. I wouldn't recommend it.
I also believe I read somewhere that someone made a conversion by getting a .40 cal slide & used the 9mm frame. I think the slide would fit. I don't know what the cost of slide, barrel & mags would cost & if it would be worth it as opposed to buying a used 40 cal M&P.