summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMichel von Czettritz <michel.von.czettritz@gmail.com>2015-03-26 23:27:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-03 13:39:33 +0200
commit61c507cf652da1bc8436bdb909343f33175fd566 (patch)
tree0a74f4ea01f1ddb3c1a907894f193d2265f03243 /drivers/staging
parenteb1167a36cdb48ae6328132ad68bf1bdc29339cf (diff)
downloadop-kernel-dev-61c507cf652da1bc8436bdb909343f33175fd566.zip
op-kernel-dev-61c507cf652da1bc8436bdb909343f33175fd566.tar.gz
staging: sm750: move assignment out of if cond
This patch moves the assignments from the if conditions to the line before the condition. The 3 occurrence are return values and the checks for errors. Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/sm750fb/sm750.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index f300df4..3c7ea95 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -477,7 +477,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
console_lock();
- if ((ret = pci_set_power_state(pdev, PCI_D0)) != 0) {
+ ret = pci_set_power_state(pdev, PCI_D0);
+ if (ret) {
pr_err("error:%d occured in pci_set_power_state\n", ret);
return ret;
}
@@ -485,7 +486,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) {
pci_restore_state(pdev);
- if ((ret = pci_enable_device(pdev)) != 0) {
+ ret = pci_enable_device(pdev);
+ if (ret) {
pr_err("error:%d occured in pci_enable_device\n", ret);
return ret;
}
@@ -975,7 +977,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
- if ((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) {
+ ret = fb_alloc_cmap(&info->cmap, 256, 0);
+ if (ret < 0) {
pr_err("Could not allcate memory for cmap.\n");
goto exit;
}
OpenPOWER on IntegriCloud