]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
Fix error code to correct pointer type
authorJoe Korty <joe.korty@ccur.com>
Wed, 25 May 2016 12:10:46 +0000 (17:40 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 29 Jul 2016 14:30:25 +0000 (07:30 -0700)
To return an errno code inside a pointer,
the error code must first be converted to
the correct pointer type.

drivers/media/v4l2-core/v4l2-of.c:
In function 'v4l2_of_alloc_parse_endpoint':
drivers/media/v4l2-core/v4l2-of.c:227:10: warning:
return makes pointer from integer without
a cast [-Wint-conversion]
return -ENOMEM;

drivers/media/v4l2-core/v4l2-of.c:254:9: warning:
return makes pointer from integer without
a cast [-Wint-conversion]
return rval;

Bug 200187768

Change-Id: I757fe1f51559a0d0cda7463fd5541fac20e3a92e
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1163930
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
drivers/media/v4l2-core/v4l2-of.c

index 570746853b4923a895df04a1b7d0d546b52e2305..2689ac75e534b7ea16a10b953672c710cdd9772a 100644 (file)
@@ -224,7 +224,7 @@ struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
 
        endpoint = kzalloc(sizeof(*endpoint), GFP_KERNEL);
        if (!endpoint)
-               return -ENOMEM;
+               return (struct v4l2_of_endpoint *)(long)-ENOMEM;
 
        rval = v4l2_of_parse_endpoint(node, endpoint);
        if (rval < 0)
@@ -251,7 +251,7 @@ struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
 
 out_err:
        v4l2_of_free_endpoint(endpoint);
-       return rval;
+       return (struct v4l2_of_endpoint *)(long)rval;
 }
 EXPORT_SYMBOL(v4l2_of_alloc_parse_endpoint);