The Gemara says: it's better to do Torah and Mitzvos even if it's not L'Shma, since it will lead to L'Shma
Tosfos asks: the gemara in Brachos says it's better not to be borne than to do Mitzvos not L'Shma?
Over there refers to learning Torah for a bad purpose, to belittle others. However, we refer when you have an alternative purpose, like to receive fame.
Blast your way into Elul Zman:
"Gemara and Tosfos"
Try First Amud of Perek Free
tosfos.ecwid.com