On 2 Dec 2016 2:17 p.m., "Atul Raj" <[email protected]> wrote:
 >
 >
 > >
 > >Instead of using:
 > >if (cond) {
 > >   WARN_ON(1);
 > >   do_stuff();
 > >}
 > >
 > >Use a better pattern with WARN_ON() placed in if condition:
 > >
 > >if (WARN_ON(cond))
 > >   do_stuff();
 > >
 > >Signed-off-by: Atul Raj <[email protected]>
 > >---
> > drivers/usb/chipidea/ci_hdrc_imx.c | 8 ++------
> > 1 file changed, 2 insertions(+), 6 deletions(-)
 > >
 > >diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
 > >b/drivers/usb/chipidea/ci_hdrc_imx.c
 > >index 0991794..2228e44 100644
 > >--- a/drivers/usb/chipidea/ci_hdrc_imx.c
 > >+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
 > >@@ -374,10 +374,8 @@ static int imx_controller_resume(struct device *dev)
 > >
 > >         dev_dbg(dev, "at %s\n", __func__);
 > >
 > >-        if (!data->in_lpm) {
 > >-                WARN_ON(1);
 > >+        if (WARN_ON(!data->in_lpm))
 > >                 return 0;
 > >-        }
 > >
 > >         ret = imx_prepare_enable_clks(dev);
 > >         if (ret)
 > >@@ -442,10 +440,8 @@ static int ci_hdrc_imx_runtime_suspend(struct device 
 > >*dev)
 > >         struct ci_hdrc_imx_data *data = dev_get_drvdata(dev);
 > >         int ret;
 > >
 > >-        if (data->in_lpm) {
 > >-                WARN_ON(1);
 > >+        if (WARN_ON(data->in_lpm))
 > >                 return 0;
 > >-        }
 > >
 > >         ret = imx_usbmisc_set_wakeup(data->usbmisc_data, true);
 > >         if (ret) {
 > >--
>  
 > please cc: [email protected]
 >  

Dear Peter

As I am a newbie, I have been instructed by greg k-h to first try to submit 
patches in staging drivers. So I am trying to submit some patches there. I had 
sent you the patch to review before greg asked me to do so. 

Maybe the patch I sent could be base 64-encoded as per samsung mailing policy.
From now onwards I will use gmail([email protected]) till I get exception 
from encoding.

I am sorry for all the trouble.

I am cc: ing the patch to email address as asked by you.

Thanks

Reply via email to