# \[PATCH 1/2\] staging: sm750fb: fixing function return with lock held

- Subsystems: STAGING - SILICON MOTION SM750 FRAME BUFFER DRIVER, STAGING SUBSYSTEM, THE REST
- Maintainers: Sudip Mukherjee, Teddy Wang, Sudip Mukherjee, Greg Kroah-Hartman, Linus Torvalds
- List: linux-fbdev
- 4 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2017/03/4968582/t

## \[PATCH 1/2\] staging: sm750fb: fixing function return with lock held

- From: Prasant Jalan \<hidden\>
- Date: 2017-03-31 19:13:54 
- Message: https://ratatoskr.run/linux-fbdev/2017/03/4968582.md

```text
lynxfb_suspend() & lynxfb_resume() return on errors while holding
console_lock.

Adding 'goto' such that proper cleanups can be done before returning
from function and therefore console_lock can be released before
returning.

Signed-off-by: Prasant Jalan <redacted>
---
 drivers/staging/sm750fb/sm750.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index c618c56..445c68d 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -419,7 +419,7 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
 		if (ret) {
 			dev_err(&pdev->dev,
 				"error:%d occurred in pci_save_state\n", ret);
-			return ret;
+			goto lynxfb_suspend_err;
 		}
 
 		ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
@@ -427,11 +427,13 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
 			dev_err(&pdev->dev,
 				"error:%d occurred in pci_set_power_state\n",
 				ret);
-			return ret;
+			goto lynxfb_suspend_err;
 		}
 	}
 
 	pdev->dev.power.power_state = mesg;
+
+lynxfb_suspend_err:
 	console_unlock();
 	return ret;
 }
@@ -456,7 +458,7 @@ static int lynxfb_resume(struct pci_dev *pdev)
 	if (ret) {
 		dev_err(&pdev->dev,
 			"error:%d occurred in pci_set_power_state\n", ret);
-		return ret;
+		goto lynxfb_resume_err;
 	}
 
 	if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) {
@@ -466,7 +468,7 @@ static int lynxfb_resume(struct pci_dev *pdev)
 			dev_err(&pdev->dev,
 				"error:%d occurred in pci_enable_device\n",
 				ret);
-			return ret;
+			goto lynxfb_resume_err;
 		}
 		pci_set_master(pdev);
 	}
@@ -498,6 +500,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
 	}
 
 	pdev->dev.power.power_state.event = PM_EVENT_RESUME;
+
+lynxfb_resume_err:
 	console_unlock();
 	return ret;
 }
-- 
2.7.4

```

## \[PATCH 2/2\] staging: sm750fb: removed line continuations in quoted strings

- From: Prasant Jalan \<hidden\>
- Date: 2017-03-31 19:14:01 
- Message: https://ratatoskr.run/linux-fbdev/2017/03/4968583.md

```text
checkpatch gives WARNING: Avoid line continuations in quoted strings.

Trivial fix by removing line continuations and adding another quote at
the start of next line.

Signed-off-by: Prasant Jalan <redacted>
---
 drivers/staging/sm750fb/sm750.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 445c68d..386d4ad 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -837,15 +837,15 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 
 	/* some member of info->var had been set by fb_find_mode */
 
-	pr_info("Member of info->var is :\n\
-		xres=%d\n\
-		yres=%d\n\
-		xres_virtual=%d\n\
-		yres_virtual=%d\n\
-		xoffset=%d\n\
-		yoffset=%d\n\
-		bits_per_pixel=%d\n \
-		...\n",
+	pr_info("Member of info->var is :\n"
+		"xres=%d\n"
+		"yres=%d\n"
+		"xres_virtual=%d\n"
+		"yres_virtual=%d\n"
+		"xoffset=%d\n"
+		"yoffset=%d\n"
+		"bits_per_pixel=%d\n"
+		" ...\n",
 		var->xres,
 		var->yres,
 		var->xres_virtual,
-- 
2.7.4

```

## Re: \[PATCH 2/2\] staging: sm750fb: removed line continuations in quoted strings

- From: Prasant Jalan \<hidden\>
- Date: 2017-04-03 16:33:37 
- Message: https://ratatoskr.run/linux-fbdev/2017/04/4969815.md

```text
On Sat, Apr 1, 2017 at 12:40 AM, Prasant Jalan [ref] wrote:
> checkpatch gives WARNING: Avoid line continuations in quoted strings.
>
> Trivial fix by removing line continuations and adding another quote at
> the start of next line.
>
> Signed-off-by: Prasant Jalan <redacted>
> ---
>  drivers/staging/sm750fb/sm750.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 445c68d..386d4ad 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -837,15 +837,15 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
>
>         /* some member of info->var had been set by fb_find_mode */
>
> -       pr_info("Member of info->var is :\n\
> -               xres=%d\n\
> -               yres=%d\n\
> -               xres_virtual=%d\n\
> -               yres_virtual=%d\n\
> -               xoffset=%d\n\
> -               yoffset=%d\n\
> -               bits_per_pixel=%d\n \
> -               ...\n",
> +       pr_info("Member of info->var is :\n"
> +               "xres=%d\n"
> +               "yres=%d\n"
> +               "xres_virtual=%d\n"
> +               "yres_virtual=%d\n"
> +               "xoffset=%d\n"
> +               "yoffset=%d\n"
> +               "bits_per_pixel=%d\n"
> +               " ...\n",
>                 var->xres,
>                 var->yres,
>                 var->xres_virtual,
> --
> 2.7.4
>

Hi All,


A gentle reminder for my patches.
Any comments or updates will be helpful!


Regards, Prasant
```

## Re: \[PATCH 2/2\] staging: sm750fb: removed line continuations in quoted strings

- From: Greg KH \<gregkh@linuxfoundation.org\>
- Date: 2017-04-03 17:55:21 
- Message: https://ratatoskr.run/linux-fbdev/2017/04/4969866.md

```text
On Mon, Apr 03, 2017 at 10:03:34PM +0530, Prasant Jalan wrote:
> On Sat, Apr 1, 2017 at 12:40 AM, Prasant Jalan [ref] wrote:

<snip>

> A gentle reminder for my patches.
> Any comments or updates will be helpful!

2 days, over a weekend, for a coding style change is pretty fast, don't
you agree?  I will get to these eventually, usually every other week I
flush them all out.

Please be patient, don't worry, the patch is not lost.

thanks,

greg k-h
```
