Skip to contentSkip to conversation

media: staging: atomisp: Corrected error handling in function

PATCH In review Leonid Kushnir 4 participants 6 messages Oct 6, 2020 – Oct 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 media: staging: atomisp: Corrected error handling in function

This patch fixes check of a result of 'power_up()' function call in function 'gc0310_s_power()' to do "error handling" instead of "success handling" as Dan Carpenter noted in his comment on the previous patch. Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct value of 'ret' is checked in IF statement now.

---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +4 -3
index 8201c15b5769..d170d0adfea4 100644
@@ -874,11 +874,12 @@ static int gc0310_s_power(struct v4l2_subdev *sd, int on)
 
 	if (on == 0)
 		return power_down(sd);
+
 	ret = power_up(sd);
-	if (!ret)
-		return gc0310_init(sd);
+	if (ret)
+		return ret;
 
-	return ret;
+	return gc0310_init(sd);
 }
 
 /*
Signature · 1 line
2.25.1
author
#1 lore raw

Hello. I‘ve sent recently my first two patches and haven’t received any feedback. Can I expect it. I’m a newbie in kernel contribution process, so don’t know all the details.
Thanks.

вт, 6 окт. 2020 г. в 22:29, Leonid Kushnir <[email protected]>:

Quoted 37 lines

This patch fixes check of a result of 'power_up()' function call in function 'gc0310_s_power()' to do "error handling" instead of "success handling" as Dan Carpenter noted in his comment on the previous patch. Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct value of 'ret' is checked in IF statement now.

---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +4 -3
index 8201c15b5769..d170d0adfea4 100644
@@ -874,11 +874,12 @@ static int gc0310_s_power(struct v4l2_subdev *sd,
 int on)
 
        if (on == 0)
                return power_down(sd);
+
        ret = power_up(sd);
-       if (!ret)
-               return gc0310_init(sd);
+       if (ret)
+               return ret;
 
-       return ret;
+       return gc0310_init(sd);
 }
 

/*
--
2.25.1

#2 lore raw
Quoted 3 lines · On Sat, 17 Oct 2020, leonf08 wrote:

Hello. I‘ve sent recently my first two patches and haven’t received any feedback. Can I expect it. I’m a newbie in kernel contribution process, so don’t know all the details.

I don't have any recollection of seeing any mail from you. Did you verify on the google groups web interface that your messages are there?

julia

Quoted 52 lines

Thanks.

вт, 6 окт. 2020 г. в 22:29, Leonid Kushnir <[email protected]>:

      This patch fixes check of a result of 'power_up()' function call
      in
      function 'gc0310_s_power()' to do "error handling" instead of
      "success
      handling" as Dan Carpenter noted in his comment on the previous
      patch.
      Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and
      direct
      value of 'ret' is checked in IF statement now.

      Signed-off-by: Leonid Kushnir <[email protected]>
      ---
       drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---
       1 file changed, 4 insertions(+), 3 deletions(-)

      diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
      b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
      index 8201c15b5769..d170d0adfea4 100644
      --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
      +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
      @@ -874,11 +874,12 @@ static int gc0310_s_power(struct
      v4l2_subdev *sd, int on)

              if (on == 0)
                      return power_down(sd);
      +
              ret = power_up(sd);
      -       if (!ret)
      -               return gc0310_init(sd);
      +       if (ret)
      +               return ret;

      -       return ret;
      +       return gc0310_init(sd);
       }

       /*
      --
      2.25.1

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAN%2Bihrq_v6OFbOrZUhHZP RTjsUO5nrnr7Kj3AHQJYSD7%2BoXe5g%40mail.gmail.com.

maintainer
#3 lore raw
In reply to leonf08
Quoted 5 lines · On Sat, Oct 17, 2020 at 03:58:41PM +0200, leonf08 wrote:

Hello. I‘ve sent recently my first two patches and haven’t received any feedback. Can I expect it. I’m a newbie in kernel contribution process, so don’t know all the details.
Thanks.

Quoted 11 lines

вт, 6 окт. 2020 г. в 22:29, Leonid Kushnir <[email protected]>:

Quoted 9 lines

This patch fixes check of a result of 'power_up()' function call in function 'gc0310_s_power()' to do "error handling" instead of "success handling" as Dan Carpenter noted in his comment on the previous patch. Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct value of 'ret' is checked in IF statement now.

---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---

As the instructions say, for patches in drivers/staging/media/*, there is no guaranteed response time, and so it is not good to do work in there for the outreachy application process.

Please pick some other directory under drivers/staging/ that is not the media/ subdir.

Again, the instructions should already say that, I recommend reading it again fully.

thanks,

greg k-h

author
#4 lore raw

Thanks a lot. I must haven’t noticed that.

сб, 17 окт. 2020 г. в 16:04, Greg KH <[email protected]>:

Quoted 33 lines · On Sat, Oct 17, 2020 at 03:58:41PM +0200, leonf08 wrote:
Quoted 2 lines

Hello. I‘ve sent recently my first two patches and haven’t received any feedback. Can I expect it. I’m a newbie in kernel contribution process,

so

Quoted 14 lines

don’t know all the details.
Thanks.

вт, 6 окт. 2020 г. в 22:29, Leonid Kushnir <[email protected]>:

Quoted 9 lines

This patch fixes check of a result of 'power_up()' function call in function 'gc0310_s_power()' to do "error handling" instead of "success handling" as Dan Carpenter noted in his comment on the previous patch. Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct value of 'ret' is checked in IF statement now.

---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---

As the instructions say, for patches in drivers/staging/media/*, there is no guaranteed response time, and so it is not good to do work in there for the outreachy application process.

Please pick some other directory under drivers/staging/ that is not the media/ subdir.

Again, the instructions should already say that, I recommend reading it again fully.

thanks,

greg k-h

#5 lore raw
Quoted 2 lines · On Sat, Oct 17, 2020 at 8:19 PM leonf08 <[email protected]> wrote:

Thanks a lot. I must haven’t noticed that.

Please avoid top-posting while replying to emails of others. [Checkout 'Responding to emails' part of the tutorial on kernelnewbies]

Quoted 6 lines

сб, 17 окт. 2020 г. в 16:04, Greg KH <[email protected]>:

Quoted 5 lines · On Sat, Oct 17, 2020 at 03:58:41PM +0200, leonf08 wrote:
Quoted 3 lines

Hello. I‘ve sent recently my first two patches and haven’t received any feedback. Can I expect it. I’m a newbie in kernel contribution process, so don’t know all the details.

I don't see any patches from you in the pending emails or otherwise on the web interface of the list.

Anyway, I would suggest that you send new patches for some other issues as it seems that your previous patches were fixing things in staging/media. You can verify if they landed in the list by checking on the web interface.

Quoted 32 lines
Quoted 21 lines
Quoted 13 lines

Thanks.

вт, 6 окт. 2020 г. в 22:29, Leonid Kushnir <[email protected]>:

Quoted 9 lines

This patch fixes check of a result of 'power_up()' function call in function 'gc0310_s_power()' to do "error handling" instead of "success handling" as Dan Carpenter noted in his comment on the previous patch. Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct value of 'ret' is checked in IF statement now.

---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---

As the instructions say, for patches in drivers/staging/media/*, there is no guaranteed response time, and so it is not good to do work in there for the outreachy application process.

Please pick some other directory under drivers/staging/ that is not the media/ subdir.

Quoted 6 lines

Again, the instructions should already say that, I recommend reading it again fully.

thanks,

greg k-h

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAN%2BihrpqYw_29OHpQHAxAadOFt8h3dovo-ZKMQN_OcbtEx4HcQ%40mail.gmail.com.

Signature · 5 lines
Vaishali


-- 
Vaishali