Skip to content

Commit

Permalink
drm/sti: Adjust two checks for null pointers in sti_hqvdp_probe()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/918229e6-80fe-629f-8fec-bf60ac15275f@users.sourceforge.net
  • Loading branch information
Markus Elfring authored and Benjamin Gaignard committed May 9, 2017
1 parent bc435de commit da98d2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/sti/sti_hqvdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,12 +1356,12 @@ static int sti_hqvdp_probe(struct platform_device *pdev)

/* Get Memory resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
if (!res) {
DRM_ERROR("Get memory resource failed\n");
return -ENXIO;
}
hqvdp->regs = devm_ioremap(dev, res->start, resource_size(res));
if (hqvdp->regs == NULL) {
if (!hqvdp->regs) {
DRM_ERROR("Register mapping failed\n");
return -ENXIO;
}
Expand Down

0 comments on commit da98d2e

Please sign in to comment.