Fix error code to correct pointer type
Joe Korty [Wed, 25 May 2016 12:10:46 +0000 (17:10 +0530)]
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 5707468..2689ac7 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);