From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Steve Glendinning <steve.glendinning@shawell.net>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 5/5] video: smscufx: Adjust three checks for null pointers
Date: Sat, 25 Nov 2017 20:50:06 +0000 [thread overview]
Message-ID: <0c4fc190-122a-6a46-2dcc-a17b4acd84b5@users.sourceforge.net> (raw)
In-Reply-To: <f12dd7c4-412d-813e-c859-e5d4b3e6d56f@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 25 Nov 2017 21:21:20 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/video/fbdev/smscufx.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
index 03d35429e1b9..d14604536e63 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -1081,7 +1081,7 @@ static int ufx_ops_open(struct fb_info *info, int user)
kref_get(&dev->kref);
- if (fb_defio && (info->fbdefio = NULL)) {
+ if (fb_defio && !info->fbdefio) {
/* enable defio at last moment if not disabled by client */
struct fb_deferred_io *fbdefio;
@@ -1556,8 +1556,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
}
/* If everything else has failed, fall back to safe default mode */
- if (default_vmode = NULL) {
-
+ if (!default_vmode) {
struct fb_videomode fb_vmode = {0};
/* Add the standard VESA modes to our modelist
@@ -1583,8 +1582,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
}
/* If we have good mode and no active clients */
- if ((default_vmode != NULL) && (dev->fb_count = 0)) {
-
+ if (default_vmode && dev->fb_count = 0) {
fb_videomode_to_var(&info->var, default_vmode);
ufx_var_color_format(&info->var);
@@ -1594,10 +1592,9 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
(info->var.bits_per_pixel / 8);
result = ufx_realloc_framebuffer(dev, info);
-
- } else
+ } else {
result = -EINVAL;
-
+ }
error:
if (edid && (dev->edid != edid))
kfree(edid);
--
2.15.0
next prev parent reply other threads:[~2017-11-25 20:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171125204312epcas2p149d6487ac83e886f95aefe0b35aef1b0@epcas2p1.samsung.com>
2017-11-25 20:42 ` [PATCH 0/5] video-SMSC UFX: Adjustments for five function implementations SF Markus Elfring
2017-11-25 20:44 ` [PATCH 1/5] video: smscufx: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-11-25 20:45 ` [PATCH 2/5] video: smscufx: Less checks in ufx_usb_probe() after error detection SF Markus Elfring
2017-11-26 7:38 ` [PATCH v2 " SF Markus Elfring
2017-11-25 20:46 ` [PATCH 3/5] video: smscufx: Return an error code only as a constant in ufx_realloc_framebuffer() SF Markus Elfring
2017-11-25 20:47 ` [PATCH 4/5] video: smscufx: Improve a size determination in two functions SF Markus Elfring
2017-11-25 20:50 ` SF Markus Elfring [this message]
2017-12-29 18:26 ` [PATCH 0/5] video-SMSC UFX: Adjustments for five function implementations Bartlomiej Zolnierkiewicz
2017-12-29 18:43 ` [0/5] " SF Markus Elfring
2018-01-07 16:00 ` [PATCH v3 0/3] video-SMSC UFX: Adjustments for two " SF Markus Elfring
2018-01-07 16:02 ` [PATCH v3 1/3] video: smscufx: Less checks in ufx_usb_probe() after error detection SF Markus Elfring
2018-03-28 13:46 ` Bartlomiej Zolnierkiewicz
2018-01-07 16:04 ` [PATCH v3 2/3] video: smscufx: Return an error code only as a constant in ufx_realloc_framebuffer() SF Markus Elfring
2018-03-28 13:48 ` [PATCH v3 2/3] video: smscufx: Return an error code only as a constant in ufx_realloc_framebuffe Bartlomiej Zolnierkiewicz
2018-01-07 16:06 ` [PATCH v3 3/3] video: smscufx: Delete an error message for a failed memory allocation in ufx_realloc SF Markus Elfring
2018-03-28 13:51 ` [PATCH v3 3/3] video: smscufx: Delete an error message for a failed memory allocation in ufx_rea Bartlomiej Zolnierkiewicz
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=0c4fc190-122a-6a46-2dcc-a17b4acd84b5@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=steve.glendinning@shawell.net \
/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;
as well as URLs for NNTP newsgroup(s).