summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci/atomisp2/css2400
Commit message (Collapse)AuthorAgeFilesLines
* media: atomisp: stop producing hundreds of kernel-doc warningsMauro Carvalho Chehab2017-11-30155-1718/+1718
| | | | | | | | | | | | | | | | | | | | | | A recent change on Kernel 4.15-rc1 causes all tags with /** to be handled as kernel-doc markups. Well, several atomisp modules, it doesn't use kernel-doc, but some other documentation markup (doxygen?). So, suppress all those warns by: - replacing /**< by /**. - replacing /** by /*. The core changes were done with: for i in $(find drivers/staging/media/atomisp -type f); do sed 's,/\*\* ,/\*, ' -i $i; done for i in $(find drivers/staging/media/atomisp -type f); do sed 's,/\*\*<,/\**,' -i $i; done for i in drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c; do perl -ne 's,\/\*\*$,/*,g; print $_' $i > a && mv a $i; done; A few manual adjustments were made, where needed. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
* Merge tag 'staging-4.15-rc1' into v4l_for_linusMauro Carvalho Chehab2017-11-141-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some conflicts between staging and media trees, as reported by Stephen Rothwell <sfr@canb.auug.org.au>. So, merge from staging. * tag 'staging-4.15-rc1': (775 commits) staging: lustre: add SPDX identifiers to all lustre files staging: greybus: Remove redundant license text staging: greybus: add SPDX identifiers to all greybus driver files staging: ccree: simplify ioread/iowrite staging: ccree: simplify registers access staging: ccree: simplify error handling logic staging: ccree: remove dead code staging: ccree: handle limiting of DMA masks staging: ccree: copy IV to DMAable memory staging: fbtft: remove redundant initialization of buf staging: sm750fb: Fix parameter mistake in poke32 staging: wilc1000: Fix bssid buffer offset in Txq staging: fbtft: fb_ssd1331: fix mirrored display staging: android: Fix checkpatch.pl error staging: greybus: loopback: convert loopback to use generic async operations staging: greybus: operation: add private data with get/set accessors staging: greybus: loopback: Fix iteration count on async path staging: greybus: loopback: Hold per-connection mutex across operations staging: greybus/loopback: use ktime_get() for time intervals staging: fsl-dpaa2/eth: Extra headroom in RX buffers ... Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * atomisp2: remove cast from memory allocationAishwarya Pant2017-09-291-2/+2
| | | | | | | | | | | | | | | | | | Patch removes the following warning issued was coccicheck: WARNING: casting value returned by memory allocation function to (char *) is useless. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | media: atomisp: get rid of storage_class.hMauro Carvalho Chehab2017-11-0160-314/+230Star
| | | | | | | | | | | | | | Don't hide function declaration on ugly macros. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* | media: atomisp: get rid of wrong stddef.h includeMauro Carvalho Chehab2017-11-013-45/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | The places at atomisp.h that use stddef.h are wrong: the types it needs are actually defined at linux/types.h. Also, it causes lots of smatch warnings due to the redefinition of ofsetof() macro: /opt/gcc-7.1.0/x86/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include/stddef.h:417:9: warning: preprocessor token offsetof redefined ./include/linux/stddef.h:16:9: this was the original definition Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* | media: atomisp: fix other inconsistent identingMauro Carvalho Chehab2017-11-014-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by smatch: drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c:607 pipeline_stage_create() warn: inconsistent indenting drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:255 ov2680_write_reg_array() warn: inconsistent indenting drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:401 __ov2680_set_exposure() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4269 sh_css_params_write_to_ddr_internal() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:1008 atomisp_register_entities() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c:1709 ia_css_binary_find() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* | media: atomisp: fix switch coding style at input_system.cMauro Carvalho Chehab2017-11-011-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a switch at input_system.c that were causing smatch warnings: drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:610 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:616 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:622 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:610 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:616 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:622 rx_channel_get_state() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* | media: atomisp: fix spatch warnings at sh_css.cMauro Carvalho Chehab2017-11-011-45/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:5801:1: error: directive in argument list drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:5803:1: error: directive in argument list drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:3795 create_host_acc_pipeline() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:4343 ia_css_pipe_enqueue_buffer() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:6029 sh_css_pipe_configure_viewfinder() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:8693 ia_css_stream_capture() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:9781 ia_css_stream_create() warn: if statement not indented drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:9988 ia_css_stream_load() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:10525 ia_css_update_continuous_frames() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* | media: atomisp: fix ident for assert/returnMauro Carvalho Chehab2017-11-0118-150/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On lots of places, assert/return are starting at the first column, causing indentation issues, as complained by spatch: drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/irq_private.h:32 irq_reg_store() warn: inconsistent indenting Used this small script to fix such occurrences: for i in $(git grep -l -E "^(assert|return)" drivers/staging/media/); do perl -ne 's/^(assert|return)\b/\t$1/; print $_' <$i >a && mv a $i; done Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* | media: staging: atomisp: cleanup out of memory messagesAishwarya Pant2017-10-311-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging of explicit out of memory messages is redundant since memory allocation failures produce a backtrace. Done with the help of the following cocci script: @@ expression ex, ret; statement s; constant char[] c; constant err; identifier f, l; @@ ex = \(kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...) ... when != ex if ( ( !ex | unlikely(!ex) ) ) - { - f(..., c, ...); ( return ex; | return; | return err; | goto l; ) - } else s Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: Staging: media: atomisp: pci: Eliminate use of typedefs for structSrishti Sharma2017-10-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of typedefs for struct is discouraged, and hence can be eliminated. Done using the following semantic patch by coccinelle. @r1@ type T; @@ typedef struct {...} T; @script: python p@ T << r1.T; T1; @@ if T[-2:] == "_t" or T[-2:] == "_T": coccinelle.T1 = T[:-2] else: coccinelle.T1 = T print T, T1 @r2@ type r1.T; identifier p.T1; @@ - typedef struct + T1 { ... } - T Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp2: cleanup null check on memory allocationAishwarya Pant2017-10-273-23/+22Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For memory allocation functions that fail with a NULL return value, it is preferred to use the (!x) test in place of (x == NULL). Changes in atomisp2/css2400/sh_css.c were done by hand. Done with the help of the following cocci script: @@ type T; T* p; statement s,s1; @@ p = \(devm_kzalloc\|devm_ioremap\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\| kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...) ...when != p if ( - p == NULL + !p ) s else s1 -- Changes in v3: Rebase changes over atomisp-next branch of the media tree Changes in atomisp2/css2400/sh_css.c were done by hand, the above script was not able to match the pattern if (a->b != null). Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | media: staging: atomisp: use ARRAY_SIZEJérémy Lefaure2017-10-271-6/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the ARRAY_SIZE macro improves the readability of the code. Also, it is useless to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | media: Staging: media: atomisp: Use kcalloc instead of kzallocSrishti Sharma2017-09-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Use kcalloc instead of kzalloc to check for an overflow before multiplication. Done using the following semantic patch by coccinelle. http://coccinelle.lip6.fr/rules/kzalloc.cocci Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: atomisp:use ARRAY_SIZE() instead of open codingAllen Pais2017-09-231-4/+2Star
| | | | | | | | | | | | | | | | | | The array_length() macro just duplicates ARRAY_SIZE(), so we can delete it. Signed-off-by: Allen Pais <allen.lkml@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: Staging: atomisp: fix alloc_cast.cocci warningsBranislav Radocaj2017-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove casting the values returned by memory allocation functions like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc. Semantic patch information: This makes an effort to find cases of casting of values returned by kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc, kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes the casting as it is not required. The result in the patch case may need some reformatting. Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci Signed-off-by: Branislav Radocaj <branislav@radocaj.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging/atomisp: Use ARRAY_SIZE macroThomas Meyer2017-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use ARRAY_SIZE macro, rather than explicitly coding some variant of it yourself. Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e 's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\) /ARRAY_SIZE(\1)/g' and manual check/verification. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging/atomisp: fix header guardsNicolas Iooss2017-09-233-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files input_formatter_subsystem_defs.h begin with: #ifndef _if_subsystem_defs_h #define _if_subsystem_defs_h__ and end with: #endif /* _if_subsystem_defs_h__ */ The intent seems to have been to use _if_subsystem_defs_h__ everywhere but two underscores are missing in the initial #ifndef. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: atomisp2: Remove null check before kfreeHimanshu Jha2017-09-231-4/+2Star
|/ | | | | | | | Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: sh_css_calloc shall return a pointer to the ↵Sergei A. Trusov2017-09-051-0/+1
| | | | | | | | | | | | allocated space The calloc function returns either a null pointer or a pointer to the allocated space. Add the second case that is missed. Fixes: da22013f7df4 ("atomisp: remove indirection from sh_css_malloc") Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: fixed trivial coding style issueShy More2017-07-191-2/+1Star
| | | | | | | | | Below was the trival error flagged by checkpatch.pl: ERROR: space prohibited after that open parenthesis '(' Signed-off-by: Shy More <smklearn@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: fixed trivial coding style warningShy More2017-07-191-12/+12
| | | | | | | | | Below was the trivial wanrning flagged by checkpatch.pl WARNING: Block comments use * on subsequent lines Signed-off-by: Shy More <smklearn@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: use kstrdup to replace kmalloc and memcpyHari Prasath2017-07-191-6/+2Star
| | | | | | | | | kstrdup kernel primitive can be used to replace kmalloc followed by string copy. This was reported by coccinelle tool. Signed-off-by: Hari Prasath <gehariprasath@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] staging: css2400/Makefile: don't include non-existing filesMauro Carvalho Chehab2017-06-081-2/+0Star
| | | | | | | | | | | | The atomisp css2400/Makefile includes a Makefile.common: include $(srctree)/$(src)/../Makefile.common Well, this file doesn't exist at the Kernel tree :-) So, don't include it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: de-duplicate sh_css_mmu_set_page_table_base_indexAlan Cox2017-06-073-31/+1Star
| | | | | | | | | | Between the ISP2400 and ISP2401 code base this function moved file. The merge of the drivers left us with two version in ifdefs. Resolve this down to a single copy. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: remove sh_css_irq - it contains nothingAlan Cox2017-06-071-16/+0Star
| | | | | | | | We won't be adding abstractions or moving them here so kill it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: Unify lut free logicAlan Cox2017-06-072-21/+0Star
| | | | | | | | | ISP2401 introduced a helper for this which we can use just as well on the ISP2400 and remove some more noise differences. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: Unify load_preview_binaries for the most partAlan Cox2017-06-071-39/+1Star
| | | | | | | | | | ISP2401 introduced a rather sensible change to cut through the structure spaghetti. Adopt that for the ISP2400 as well. It makes no difference to the actual code other than readability. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: unify sh_css_hmm_buffer_record_acquireAlan Cox2017-06-071-37/+3Star
| | | | | | | | | | The ISP2401 version of this function returns a pointer to the buffer, whilst the ISP2400 version returns a boolean if a slot is found. We can trivially unify the code to use the ISP2401 version. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: eliminate dead code under HAS_RES_MGRAlan Cox2017-06-074-103/+0Star
| | | | | | | | | This define is never set and these code paths are never used so they can go away. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp2: tidy up confused ifdefsAlan Cox2017-06-071-21/+5Star
| | | | | | | | | The two drivers were machine merged and in this case the machine output was to say the least not optimal. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp2: remove HRT_UNSCHEDAlan Cox2017-06-074-27/+3Star
| | | | | | | | | HRT_UNSCHED is never defined or set in the driver, so this is dead code that can be retired, simplifying the code a bit further. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: remove NUM_OF_BLSAlan Cox2017-06-071-5/+5
| | | | | | | | | With the removal of the HAS_BL bootloader code the value of NUM_OF_BLS is an invariant zero. So let's get rid of it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atompisp: HAS_BL is never defined so lose itAlan Cox2017-06-073-126/+1Star
| | | | | | | | | Kill off the HAS_BL define and the code and includes it brackets. We never define HAS_BL or use that functionality. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: use NULL instead of 0 for pointersPaolo Cretaro2017-06-072-2/+2
| | | | | | | | Fix warning issued by sparse: Using plain integer as NULL pointer Signed-off-by: Paolo Cretaro <melko@frugalware.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: putting NULs in the wrong placeDan Carpenter2017-05-191-2/+2
| | | | | | | | | | | | | We're putting the NUL terminators one space beyond where they belong. This doesn't show up in testing because all but the callers put a NUL in the correct place themselves. LOL. It causes a static checker warning about buffer overflows. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: one char read beyond end of stringDan Carpenter2017-05-191-3/+2Star
| | | | | | | | | | | | We should verify that "ix < max_len" before we test whether we have reached the NUL terminator. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: Fix -Werror=int-in-bool-context compile errorsHans de Goede2017-05-191-3/+3
| | | | | | | | | | | | | | | | | | With gcc-7.1.1 I was getting the following compile error: error: ‘*’ in boolean context, suggest ‘&&’ instead The problem is the definition of CEIL_DIV: #define CEIL_DIV(a, b) ((b) ? ((a) + (b) - 1) / (b) : 0) Which when called as: CEIL_DIV(x, y * z) triggers this error, note we cannot do as the error suggests since b is evaluated multiple times. This commit fixes these compile errors. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: use logical AND, not bitwiseGuru Das Srinagesh2017-05-191-1/+1
| | | | | | | | Fixes sparse warning "dubious: x & !y" in logical expression. Signed-off-by: Guru Das Srinagesh <gurooodas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: Add __printf validation and fix falloutJoe Perches2017-05-198-23/+25
| | | | | | | | | | __printf validation adds format and argument validation. Fix the various broken format/argument mismatches. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* atomisp: remove hmm_load/store/clear indirectionsAlan Cox2017-04-281-7/+8
| | | | | | | | We have a layer of un-needed wrapping here that can go. In addition there are some functions that don't exist and one that isn't used which can also go. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: kill off mmgr_freeAlan Cox2017-04-2812-39/+27Star
| | | | | | | | This is just another wrapper layer around hmm_free that servers no purpose in this driver. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: clean up the hmm init/cleanup indirectionsAlan Cox2017-04-281-1/+1
| | | | | | | | | | | We don't need any of these indirections as we only support one MMU type. Start by getting rid of the init/clear/free ones. The init ordering check we already pushed down in a previous patch. The allocation side is more complicated so leave it for now. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove UDS kernel codeAlan Cox2017-04-147-85/+23Star
| | | | | | | | UDS is another layer which actually boils down to some trivial assignments so remove it so inline the code. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove xnr3_0_5 and xnr3_0_11Alan Cox2017-04-148-592/+0Star
| | | | | | | These are not used in the driver so can go away. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove fixedbds kernel codeAlan Cox2017-04-146-100/+19Star
| | | | | | | | | This is a whole pile of code that wraps a single assignment. Remove it and put the assignment in the caller. Once we have the kernels sorted we should revisit these and remove all the pointless 1 item structs that go with it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove satm kernelAlan Cox2017-04-144-121/+0Star
| | | | | | | This isn't used so it can go in the bitbucket. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove contiguous handlingAlan Cox2017-04-141-22/+9Star
| | | | | | | | | | | The base hmm MMU code doesn't support contiguous allocations (they BUG), so remove support from them from the higher levels of the heirarchy. We still need to unwind all these layers but it turns out that some of the init order stuff is rather sensitive and the simple cleanup breaks everything Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove sh_css_malloc indirections where we canAlan Cox2017-04-144-65/+72
| | | | | | | | Where we know the buffer size is reasonably constrained we can just use kmalloc, and where it will be large vmalloc. This still leaves a pile in the middle. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* atomisp: remove indirection from sh_css_mallocAlan Cox2017-04-142-46/+25Star
| | | | | | | | | We have one hard coded set of behaviour so unpick the indirection and function pointers. This isn't the whole story. A lot of the callers are known sizes and use cases so we can switch them directly to kmalloc later on. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>