summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vme_user
Commit message (Collapse)AuthorAgeFilesLines
* staging: vme_user: print more detailed infomation when an error occursPiro Yang2024-01-041-1/+1
| | | | | | | | | | | | | | when the slave_get function pointer belongs to the struct vme_bridge member is NULL, it prompts that the detailed function name "vme_slave_set" equivalent to __func__ not supported. it is similar to the vme_slave_get function: when vme_bridge->slave_set function pointer is NULL to print detailed function name by using __func__. Signed-off-by: Piro Yang <piroyangg@gmail.com> Link: https://lore.kernel.org/r/20231227154739.6951-1-piroyangg@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Fix the issue of return the wrong error codePiro Yang2023-12-231-1/+1
| | | | | | | | | | | | Fix the issue of returning the -ENOSYS error code when an error occurs. The error code of -ENOSYS indicates Invalid system call number, but there is not system call error. So replace -ENOSYS error code by the return -EINVAL error code. Signed-off-by: Piro Yang <piroyangg@gmail.com> Link: https://lore.kernel.org/r/20231219170447.51237-1-piroyangg@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: staging: vme_user: Describe VME_BUS and VME_TSI148Bagas Sanjaya2023-11-231-4/+18
| | | | | | | | | | | Help description for both options only tells users to enable them without description of what VME bridge and TSI148 device are. Briefly describe them. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20231113093839.7687-1-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: prefer strscpy over strcpyMichael Straube2023-10-251-1/+1
| | | | | | | | | | Using strcpy has potential for buffer overflows. It should be replaced with strscpy where possible. In this case the return value of strcpy is not used, so we can safely replace it with strscpy. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20231023090001.7273-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Use dev_err() in vme_check_window()Soumya Negi2023-10-212-7/+7
| | | | | | | | | | | | | | | vme_check_window() uses printk() for logging error message. This leads to the following checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Use dev_err() instead. Pass VME bridge device to vme_check_window() so that the error message can be logged with the bridge device context. Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/221344ede933b1d9e6c31310b0f4dbb8be809c86.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Remove NULL-checksSoumya Negi2023-10-211-34/+2
| | | | | | | | | | | | Don't check for empty bridge device & resource in vme_alloc_consistent() & vme_free_consistent() since they can not be NULL. Both the VME bridge device and the VME resource that are used in these functions are set at probe time. Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/049bbedf458e8ac40f3dfff9c9b25dce89f5b642.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Remove printk() in find_bridge()Soumya Negi2023-10-211-1/+0
| | | | | | | | | | | | | | | Don't log error message in find_bridge(). The printk() triggers a checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... It can't be replaced by dev_err() & using pr_err() is not helpful as it doesn't give much context to the user. It is better to remove it. Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/028725ebbc522f73c39f5b1ec4cc2bdbdf588971.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Use __func__ instead of function nameSoumya Negi2023-10-211-7/+7
| | | | | | | | | | | | | Replace function names in message strings with __func__ to fix all checkpatch warnings like: WARNING: Prefer using '"%s...", __func__' to using 'vme_lm_get', this function's name, in a string Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Acked-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://lore.kernel.org/r/db4ad6b878c4bb08fd5d15cf4a9287d7bb8c30df.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Replace printk() with dev_*()Soumya Negi2023-10-211-76/+99
| | | | | | | | | | | | | vme.c uses printk() to log messages. To improve and standardize message formatting, use logging mechanisms dev_err()/dev_warn() instead. Retain the printk log levels of the messages during replacement. Issue found by checkpatch.pl Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Acked-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://lore.kernel.org/r/a36a0b839f9c21efe1f2df6f9272ae882fd04fb8.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: replace strcpy with strscpyCalvince Otieno2023-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checkpatch suggests using strscpy() instead of strcpy(). The advantages of strscpy() are that it always adds a NUL terminator and prevents read/write overflows if the source string is not properly terminated. strcpy() lacks built-in bounds checking for the destination buffer, making it susceptible to buffer overflows. These overflows can lead to various unpredictable behaviors. In this specific context, both strscpy and strcpy performs the same operation without any functional difference. The reason for this equivalence is that the driver_name string "vme_fake" is shorter than the size of the fake_bridge->name array which is defined as 16 characters (struct vme_bridge {char name[VMENAMSIZ];...}). Thus, there is no risk of buffer overflow in either case. VMENAMSIZ variable holds a constant value of 16 (#define VMENAMSIZ 16) The null-terminated "vme_fake" string (static const char driver_name[] = "vme_fake";) can be safely copied into fake_bridge->name using either strscpy or strcpy. While using strscpy() does not address any bugs, it is considered a better practice and aligns with checkpatch recommendations. Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Calvince Otieno <calvncce@gmail.com> Link: https://lore.kernel.org/r/ZTDS2H48JBUTiwZi@lab-ubuntu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Add spaces around '<<' operatorSoumya Negi2023-10-151-274/+274
| | | | | | | | | Add spaces around all instances of << in the header vme_tsi148.h to conform with Linux coding style. Issue found by checkpatch.pl Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Link: https://lore.kernel.org/r/f84f353dedc28f99e42d2419b379ace41d0cb218.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Add spaces around '*'Soumya Negi2023-10-151-1/+1
| | | | | | | | | Add space around * operator to adhere to Linux coding style. Issue found by checkpatch.pl Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Link: https://lore.kernel.org/r/81181dcc1ffa648f32cbe3c4ec8731e66349e450.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Fix unbalanced {} in if-else blocksSoumya Negi2023-10-152-4/+6
| | | | | | | | | Add missing braces so that {} are balanced in all arms of if-else statements as per Linux coding style. Issue found by checkpatch.pl Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Link: https://lore.kernel.org/r/b0fad6de7405a105235b3b595e0bb2c51be7dcf0.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Correct spelling mistakes in commentsSoumya Negi2023-10-151-2/+2
| | | | | | | | Fix misspelled words in vme.c. Issue found by checkpatch.pl Signed-off-by: Soumya Negi <soumya.negi97@gmail.com> Link: https://lore.kernel.org/r/f41caa8e7c987fdc010942838117fece8151affe.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: make vme_user_sysfs_class constantGreg Kroah-Hartman2023-10-061-13/+13
| | | | | | | | | | Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Link: https://lore.kernel.org/r/2023100523-throwback-oak-a164@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Fix various comment formatting issues including comment ↵Jonathan Bergh2023-09-171-79/+77
| | | | | | | | | | | | | | | | content Fixed various issues relating to comments including: * Lines with '*' in block comments which should be aligned and were not * Corrected comments where closing multiline comment identifier ran over into second newline spuriously * Corrected comment content to correctly reflect hexadecimal for the offsets rather than integers Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Link: https://lore.kernel.org/r/20230914200732.47659-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Remove spurious newlines between define statementsJonathan Bergh2023-09-171-4/+0
| | | | | | | | | Removed spurious newlines in define statements so that defines which should be grouped together for readability are grouped as such. Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Link: https://lore.kernel.org/r/20230914200536.47619-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Remove unused (commented) code causing unnecessary ↵Jonathan Bergh2023-09-171-3/+0
| | | | | | | | | | | checkpatch warning Removed unused/commented code from vme_fake.c which was causing spurious checkpatch warnings. Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Link: https://lore.kernel.org/r/20230903150623.571984-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check unnecessary space after a cast in vme_fake.cAlexon Oliveira2023-09-171-2/+2
| | | | | | | | | | Fixed all CHECK: No space is necessary after a cast as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/603976b29ad4d9a0e4cbd8452ff674ec70a227a8.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check unnecessary blank lines in vme_fake.cAlexon Oliveira2023-09-171-2/+0
| | | | | | | | | | Fixed all CHECK: Blank lines aren't necessary before a close brace '}' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/dde6f13f92a7cb17e01aceaeabe790656078326e.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check lines not ending with '(' in vme_fake.cAlexon Oliveira2023-09-171-2/+1
| | | | | | | | | | Fixed all CHECK: Lines should not end with a '(' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/9f3e2facdc4d5e612dc00830c2da0fb19c20f2c5.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check alignment of open parenthesis in vme_fake.cAlexon Oliveira2023-09-171-32/+33
| | | | | | | | | | Fixed all CHECK: Alignment should match open parenthesis as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/639fc19f5c5bce6557a813728b28c299c5134ecf.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Use list_for_each_entry() helperJinjie Ruan2023-09-131-22/+5
| | | | | | | | | | | Convert list_for_each() to list_for_each_entry() so that the slave/master/dma/handler/lm_pos list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230823071437.450460-1-ruanjinjie@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check lines should not end with a '('Alexon Oliveira2023-08-221-3/+2
| | | | | | | | | | Fixed all CHECK: Lines should not end with a '(' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/ZNqbDtRjGWq67lDJ@alolivei-thinkpadt480s.gru.csb Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check blank lines not necessaryAlexon Oliveira2023-08-221-4/+0
| | | | | | | | | | | Fixed all CHECK: Blank lines aren't necessary after an open brace '{' and CHECK: Blank lines aren't necessary before a close brace '}' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/ZNqYXAe/wIRl8qEe@alolivei-thinkpadt480s.gru.csb Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix alignment of open parenthesisAlexon Oliveira2023-08-111-41/+42
| | | | | | | | | | Fixed all CHECK: Alignment should match open parenthesis as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/ZNO6HohffQlbh7jn@alolivei-thinkpadt480s.gru.csb Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: fix check alignment should match open parenthesisAlexon Oliveira2023-08-091-28/+18
| | | | | | | | | | Fixed warnings and checks as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/ZM0QPaWv4lp93rGF@alolivei-thinkpadt480s.gru.csb Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'driver-core-6.4-rc1' of ↵Linus Torvalds2023-04-271-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the large set of driver core changes for 6.4-rc1. Once again, a busy development cycle, with lots of changes happening in the driver core in the quest to be able to move "struct bus" and "struct class" into read-only memory, a task now complete with these changes. This will make the future rust interactions with the driver core more "provably correct" as well as providing more obvious lifetime rules for all busses and classes in the kernel. The changes required for this did touch many individual classes and busses as many callbacks were changed to take const * parameters instead. All of these changes have been submitted to the various subsystem maintainers, giving them plenty of time to review, and most of them actually did so. Other than those changes, included in here are a small set of other things: - kobject logging improvements - cacheinfo improvements and updates - obligatory fw_devlink updates and fixes - documentation updates - device property cleanups and const * changes - firwmare loader dependency fixes. All of these have been in linux-next for a while with no reported problems" * tag 'driver-core-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (120 commits) device property: make device_property functions take const device * driver core: update comments in device_rename() driver core: Don't require dynamic_debug for initcall_debug probe timing firmware_loader: rework crypto dependencies firmware_loader: Strip off \n from customized path zram: fix up permission for the hot_add sysfs file cacheinfo: Add use_arch[|_cache]_info field/function arch_topology: Remove early cacheinfo error message if -ENOENT cacheinfo: Check cache properties are present in DT cacheinfo: Check sib_leaf in cache_leaves_are_shared() cacheinfo: Allow early level detection when DT/ACPI info is missing/broken cacheinfo: Add arm64 early level initializer implementation cacheinfo: Add arch specific early level initializer tty: make tty_class a static const structure driver core: class: remove struct class_interface * from callbacks driver core: class: mark the struct class in struct class_interface constant driver core: class: make class_register() take a const * driver core: class: mark class_release() as taking a const * driver core: remove incorrect comment for device_create* MIPS: vpe-cmp: remove module owner pointer from struct class usage. ...
| * driver core: class: remove module * from class_create()Greg Kroah-Hartman2023-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The module pointer in class_create() never actually did anything, and it shouldn't have been requred to be set as a parameter even if it did something. So just remove it and fix up all callers of the function in the kernel tree at the same time. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230313181843.1207845-4-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: vme: clean up duplicate definitions of dependenciesLukas Bulwahn2023-04-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The file staging/vme_user/Kconfig is only included by the top-level staging/Kconfig if STAGING is enabled. So, there is no need to mention the dependency on STAGING within the vme_user Kconfig file. Further, the config VME_USER is already within the "if VME_BUS" block, so there is no need to mention the dependency on VME_BUS. Clean up these duplications of dependencies. No semantic change. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Link: https://lore.kernel.org/r/20230329074342.27595-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: vme_user: Replace "<<" with BIT macroAbhirup Deb2023-03-251-267/+267
| | | | | | | | | | | | | | | | | | Replace the "<<" operator with BIT macro, in accordance to the checkpatch.pl script and Linux kernel coding-style guidelines. Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com> Link: https://lore.kernel.org/r/ZBipKh/e2lK3YcQr@li-27defe4c-32e1-11b2-a85c-e202e9981075.ibm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: vme_user: remove unnecessary blank linesMenna Mahmoud2023-03-161-5/+0
| | | | | | | | | | | | | | | | | | | | | | Remove unnecessary blank lines before a close brace as reported by checkpatch script "CHECK: Blank lines aren't necessary before a close brace '}'" Signed-off-by: Menna Mahmoud <eng.mennamahmoud.mm@gmail.com> Link: https://lore.kernel.org/r/c8fedfeca9a56dba26846a5bed56642cc694bcbe.1678899549.git.eng.mennamahmoud.mm@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: vme_user: add space around operatorsMenna Mahmoud2023-03-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add a space before and after the operator, for readability. Reported by checkpatch script: " CHECK: spaces preferred around that '+', '<<' and '>>' ". Signed-off-by: Menna Mahmoud <eng.mennamahmoud.mm@gmail.com> Link: https://lore.kernel.org/r/57006c151d4d95550b987143a6650f8b3594ddea.1678899549.git.eng.mennamahmoud.mm@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: vme: remove blank line after return statementRohit Chavan2023-03-081-5/+0
|/ | | | | | | | | This patch resolves a checkpatch issue by removing blank line, after return statement at end of the function. Signed-off-by: Rohit Chavan <roheetchavan@gmail.com> Link: https://lore.kernel.org/r/20230224123401.1365-1-roheetchavan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Replace the "<<" with BIT macroAbhirup Deb2023-01-171-12/+14
| | | | | | | | | Replace the "<<" operator with BIT macro, in accordance to the checkpatch.pl script and Linux kernel coding-style guidelines. Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com> Link: https://lore.kernel.org/r/Y8O5DN9ehby8K487@li-27defe4c-32e1-11b2-a85c-e202e9981075.ibm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: replace 'unsigned' with 'unsigned int'Matt Jan2023-01-171-1/+1
| | | | | | | | Update the bare use of "unsigned" to the preferred "unsigned int". Signed-off-by: Matt Jan <zoo868e@gmail.com> Link: https://lore.kernel.org/r/20221209021756.5597-3-zoo868e@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: remove unnecessary spacesMatt Jan2023-01-171-16/+16
| | | | | | | | | Remove unnecessary spaces before function pointer arguments in vme_bridge.h. This is done with command ':%s/) (/)('. Signed-off-by: Matt Jan <zoo868e@gmail.com> Link: https://lore.kernel.org/r/20221209021756.5597-2-zoo868e@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: add the spaces around the "*"Matt Jan2023-01-171-1/+1
| | | | | | | | | Add a space around the "*" at vme_bridge.h to clear up a checkpatch check. Signed-off-by: Matt Jan <zoo868e@gmail.com> Link: https://lore.kernel.org/r/20221209021756.5597-1-zoo868e@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* vme: Use root_device_register() not underlined versionChen Zhongjin2022-12-081-1/+1
| | | | | | | | | root_device_register and __root_device_register have exactly same effect. Use the not underlined version to keep usage consistency. Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Link: https://lore.kernel.org/r/20221206015033.125827-1-chenzhongjin@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* vme: Fix error not catched in fake_init()Chen Zhongjin2022-12-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | In fake_init(), __root_device_register() is possible to fail but it's ignored, which can cause unregistering vme_root fail when exit. general protection fault, probably for non-canonical address 0xdffffc000000008c KASAN: null-ptr-deref in range [0x0000000000000460-0x0000000000000467] RIP: 0010:root_device_unregister+0x26/0x60 Call Trace: <TASK> __x64_sys_delete_module+0x34f/0x540 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Return error when __root_device_register() fails. Fixes: 658bcdae9c67 ("vme: Adding Fake VME driver") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Link: https://lore.kernel.org/r/20221205084805.147436-1-chenzhongjin@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: remove multiple blank linesMatt Jan2022-12-054-20/+0
| | | | | | | | | | Remove multiple unnecessary blank lines in accordance with the Linux kernel coding-style regulations. The issues were reported by the checkpatch script. Signed-off-by: Matt Jan <zoo868e@gmail.com> Link: https://lore.kernel.org/r/20221204101916.GA51992@zoo868e Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Fix possible UAF in tsi148_dma_list_addGaosheng Cui2022-11-221-0/+1
| | | | | | | | | | | | | | | | | | Smatch report warning as follows: drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add() warn: '&entry->list' not removed from list In tsi148_dma_list_add(), the error path "goto err_dma" will not remove entry->list from list->entries, but entry will be freed, then list traversal may cause UAF. Fix by removeing it from list->entries before free(). Fixes: b2383c90a9d6 ("vme: tsi148: fix first DMA item mapping") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Link: https://lore.kernel.org/r/20221117035914.2954454-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme_user: Fix checkpatch warnings in vme_tsi148.cMingyi Kang2022-08-161-44/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fix the follwing checkpatch warnings: WARNING: quoted string split across lines #129: FILE: drivers/staging/vme_user/vme_tsi148.c:129: + dev_err(tsi148_bridge->parent, "VME Mailbox %d received" + ": 0x%x\n", i, val); WARNING: quoted string split across lines #147: FILE: drivers/staging/vme_user/vme_tsi148.c:147: + dev_err(tsi148_bridge->parent, "PCI Exception at address: 0x%08x:%08x, " + "attributes: %08x\n", WARNING: quoted string split across lines #153: FILE: drivers/staging/vme_user/vme_tsi148.c:153: + dev_err(tsi148_bridge->parent, "PCI-X attribute reg: %08x, PCI-X split " + "completion reg: %08x\n", WARNING: quoted string split across lines #185: FILE: drivers/staging/vme_user/vme_tsi148.c:185: + dev_err(tsi148_bridge->parent, "VME Bus Exception Overflow " + "Occurred\n"); WARNING: quoted string split across lines #321: FILE: drivers/staging/vme_user/vme_tsi148.c:321: + dev_err(tsi148_bridge->parent, "Can't get assigned pci irq " + "vector %02X\n", pdev->irq); WARNING: quoted string split across lines #533: FILE: drivers/staging/vme_user/vme_tsi148.c:533: + dev_err(tsi148_bridge->parent, "Invalid PCI Offset " + "alignment\n"); WARNING: space prohibited before semicolon #591: FILE: drivers/staging/vme_user/vme_tsi148.c:591: + temp_ctl |= TSI148_LCSR_ITAT_SUPR ; WARNING: quoted string split across lines #766: FILE: drivers/staging/vme_user/vme_tsi148.c:766: + dev_err(tsi148_bridge->parent, "Failed to allocate mem " + "resource for window %d size 0x%lx start 0x%lx\n", WARNING: quoted string split across lines #831: FILE: drivers/staging/vme_user/vme_tsi148.c:831: + dev_err(tsi148_bridge->parent, "Invalid VME Window " + "alignment\n"); WARNING: quoted string split across lines #838: FILE: drivers/staging/vme_user/vme_tsi148.c:838: + dev_err(tsi148_bridge->parent, "Size must be non-zero for " + "enabled windows\n"); WARNING: quoted string split across lines #853: FILE: drivers/staging/vme_user/vme_tsi148.c:853: + dev_err(tsi148_bridge->parent, "Unable to allocate memory for " + "resource\n"); WARNING: quoted string split across lines #894: FILE: drivers/staging/vme_user/vme_tsi148.c:894: + dev_err(tsi148_bridge->parent, "Invalid VME Offset " + "alignment\n"); WARNING: quoted string split across lines #941: FILE: drivers/staging/vme_user/vme_tsi148.c:941: + dev_warn(tsi148_bridge->parent, "Currently not setting " + "Broadcast Select Registers\n"); WARNING: quoted string split across lines #1455: FILE: drivers/staging/vme_user/vme_tsi148.c:1455: + dev_err(dev, "Currently not setting Broadcast Select " + "Registers\n"); WARNING: quoted string split across lines #1554: FILE: drivers/staging/vme_user/vme_tsi148.c:1554: + dev_err(dev, "Currently not setting Broadcast Select " + "Registers\n"); WARNING: quoted string split across lines #1643: FILE: drivers/staging/vme_user/vme_tsi148.c:1643: + dev_err(tsi148_bridge->parent, "Descriptor not aligned to 8 " + "byte boundary as required: %p\n", WARNING: else is not generally useful after a break or return #1830: FILE: drivers/staging/vme_user/vme_tsi148.c:1830: + return -EBUSY; + } else { warning: quoted string split across lines #1939: file: drivers/staging/vme_user/vme_tsi148.c:1939: + dev_err(tsi148_bridge->parent, "location monitor " + "callback attached, can't reset\n"); WARNING: space prohibited before semicolon #1964: FILE: drivers/staging/vme_user/vme_tsi148.c:1964: + lm_ctl |= TSI148_LCSR_LMAT_SUPR ; WARNING: quoted string split across lines #2055: FILE: drivers/staging/vme_user/vme_tsi148.c:2055: + dev_err(tsi148_bridge->parent, "Location monitor not properly " + "configured\n"); WARNING: quoted string split across lines #2200: FILE: drivers/staging/vme_user/vme_tsi148.c:2200: + dev_err(tsi148_bridge->parent, "Failed to allocate memory for " + "CR/CSR image\n"); WARNING: quoted string split across lines #2241: FILE: drivers/staging/vme_user/vme_tsi148.c:2241: + dev_err(tsi148_bridge->parent, "Configuring flush image" + " failed\n"); Signed-off-by: Mingyi Kang <jerrykang026@gmail.com> Link: https://lore.kernel.org/r/20220730045726.55452-1-jerrykang026@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* vme: move back to stagingArnd Bergmann2022-06-109-1/+7799
| | | | | | | | | | | | | | | | | | | | | | | | | | The VME subsystem graduated from staging into a top-level subsystem in 2012, with commit db3b9e990e75 ("Staging: VME: move VME drivers out of staging") stating: The VME device drivers have not moved out yet due to some API questions they are still working through, that should happen soon, hopefully. However, this never happened: maintenance of drivers/vme effectively stopped in 2017, with all subsequent changes being treewide cleanups. No hardware driver remains in staging, only the limited user-level access, and I just removed one of the two bridge drivers and the only remaining board. drivers/staging/vme/devices/ was recently moved to drivers/staging/vme_user/, but as the vme_user driver is the only one remaining for this subsystem, it is easier to just move the remaining three source files into this directory rather than keeping the original hierarchy. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20220606084109.4108188-3-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vme: Move 'vme/devices/' to 'vme_user/'Bruno Moreira-Guedes2022-04-224-0/+856
In <db3b9e990e75573402cda22faf933760f076c033> ("Staging: VME: move VME drivers out of staging") the vme code, board and bridge drivers were moved out of the staging tree, remaining only the VME user device driver. Since this driver is the only one remaining in staging, such multi-level structure confuses more than helps. The current structure is as follows: - drivers/staging/vme/ Makefile devices/ Kconfig Makefile vme_user.c vme_user.h The top-level Makefile has the only function of calling another Makefile into the devices/ subdirectory. This latter only compiles the vme_user driver, since there is no other in the staging tree. This patch removes the unnecessary Makefile from the 'vme/' dir, move the contents of 'vme/devices' into the 'vme/' dir, and renames it to 'vme_user/' (the driver name), allowing a straightforward understanding of this driver's contents. Furthermore, it updates the MAINTAINERS file to properly reflect the new paths. Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev> Link: https://lore.kernel.org/r/2cd7de9a426c443a5ea618682d605ecfd751d798.1650544175.git.codeagain@codeagain.dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>