Message ID | 20200424045414.133381-1-swboyd@chromium.org |
---|---|
Headers | show |
Series | Even moar rpmh cleanups | expand |
On Thu 23 Apr 21:54 PDT 2020, Stephen Boyd wrote: > Move the WARN_ON() into the if condition so the compiler can see that > the branch is unlikely() and possibly optimize it better. > > Cc: Maulik Shah <mkshah@codeaurora.org> > Cc: Douglas Anderson <dianders@chromium.org> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> > --- > drivers/soc/qcom/rpmh-rsc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index 462dd267afef..f7763f008e03 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -373,10 +373,8 @@ static irqreturn_t tcs_tx_done(int irq, void *p) > > for_each_set_bit(i, &irq_status, BITS_PER_TYPE(u32)) { > req = get_req_from_tcs(drv, i); > - if (!req) { > - WARN_ON(1); > + if (WARN_ON(!req)) > goto skip; > - } > > err = 0; > for (j = 0; j < req->num_cmds; j++) { > -- > Sent by a computer, using git, on the internet >
Hi, On Thu, Apr 23, 2020 at 9:54 PM Stephen Boyd <swboyd@chromium.org> wrote: > > readl returns a u32, and BITS_PER_LONG is different on 32-bit vs. 64-bit > architectures. Let's make the type we stash the readl into a u32 and > then loop over the bits set in that type instead of potentially looping > over more bits than we will ever need to. > > Cc: Maulik Shah <mkshah@codeaurora.org> > Cc: Douglas Anderson <dianders@chromium.org> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> > --- > drivers/soc/qcom/rpmh-rsc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Douglas Anderson <dianders@chromium.org>
Hi, On Fri, Apr 24, 2020 at 10:11 AM Doug Anderson <dianders@chromium.org> wrote: > > Hi, > > On Thu, Apr 23, 2020 at 9:54 PM Stephen Boyd <swboyd@chromium.org> wrote: > > > > readl returns a u32, and BITS_PER_LONG is different on 32-bit vs. 64-bit > > architectures. Let's make the type we stash the readl into a u32 and > > then loop over the bits set in that type instead of potentially looping > > over more bits than we will ever need to. > > > > Cc: Maulik Shah <mkshah@codeaurora.org> > > Cc: Douglas Anderson <dianders@chromium.org> > > Signed-off-by: Stephen Boyd <swboyd@chromium.org> > > --- > > drivers/soc/qcom/rpmh-rsc.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > Reviewed-by: Douglas Anderson <dianders@chromium.org> Oh, I suppose one nit is s/less/fewer/ in the subject. "bits" are discrete / countable, not continuous / uncountable. -Doug