aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc.c10
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c16
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_opr.c26
3 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc.c b/drivers/media/video/s5p-mfc/s5p_mfc.c
index 76008549b3f1..9b7fe3375877 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/video/s5p-mfc/s5p_mfc.c
@@ -373,7 +373,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_ctx *ctx,
373 373
374 /* If no context is available then all necessary 374 /* If no context is available then all necessary
375 * processing has been done. */ 375 * processing has been done. */
376 if (ctx == 0) 376 if (ctx == NULL)
377 return; 377 return;
378 378
379 dev = ctx->dev; 379 dev = ctx->dev;
@@ -429,7 +429,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx,
429 struct s5p_mfc_dev *dev; 429 struct s5p_mfc_dev *dev;
430 unsigned int guard_width, guard_height; 430 unsigned int guard_width, guard_height;
431 431
432 if (ctx == 0) 432 if (ctx == NULL)
433 return; 433 return;
434 dev = ctx->dev; 434 dev = ctx->dev;
435 if (ctx->c_ops->post_seq_start) { 435 if (ctx->c_ops->post_seq_start) {
@@ -496,7 +496,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx,
496 struct s5p_mfc_dev *dev; 496 struct s5p_mfc_dev *dev;
497 unsigned long flags; 497 unsigned long flags;
498 498
499 if (ctx == 0) 499 if (ctx == NULL)
500 return; 500 return;
501 dev = ctx->dev; 501 dev = ctx->dev;
502 s5p_mfc_clear_int_flags(dev); 502 s5p_mfc_clear_int_flags(dev);
@@ -772,7 +772,7 @@ err_queue_init:
772err_init_hw: 772err_init_hw:
773 s5p_mfc_release_firmware(dev); 773 s5p_mfc_release_firmware(dev);
774err_alloc_fw: 774err_alloc_fw:
775 dev->ctx[ctx->num] = 0; 775 dev->ctx[ctx->num] = NULL;
776 del_timer_sync(&dev->watchdog_timer); 776 del_timer_sync(&dev->watchdog_timer);
777 s5p_mfc_clock_off(); 777 s5p_mfc_clock_off();
778err_pwr_enable: 778err_pwr_enable:
@@ -849,7 +849,7 @@ static int s5p_mfc_release(struct file *file)
849 } 849 }
850 mfc_debug(2, "Shutting down clock\n"); 850 mfc_debug(2, "Shutting down clock\n");
851 s5p_mfc_clock_off(); 851 s5p_mfc_clock_off();
852 dev->ctx[ctx->num] = 0; 852 dev->ctx[ctx->num] = NULL;
853 s5p_mfc_dec_ctrls_delete(ctx); 853 s5p_mfc_dec_ctrls_delete(ctx);
854 v4l2_fh_del(&ctx->fh); 854 v4l2_fh_del(&ctx->fh);
855 v4l2_fh_exit(&ctx->fh); 855 v4l2_fh_exit(&ctx->fh);
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
index f2481a85e0a2..08a5cfeaa59e 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
@@ -52,7 +52,7 @@ int s5p_mfc_alloc_and_load_firmware(struct s5p_mfc_dev *dev)
52 s5p_mfc_bitproc_buf = vb2_dma_contig_memops.alloc( 52 s5p_mfc_bitproc_buf = vb2_dma_contig_memops.alloc(
53 dev->alloc_ctx[MFC_BANK1_ALLOC_CTX], dev->fw_size); 53 dev->alloc_ctx[MFC_BANK1_ALLOC_CTX], dev->fw_size);
54 if (IS_ERR(s5p_mfc_bitproc_buf)) { 54 if (IS_ERR(s5p_mfc_bitproc_buf)) {
55 s5p_mfc_bitproc_buf = 0; 55 s5p_mfc_bitproc_buf = NULL;
56 mfc_err("Allocating bitprocessor buffer failed\n"); 56 mfc_err("Allocating bitprocessor buffer failed\n");
57 release_firmware(fw_blob); 57 release_firmware(fw_blob);
58 return -ENOMEM; 58 return -ENOMEM;
@@ -63,7 +63,7 @@ int s5p_mfc_alloc_and_load_firmware(struct s5p_mfc_dev *dev)
63 mfc_err("The base memory for bank 1 is not aligned to 128KB\n"); 63 mfc_err("The base memory for bank 1 is not aligned to 128KB\n");
64 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf); 64 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf);
65 s5p_mfc_bitproc_phys = 0; 65 s5p_mfc_bitproc_phys = 0;
66 s5p_mfc_bitproc_buf = 0; 66 s5p_mfc_bitproc_buf = NULL;
67 release_firmware(fw_blob); 67 release_firmware(fw_blob);
68 return -EIO; 68 return -EIO;
69 } 69 }
@@ -72,7 +72,7 @@ int s5p_mfc_alloc_and_load_firmware(struct s5p_mfc_dev *dev)
72 mfc_err("Bitprocessor memory remap failed\n"); 72 mfc_err("Bitprocessor memory remap failed\n");
73 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf); 73 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf);
74 s5p_mfc_bitproc_phys = 0; 74 s5p_mfc_bitproc_phys = 0;
75 s5p_mfc_bitproc_buf = 0; 75 s5p_mfc_bitproc_buf = NULL;
76 release_firmware(fw_blob); 76 release_firmware(fw_blob);
77 return -EIO; 77 return -EIO;
78 } 78 }
@@ -82,7 +82,7 @@ int s5p_mfc_alloc_and_load_firmware(struct s5p_mfc_dev *dev)
82 if (IS_ERR(b_base)) { 82 if (IS_ERR(b_base)) {
83 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf); 83 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf);
84 s5p_mfc_bitproc_phys = 0; 84 s5p_mfc_bitproc_phys = 0;
85 s5p_mfc_bitproc_buf = 0; 85 s5p_mfc_bitproc_buf = NULL;
86 mfc_err("Allocating bank2 base failed\n"); 86 mfc_err("Allocating bank2 base failed\n");
87 release_firmware(fw_blob); 87 release_firmware(fw_blob);
88 return -ENOMEM; 88 return -ENOMEM;
@@ -94,7 +94,7 @@ int s5p_mfc_alloc_and_load_firmware(struct s5p_mfc_dev *dev)
94 mfc_err("The base memory for bank 2 is not aligned to 128KB\n"); 94 mfc_err("The base memory for bank 2 is not aligned to 128KB\n");
95 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf); 95 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf);
96 s5p_mfc_bitproc_phys = 0; 96 s5p_mfc_bitproc_phys = 0;
97 s5p_mfc_bitproc_buf = 0; 97 s5p_mfc_bitproc_buf = NULL;
98 release_firmware(fw_blob); 98 release_firmware(fw_blob);
99 return -EIO; 99 return -EIO;
100 } 100 }
@@ -126,7 +126,7 @@ int s5p_mfc_reload_firmware(struct s5p_mfc_dev *dev)
126 release_firmware(fw_blob); 126 release_firmware(fw_blob);
127 return -ENOMEM; 127 return -ENOMEM;
128 } 128 }
129 if (s5p_mfc_bitproc_buf == 0 || s5p_mfc_bitproc_phys == 0) { 129 if (s5p_mfc_bitproc_buf == NULL || s5p_mfc_bitproc_phys == 0) {
130 mfc_err("MFC firmware is not allocated or was not mapped correctly\n"); 130 mfc_err("MFC firmware is not allocated or was not mapped correctly\n");
131 release_firmware(fw_blob); 131 release_firmware(fw_blob);
132 return -EINVAL; 132 return -EINVAL;
@@ -146,9 +146,9 @@ int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev)
146 if (!s5p_mfc_bitproc_buf) 146 if (!s5p_mfc_bitproc_buf)
147 return -EINVAL; 147 return -EINVAL;
148 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf); 148 vb2_dma_contig_memops.put(s5p_mfc_bitproc_buf);
149 s5p_mfc_bitproc_virt = 0; 149 s5p_mfc_bitproc_virt = NULL;
150 s5p_mfc_bitproc_phys = 0; 150 s5p_mfc_bitproc_phys = 0;
151 s5p_mfc_bitproc_buf = 0; 151 s5p_mfc_bitproc_buf = NULL;
152 return 0; 152 return 0;
153} 153}
154 154
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