  Wald's entropy formula allows one to find the entropy of black holes' event
horizon within any diffeomorphism invariant theory of gravity. When applied to
general relativity, the formula yields the Bekenstein-Hawking result but, for
any other gravitational action that departs from the Hilbert action, the
resulting entropy acquires an additional multiplicative factor that depends on
the global geometry of the background spacetime. On the other hand, the
generalized uncertainty principle (GUP) has extensively been recently used to
investigate corrections to the Bekenstein-Hawking entropy formula, with the
conclusion that the latter always comes multiplied by a factor that depends on
the area of the event horizon. We show, by considering the case of an
$f(R)$-modified gravity, that the usual black hole entropy derivation based on
the GUP might be modified in such a way that the two methods yield the same
corrections to Bekenstein-Hawking formula. The procedure turns out to be an
interesting method for seeking modified gravity theories. Two different
versions of the GUP are used and it is found that only one of them yields a
viable modified gravity model. Conversely, it is possible to find a general
formulation of the GUP that would reproduce Wald entropy formula for any
$f(R)$-theory of gravity.
