public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: SAURAV GIREPUNJE <saurav.girepunje@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: b-liu@ti.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com
Subject: Re: [PATCH] usb: musb: davinci: change the variable type
Date: Wed, 28 Apr 2021 01:07:40 +0530	[thread overview]
Message-ID: <20210427193740.GB11046@user> (raw)
In-Reply-To: <YIE4hh5NOJMT7QqK@kroah.com>

On Thu, Apr 22, 2021 at 10:49:10AM +0200, Greg KH wrote:
> On Mon, Apr 19, 2021 at 12:06:18AM +0530, Saurav Girepunje wrote:
> > vbus_state is define as bool but on davinci.c assigning a value
> > '-1' to the bool variable.
> 
> Does it also test that value?
> 
> If so, shouldn't that logic error be fixed instead of working around it
> by changing the variable type?
> 
> This feels wrong...
> 
> thanks,
> 
> greg k-h

vbus_state is assign with the value of "-1" in davinci.c file.
However it check value whether it is zero or a non-zero.

This value pass On gpio lib function.Which need this value to bool only.

On below "glue->vbus_state" should be 1.

	glue->vbus = devm_gpiod_get_optional(&pdev->dev, NULL, GPIOD_OUT_LOW);
	if (IS_ERR(glue->vbus)) {
                ret = PTR_ERR(glue->vbus);
                goto err0;
        } else {
                glue->vbus_state = -1;
                INIT_WORK(&glue->vbus_work, evm_deferred_drvvbus);
        }


      reply	other threads:[~2021-04-27 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 18:36 [PATCH] usb: musb: davinci: change the variable type Saurav Girepunje
2021-04-22  8:49 ` Greg KH
2021-04-27 19:37   ` SAURAV GIREPUNJE [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210427193740.GB11046@user \
    --to=saurav.girepunje@gmail.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=saurav.girepunje@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox