aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-mfc/s5p_mfc_opr.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-05-10 02:32:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 08:03:02 -0400
commit1259762facdcf31ea362997d9682ccc3d93d7346 (patch)
tree7e548420ef699fd3363c62fa91329175b9dd4a34 /drivers/media/video/s5p-mfc/s5p_mfc_opr.c
parente6364a987413b9e5413b48e9d31ecdd2b02bb28b (diff)
[media] s5p-mfc: Fix NULL pointer warnings
Fixes the following type of warnings detected by sparse: warning: Using plain integer as NULL pointer. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-mfc/s5p_mfc_opr.c')
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_opr.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_opr.c b/drivers/media/video/s5p-mfc/s5p_mfc_opr.c
index e08b21c50ebf..a8028297fc70 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_opr.c
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_opr.c
@@ -43,7 +43,7 @@ int s5p_mfc_alloc_dec_temp_buffers(struct s5p_mfc_ctx *ctx)
43 ctx->desc_buf = vb2_dma_contig_memops.alloc( 43 ctx->desc_buf = vb2_dma_contig_memops.alloc(
44 dev->alloc_ctx[MFC_BANK1_ALLOC_CTX], DESC_BUF_SIZE); 44 dev->alloc_ctx[MFC_BANK1_ALLOC_CTX], DESC_BUF_SIZE);
45 if (IS_ERR_VALUE((int)ctx->desc_buf)) { 45 if (IS_ERR_VALUE((int)ctx->desc_buf)) {
46 ctx->desc_buf = 0; 46 ctx->desc_buf = NULL;
47 mfc_err("Allocating DESC buffer failed\n"); 47 mfc_err("Allocating DESC buffer failed\n");
48 return -ENOMEM; 48 return -ENOMEM;
49 } 49 }
@@ -54,7 +54,7 @@ int s5p_mfc_alloc_dec_temp_buffers(struct s5p_mfc_ctx *ctx)
54 if (desc_virt == NULL) { 54 if (desc_virt == NULL) {
55 vb2_dma_contig_memops.put(ctx->desc_buf); 55 vb2_dma_contig_memops.put(ctx->desc_buf);
56 ctx->desc_phys = 0; 56 ctx->desc_phys = 0;
57 ctx->desc_buf = 0; 57 ctx->desc_buf = NULL;
58 mfc_err("Remapping DESC buffer failed\n"); 58 mfc_err("Remapping DESC buffer failed\n");
59 return -ENOMEM; 59 return -ENOMEM;
60 } 60 }
@@ -69,7 +69,7 @@ void s5p_mfc_release_dec_desc_buffer(struct s5p_mfc_ctx *ctx)
69 if (ctx->desc_phys) { 69 if (ctx->desc_phys) {
70 vb2_dma_contig_memops.put(ctx->desc_buf); 70 vb2_dma_contig_memops.put(ctx->desc_buf);
71 ctx->desc_phys = 0; 71 ctx->desc_phys = 0;
72 ctx->desc_buf = 0; 72 ctx->desc_buf = NULL;
73 } 73 }
74} 74}
75 75
@@ -186,7 +186,7 @@ int s5p_mfc_alloc_codec_buffers(struct s5p_mfc_ctx *ctx)
186 ctx->bank1_buf = vb2_dma_contig_memops.alloc( 186 ctx->bank1_buf = vb2_dma_contig_memops.alloc(
187 dev->alloc_ctx[MFC_BANK1_ALLOC_CTX], ctx->bank1_size); 187 dev->alloc_ctx[MFC_BANK1_ALLOC_CTX], ctx->bank1_size);
188 if (IS_ERR(ctx->bank1_buf)) { 188 if (IS_ERR(ctx->bank1_buf)) {
189 ctx->bank1_buf = 0; 189 ctx->bank1_buf = NULL;
190 printk(KERN_ERR 190 printk(KERN_ERR
191 "Buf alloc for decoding failed (port A)\n"); 191 "Buf alloc for decoding failed (port A)\n");
192 return -ENOMEM; 192 return -ENOMEM;
@@ -200,7 +200,7 @@ int s5p_mfc_alloc_codec_buffers(struct s5p_mfc_ctx *ctx)
200 ctx->bank2_buf = vb2_dma_contig_memops.alloc( 200 ctx->bank2_buf = vb2_dma_contig_memops.alloc(
201 dev->alloc_ctx[MFC_BANK2_ALLOC_CTX], ctx->bank2_size); 201 dev->alloc_ctx[MFC_BANK2_ALLOC_CTX], ctx->bank2_size);
202 if (IS_ERR(ctx->bank2_buf)) { 202 if (IS_ERR(ctx->bank2_buf)) {
203 ctx->bank2_buf = 0; 203 ctx->bank2_buf = NULL;
204 mfc_err("Buf alloc for decoding failed (port B)\n"); 204 mfc_err("Buf alloc for decoding failed (port B)\n");
205 return -ENOMEM; 205 return -ENOMEM;
206 } 206 }
@@ -216,13 +216,13 @@ void s5p_mfc_release_codec_buffers(struct s5p_mfc_ctx *ctx)
216{ 216{
217 if (ctx->bank1_buf) { 217 if (ctx->bank1_buf) {
218 vb2_dma_contig_memops.put(ctx->bank1_buf); 218 vb2_dma_contig_memops.put(ctx->bank1_buf);
219 ctx->bank1_buf = 0; 219 ctx->bank1_buf = NULL;
220 ctx->bank1_phys = 0; 220 ctx->bank1_phys = 0;
221 ctx->bank1_size = 0; 221 ctx->bank1_size = 0;
222 } 222 }
223 if (ctx->bank2_buf) { 223 if (ctx->bank2_buf) {
224 vb2_dma_contig_memops.put(ctx->bank2_buf); 224 vb2_dma_contig_memops.put(ctx->bank2_buf);
225 ctx->bank2_buf = 0; 225 ctx->bank2_buf = NULL;
226 ctx->bank2_phys = 0; 226 ctx->bank2_phys = 0;
227 ctx->bank2_size = 0; 227 ctx->bank2_size = 0;
228 } 228 }
@@ -244,7 +244,7 @@ int s5p_mfc_alloc_instance_buffer(struct s5p_mfc_ctx *ctx)
244 if (IS_ERR(ctx->ctx_buf)) { 244 if (IS_ERR(ctx->ctx_buf)) {
245 mfc_err("Allocating context buffer failed\n"); 245 mfc_err("Allocating context buffer failed\n");
246 ctx->ctx_phys = 0; 246 ctx->ctx_phys = 0;
247 ctx->ctx_buf = 0; 247 ctx->ctx_buf = NULL;
248 return -ENOMEM; 248 return -ENOMEM;
249 } 249 }
250 ctx->ctx_phys = s5p_mfc_mem_cookie( 250 ctx->ctx_phys = s5p_mfc_mem_cookie(
@@ -256,7 +256,7 @@ int s5p_mfc_alloc_instance_buffer(struct s5p_mfc_ctx *ctx)
256 mfc_err("Remapping instance buffer failed\n"); 256 mfc_err("Remapping instance buffer failed\n");
257 vb2_dma_contig_memops.put(ctx->ctx_buf); 257 vb2_dma_contig_memops.put(ctx->ctx_buf);
258 ctx->ctx_phys = 0; 258 ctx->ctx_phys = 0;
259 ctx->ctx_buf = 0; 259 ctx->ctx_buf = NULL;
260 return -ENOMEM; 260 return -ENOMEM;
261 } 261 }
262 /* Zero content of the allocated memory */ 262 /* Zero content of the allocated memory */
@@ -265,7 +265,7 @@ int s5p_mfc_alloc_instance_buffer(struct s5p_mfc_ctx *ctx)
265 if (s5p_mfc_init_shm(ctx) < 0) { 265 if (s5p_mfc_init_shm(ctx) < 0) {
266 vb2_dma_contig_memops.put(ctx->ctx_buf); 266 vb2_dma_contig_memops.put(ctx->ctx_buf);
267 ctx->ctx_phys = 0; 267 ctx->ctx_phys = 0;
268 ctx->ctx_buf = 0; 268 ctx->ctx_buf = NULL;
269 return -ENOMEM; 269 return -ENOMEM;
270 } 270 }
271 return 0; 271 return 0;
@@ -277,12 +277,12 @@ void s5p_mfc_release_instance_buffer(struct s5p_mfc_ctx *ctx)
277 if (ctx->ctx_buf) { 277 if (ctx->ctx_buf) {
278 vb2_dma_contig_memops.put(ctx->ctx_buf); 278 vb2_dma_contig_memops.put(ctx->ctx_buf);
279 ctx->ctx_phys = 0; 279 ctx->ctx_phys = 0;
280 ctx->ctx_buf = 0; 280 ctx->ctx_buf = NULL;
281 } 281 }
282 if (ctx->shm_alloc) { 282 if (ctx->shm_alloc) {
283 vb2_dma_contig_memops.put(ctx->shm_alloc); 283 vb2_dma_contig_memops.put(ctx->shm_alloc);
284 ctx->shm_alloc = 0; 284 ctx->shm_alloc = NULL;
285 ctx->shm = 0; 285 ctx->shm = NULL;
286 } 286 }
287} 287}
288 288