aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-06-06staging: vchiq_arm: remove global 'vchiq_states' arrayAdrien Thierry1-2/+0
Remove global 'vchiq_states' array, which is not used anymore. This is part of an effort to address TODO item "Get rid of all non essential global structures and create a proper per device structure" Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-10-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06staging: vchiq_arm: use state from vchiq instanceAdrien Thierry1-11/+1
In 'handle_to_service', access the vchiq state from the vchiq instance instead of the global 'vchiq_states' array. This will allow getting rid of the global 'vchiq_states' array. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-9-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06staging: vchiq_arm: pass vchiq instance to 'handle_to_service'Adrien Thierry1-1/+1
In order to remove the 'vchiq_states' global array, we need to pass the vchiq_instance reference to the 'handle_to_service' function. This will allow accessing the vchiq state through the vchiq instance instead of through the global array. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-8-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06staging: vchiq_arm: pass vchiq instance to 'vchiq_get_client_id'Adrien Thierry1-1/+1
In order to remove the 'vchiq_states' global array, we need to pass the vchiq_instance reference to the 'handle_to_service' function, as well as to all functions that call 'handle_to_service'. This will allow accessing the vchiq state through the vchiq instance instead of through the global array. 'handle_to_service' is called by 'vchiq_get_client_id'. Therefore, pass the vchiq instance reference to it. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-6-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06staging: vchiq_arm: pass vchiq instance to 'find_service_by_handle'Adrien Thierry1-4/+5
In order to remove the 'vchiq_states' global array, we need to pass the vchiq_instance reference to the 'handle_to_service' function, as well as to all functions that call 'handle_to_service'. This will allow accessing the vchiq state through the vchiq instance instead of through the global array. 'handle_to_service' is called by 'find_service_by_handle'. Therefore, pass the vchiq instance reference to 'find_service_by_handle' and to its callers. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-5-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06staging: vchiq_arm: get rid of global device structureAdrien Thierry1-5/+5
Get rid of the global g_dev structure. This is part of an effort to address TODO item "Get rid of all non essential global structures and create a proper per device structure" I chose to pass the vchiq_instance around instead of the device reference because in order to get rid of the 'vchiq_states' global array in the future, we will need another way to access the vchiq_state in the 'handle_to_service' function. Therefore, we will need to pass the vchiq_instance to it (or the vchiq_state), and also pass it to functions higher up in the caller chain, such as 'vchiq_bulk_transmit' and friends which are used in the bcm2835-audio consumer. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-3-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06staging: vchiq_arm: add reference to vchiq device in vchiq_stateAdrien Thierry1-1/+2
Add a reference to the vchiq device in the vchiq_state structure. This allows the device structure to be passed around, which will be useful in order to get rid of the global g_dev structure. This change will also make it possible to use standard kernel logging macros instead of the custom ones. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-2-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-19staging: vc04_services: remove unused macroGaston Gonzalez1-1/+0
BITSET_CLR is not used. Remove the define. Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20220516221741.1015814-1-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-25staging: vchiq_core: fix type of parameter localportStefan Wahren1-1/+1
The whole vchiq driver uses unsigned int for "localport" except of find_service_by_port(). So fix this and get the rid of this suspicous cast. Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1642968143-19281-8-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-25staging: vchiq_core: remove superfluous static_assert statementGaston Gonzalez1-2/+0
After removing the BITSET_T typedef in commit d8a364820e01 ("staging: vchiq_core: get rid of typedef") the static_assert statement becomes superfluous as now we are checking if the size of the u32 type is 4 bytes. Hence, just remove the static_assert statement. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211122130926.342128-1-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-30staging: vchiq_core: get rid of typedefGaston Gonzalez1-3/+1
The typedef BITSET_T is acting as a synonym of u32. However, using the type u32 directly makes the code more readable. Furthermore, typedef should only be used in some cases, [1]. Hence, get rid of it. [1] Documentation/process/coding-style.rst Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211029200012.45986-1-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: vchiq_core: drop extern prefix in function declarationsGaston Gonzalez1-51/+25
Remove unnecessary extern prefix in function declarations. While at it, remove a now outdated comment and realign the function declarations in order to improve readability. Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211024212524.370078-7-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: vchiq: drop trailing semicolon in macro definitionGaston Gonzalez1-1/+1
As reported by checkpatch.pl, macro definitions should not use a trailing semicolon. Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211024212524.370078-6-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: vchiq_core.h: use preferred kernel typesGaston Gonzalez1-6/+6
Change types from uint32_t and uint64_t to the preferred ones u32 and u64. Reported by checkpatch.pl, with the exception of the one in function vchiq_log_dump_mem(). Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211024212524.370078-5-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: vchiq_core.h: fix CamelCase in function declarationGaston Gonzalez1-1/+1
Renaming function declaration to avoid CamelCase use. As this was already fixed in the function definition in commit 801b1aa002d3 ("staging: vc04_services: fix CamelCase"), the current change make the names of the variables in the function definition and declartion match. Reported by checkpatch.pl Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211024212524.370078-4-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: vchiq_core: cleanup code alignment issuesGaston Gonzalez1-8/+4
Fix code alignment issues reported by checkpatch.pl Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211024212524.370078-3-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: vchiq_core: cleanup blank linesGaston Gonzalez1-3/+0
Remove unnecessary blank lines. Reported by checkpatch.pl Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Link: https://lore.kernel.org/r/20211024212524.370078-2-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: vchiq: Replace function typedefs with equivalent declarationOjaswin Mujoo1-4/+2
Replace function typedefs with the equivalent declarations to better align with the linux kenel coding style The following typedefs were changed: * VCHIQ_CONNECTED_CALLBACK_T * vchiq_userdata_term Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com> Link: https://lore.kernel.org/r/a8e4e0457b5fcc88c7f297f9d669dfb7e7d91ed5.1631366317.git.ojaswin98@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-04staging: vchiq_arm: tidy up service function namingStefan Wahren1-2/+2
During a recent review Dan Carpenter reported that the function naming of (un)lock_service is misleading. They are like wrapper around kref_get / kref_put and don't have anything to do with locking. So use a name which represent more the actual behavior. Btw add the vchiq prefix to avoid possible name conflicts. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1622735405-9980-12-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-04staging: vchiq_core: get the rid of vchiq_static_assertStefan Wahren1-6/+1
Use static_assert from the kernel instead of opencode it. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1622735405-9980-6-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-04staging: vchiq_core: get the rid of IS_POW2Stefan Wahren1-7/+0
The macro IS_POW2 is only used to ensure some size are powers of 2. Better use BUILD_BUG_ON_NOT_POWER_OF_2 for this. Since this must be done in a function, merge all these checks in a new function. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1622735405-9980-5-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-04staging: vchiq_core: move internals to C sourceStefan Wahren1-61/+0
There is no need to export those definitions, so keep them in the source file. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1622735405-9980-4-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-19staging: vchiq_arm: make vchiq_shutdown_internal return voidStefan Wahren1-1/+1
The function vchiq_shutdown_internal always returns VCHIQ_SUCCESS. So change the return type to void and simplify the logic in vchiq_shutdown. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1621105859-30215-17-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: vchiq_core: drop vchiq_status from vchiq_init_stateStefan Wahren1-1/+1
Replace the custom set of return values with proper Linux error codes for vchiq_init_state(). Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1619347863-16080-12-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: vchiq_core: drop vchiq_status from vchiq_set_service_optionStefan Wahren1-1/+1
Replace the custom set of return values with proper Linux error codes for vchiq_set_service_option(). Now we can use the result directly as return value for vchiq_ioctl(). Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1619347863-16080-10-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: vchiq_arm: drop enum vchiq_status from vchiq_*_internalStefan Wahren1-2/+2
Replace the custom set of return values with proper Linux error codes for the following functions: vchiq_use_internal() vchiq_release_internal() vchiq_use_service_internal() vchiq_release_service_internal() Now we can use the result directly as return value for vchiq_ioctl(). Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1619347863-16080-9-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: vchiq_2835_arm: drop enum vchiq_statusStefan Wahren1-2/+2
Replace the custom set of return values with proper Linux error codes. As a result we need to initialize vchiq_status in vchiq_init_state. Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1619347863-16080-8-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-28staging: vc04_services: fix block comment styleAmarjargal Gundjalam1-21/+34
Fix block comments to adhere to the kernel coding style. Signed-off-by: Amarjargal Gundjalam <amarjargal16@gmail.com> Link: https://lore.kernel.org/r/20201027175117.32826-2-amarjargal16@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-25staging: vchiq: avoid mixing kernel and user pointersArnd Bergmann1-3/+3
As found earlier, there is a problem in the create_pagelist() function that takes a pointer argument that either points into vmalloc space or into user space, with the pointer value controlled by user space allowing a malicious user to trick the driver into accessing the kernel instead. Avoid this problem by adding another function argument and passing kernel pointers separately from user pointers. This makes it possible to rely on sparse to point out invalid conversions, and it prevents user space from faking a kernel pointer. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200925114424.2647144-2-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-25staging: vchiq: fix __user annotationsArnd Bergmann1-5/+5
My earlier patches caused some new sparse warnings, but it turns out that a number of those are actual bugs, or at least suspicous code. Adding __user annotations to the data structures that are defined in uapi headers helps avoid the new warnings, but that causes a different set of warnings to show up, as some of these structures are used both inside of the kernel and at the user interface but storing pointers to different things there. Duplicating the vchiq_service_params and vchiq_completion_data structures in turn takes care of most of those, and then it turns out that there is a 'data' pointer that can be any of a __user address, a dmd_addr_t and a kernel pointer in vmalloc space at times. I'm trying to annotate these as best I can without changing behavior, but there still seems to be a serious bug when user space passes a valid vmalloc space address instead of a user pointer. Adding comments in the code there, and leaving the warnings in place that seem to correspond to actual bugs. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200925114424.2647144-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Move vchiq.h into include directoryNicolas Saenz Julienne1-1/+1
To make the separation clear between vchiq's header files and vchiq.h, which is to be used by services and is the 'public' API, move it into a dedicated includes directory. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-48-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Move defines into core headerNicolas Saenz Julienne1-0/+4
Those are only used in the core vchiq code, while present in vchiq's 'public' API header. Move them into the right place. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-47-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Move conditional barrier definition into vchiq_core.hNicolas Saenz Julienne1-0/+12
The barrier is only used by core code. So keep the barrier definition in the core header. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-45-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Move definitions only used by core into core headerNicolas Saenz Julienne1-0/+22
vchiq_if.h is used by service consumers and only the exported API should be present. Move the rest of definitions, which were not exported by the way, to vchiq_core.h where they belong. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-40-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01staging: vchiq: Move message queue into struct vchiq_serviceNicolas Saenz Julienne1-0/+6
This has historically been handled by vchi, but there is no reason why this couldn't be handled directly in vchiq. The patch tries to avoid altering any behavior, with the exception of the msg_queue size, which is now fixed to VCHIQ_MAX_SLOTS (it was set to VCHIQ_MAX_SLOTS / 2). This is done to match vchiq's user_service message queue, which could be merged with this one in the future. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-24-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: vchiq: Move copy callback handling into vchiqNicolas Saenz Julienne1-0/+7
All vchi users use the kernel variant of the copy callback. The only user for the user space variant of the copy callback is in the ioctl implementation. So move all this copying logic into vchiq, and expose a new function that explicitly passes kernel messages. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200527115400.31391-4-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-12staging: vc04_services: don't increment service refcount when it's not neededMarcelo Diop-Gonzalez1-1/+7
There are a few places where a service's reference count is incremented, something quick is done, and the refcount is dropped. This can be made a little simpler/faster by not grabbing a reference in these cases. Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com> Link: https://lore.kernel.org/r/ac6186ac888f1acf489b5b504efcba8b0d6a8b25.1581532523.git.marcgonzalez@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-12staging: vc04_services: use kref + RCU to reference count servicesMarcelo Diop-Gonzalez1-4/+8
Currently reference counts are implemented by locking service_spinlock and then incrementing the service's ->ref_count field, calling kfree() when the last reference has been dropped. But at the same time, there's code in multiple places that dereferences pointers to services without having a reference, so there could be a race there. It should be possible to avoid taking any lock in unlock_service() or service_release() because we are setting a single array element to NULL, and on service creation, a mutex is locked before looking for a NULL spot to put the new service in. Using a struct kref and RCU-delaying the freeing of services fixes this race condition while still making it possible to skip grabbing a reference in many places. Also it avoids the need to acquire a single spinlock when e.g. taking a reference on state->services[i] when somebody else is in the middle of taking a reference on state->services[j]. Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com> Link: https://lore.kernel.org/r/3bf6f1ec6ace64d7072025505e165b8dd18b25ca.1581532523.git.marcgonzalez@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09staging: vc04_services: Delete vchiq_platform_check_suspend()Nicolas Saenz Julienne1-3/+0
The function does nothing. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200131103836.14312-20-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09staging: vc04_services: Get rid of vchiq_platform_handle_timeout()Nicolas Saenz Julienne1-3/+0
The function does nothing. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200131103836.14312-11-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09staging: vc04_services: Get rid of vchiq_platform_suspend/resume()Nicolas Saenz Julienne1-3/+0
vchiq_platform_suspend() and vchiq_platform_resume() do nothing, get rid of them. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200131103836.14312-9-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09staging: vc04_services: Get rid of vchiq_platform_paused/resumed()Nicolas Saenz Julienne1-6/+0
vchiq_platform_paused() and vchiq_platform_resumed() do nothing. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200131103836.14312-8-nsaenzjulienne@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-22staging: vchiq: Have vchiq_dump_* functions return an error codeMarcelo Diop-Gonzalez1-6/+6
These functions currently modify the struct dump_context passed to them, and set context->actual to -EFAULT in case of error. The issue is that this is never returned to the user (except accidentally when things align so that that happens). So, have these functions return 0 on success and the appropriate error code otherwise, and return nonzero errors to the user. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20191120202102.249121-5-marcgonzalez@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHIQ_PLATFORM_STATE_T typedef with struct opaque_platform_stateJamal Shareef1-2/+2
Replace VCHIQ_PLATFORM_STATE_T typedef with struct opaque_platform_state to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/ed1a877637a53881ed65dc232da04dc40fbd9fc3.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHIQ_INSTANCE_T typedef with struct vchiq_instanceJamal Shareef1-8/+8
Replaces VCHIQ_INSTANCE_T typedef with struct vchiq_instance to match kernel code style. Issue found by checkpatch. Additionally, as part of the process renames "struct vchiq_instance_struct" to "struct vchiq_instance". Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/ed2b3076f93a920149716687b48e0c5e3ddf0569.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHIQ_SERVICE_HANDLE_T typedef with unsigned intJamal Shareef1-6/+6
Replaces VCHIQ_SERVICE_HANDLE_T typedef with unsigned int to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/9d35b9fea684d18cc1e989621808d77eef3081c6.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Rename callback VCHIQ_USERDATA_TERM_T to vchiq_userdata_termJamal Shareef1-3/+3
Renames callback VCHIQ_USERDATA_TERM_T to vchiq_userdata_term to match kernel code style. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/478914a1e756f78c3277acb3852c1ccdcb2d5750.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHIQ_BULK_DIR_T enum typedef with enum vchiq_bulk_dirJamal Shareef1-3/+3
Replaces VCHIQ_BULK_DIR_T enum typedef with enum vchiq_bulk_dir to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/344e01e371aa7fbf670ba118be174e391e078e6a.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHIQ_CONNSTATE_T enum typedef with enum vchiq_connstateJamal Shareef1-7/+7
Replaces VCHIQ_CONNSTATE_T enum typedef with enum vchiq_connstate to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/7e64765a55193413e9668dc53f751c435369ed80.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-07staging: vc04_services: Replace VCHIQ_BULK_MODE_T enum typedef with enum vchiq_bulk_modeJamal Shareef1-1/+1
Replaces VCHIQ_BULK_MODE_T enum typedef with enum vchiq_bulk_mode to match kernel code style. Issue found by checkpatch. Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com> Link: https://lore.kernel.org/r/667037e1810921e30371dbeb52c1ae489bf31f8c.1572994235.git.jamal.k.shareef@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>