summaryrefslogtreecommitdiffstats
path: root/drivers/staging
AgeCommit message (Collapse)Author
2017-10-09staging: iio: ade7753: expanding buffer lock to cover both buffer and state ↵Himanshi Jain
protection Dropping the extra lock (used for protecting the write frequency) by expanding the buffer lock to cover both buffer and state protection. Doing this by introducing a new function (__ade7753_spi_write_reg_16) making buffer changes without locking the state, to avoid nested locks while making device frequency changes. Signed-off-by: Himanshi Jain <himshijain.hj@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09staging: iio: tsl2x7x: migrate in_illuminance0_integration_time sysfs ↵Brian Masney
attribute to iio_chan_spec The driver explicitly creates the in_illuminance0_integration_time sysfs attribute outside the IIO core. This attribute is available in the IIO core so this patches migrates the attribute to be created by the iio_chan_spec. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09staging: iio: tsl2x7x: rename tsl2x7x_settings variable to settingsBrian Masney
The length of the 'tsl2x7x_settings' variable within the tsl2X7X_chip structure makes some of the line lengths greater than 80 characters for upcoming patches. This patch shortens the name of the 'tsl2x7x_settings' variable in this structure to just 'settings' to improve code readability. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09Merge 4.14-rc4 into staging-nextGreg Kroah-Hartman
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-04staging: irda: au1k_ir.c fix warning: Prefer [subsystem eg: ↵Yurii Pavlenko
netdev]_info([subsystem]dev, ... This patch fixes the following checkpatch.pl warning: fix Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... Signed-off-by: Yurii Pavlenko <pyldev@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-04staging: ccree: Convert to platform_{get,set}_drvdata()Suniel Mahesh
Platform devices are expected to use wrapper functions, platform_{get,set}_drvdata() with platform_device as argument, for getting and setting the driver data. dev_{get,set}_drvdata() are using &plat_dev->dev. For wrapper functions we can directly pass a struct platform_device. dev_set_drvdata() is redundant and therefore removed. The driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Suniel Mahesh <sunil.m@techveda.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: android: TODO: Removing an invalid issueJoaquin Garmendia Cabrera
The first line of TODO is invalid because no file has an error or warning when running checkpatch.pl Signed-off-by: Joaquin Garmendia Cabrera <joaquingc123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtlwifi: pr_err() strings should end with newlinesArvind Yadav
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: bcm2835-camera: pr_err() strings should end with newlinesArvind Yadav
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: gs_fpgaboot: pr_err() strings should end with newlinesArvind Yadav
pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtlwifi: make various structures staticColin Ian King
The structures created from macros RTL_DEBUG_IMPL_MAC_SERIES, RTL_DEBUG_IMPL_BB_SERIES, RTL_DEBUG_IMPL_RF_SERIES and RTL_DEBUG_IMPL_CAM_SERIES are all local to the source and do not need to be in global scope, so make them static. Cleans up 37 sparse warnings of the form: symbol 'rtl_debug_priv_mac_0' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtlwifi: silence underflow warningDan Carpenter
I'm not totally certain that it's necessary to put an upper limit here. I think it happens at lower levels. But if we are going to do that then we should have a lower bound as well. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8192u: Fix some error handling pathChristophe JAILLET
If 'rtl8192_usb_initendpoints()' fails, it may have allocated some resources that need to be freed. The corresponding is propagated up to 'rtl8192_usb_prob()'. So, in this function if an error code is returned by 'rtl8192_init()' we should call 'rtl8192_usb_deleteendpoints()'. Some error handling code is also duplicated in 'rtl8192_init()' and in 'rtl8192_usb_prob()'. This looks harmless because the freed pointers are set to NULL but it looks confusing. Fix all that by just moving the 'fail' label and removing duplicated error handling code from 'rtl8192_ini()'. All this resources freeing will be handled by 'rtl8192_usb_prob()' directly. The calling graph is: rtl8192_usb_probe --> rtl8192_init --> rtl8192_usb_initendpoints Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8192u: Check some memory allocation failureChristophe JAILLET
If one of these memory allocations fail, a NULL pointer dereference will occur later on. Return -ENOMEM instead. There is no need to free the resources already allocated, this is done by the caller (i.e. 'rtl8192_usb_probe()') which calls 'rtl8192_usb_deleteendpoints()'. The calling graph is: rtl8192_usb_probe --> rtl8192_init --> rtl8192_usb_initendpoints Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8192e: make const array broadcast_addr static, reduces object ↵Colin Ian King
code size Don't populate const array broadcast_addr on the stack, instead make it static. Makes the object code smaller by over 40 bytes: Before: text data bss dec hex filename 63906 8248 1216 73370 11e9a rtllib_softmac.o After: text data bss dec hex filename 63806 8304 1216 73326 11e6e rtllib_softmac.o (gcc 6.3.0, x86-64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8192u: make r8192_wx_handlers_def structure constBhumika Goyal
Make this const as it is only stored in a const field of a pci_dev structure. Make the declaration in the header const too. Structure found using Coccinelle and changes done by hand. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8723bs: use ARRAY_SIZEJérémy Lefaure
Using the ARRAY_SIZE macro improves the readability of the code. Also, it is not always useful 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtlwifi: use ARRAY_SIZEJérémy Lefaure
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: fsl-mc/dpio: Fix incorrect comparisonIoana Radulescu
For some dpio functions, a cpu id parameter value of -1 is valid and means "any". But when trying to validate this param value against an upper limit, in this case num_possible_cpus(), we risk obtaining the wrong result due to an implicit cast. Avoid an incorrect check result by explicitly comparing the cpu id with the "any" value before verifying the upper bound. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: ccree: else is not generally useful after a break or returnSuniel Mahesh
Fixes checkpatch warnings: WARNING: else is not generally useful after a break or return Signed-off-by: Suniel Mahesh <sunil.m@techveda.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: ccree: simplify OOM handlingGilad Ben-Yossef
Simplify handling of memory allocation failures and remove redundant log messages Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: ccree: move to generic device log infraGilad Ben-Yossef
Move over from using macro wrappers around to printk to dev_err, dev_dbg and friends and clean up resulting fallout. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: ccree: simplify access to struct deviceGilad Ben-Yossef
Introduce a function to retrieve struct device from private data structure in preparation to replacing custom logging macros with proper dev_dbg and friends which require struct device. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: ccree: remove sysfs if of deleted codeGilad Ben-Yossef
The ccree cycle count mechanism was removed in commit 7f821f0c6ffa ("staging: ccree: remove cycle count debug support") but the sysfs interface lingered on. Remove it now. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03Staging: rtl8188eu: core: Use list_entry instead of container_ofSrishti Sharma
For variables that have type struct list_head* use list_entry to access current list element instead of using container_of. Done using the following semantic patch by coccinelle. @r@ identifier e; struct list_head* l; @@ <... when != l == NULL l; ...> ( e= -container_of +list_entry ( ...) ) Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8188eu: Place the constant on the right side in comparisonsMihaela Muraru
Move constant to the right side of comparison operator. Issue found by checkpatch.pl Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: rtl8188eu: Remove braces from single statement blocksMihaela Muraru
This patch fix a coding style issue, by removing braces {} from single statement blocks. Issue found by checkpatch.pl. Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: lustre: use BIT macroKeerthi Reddy
This commit changes changes left shift operator to use BIT macro Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03Staging: rtl8723bs: Remove unnecessary commentsShreeya Patel
Remove unnecessary comments which are there to explain why call to memset is in comments. Both of the comments are not needed as they are not very useful. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: sm750fb: Remove typedef struct _dvi_ctrl_device_tMihaela Muraru
This patch removes typedef from struct and renames it from "_dvi_ctrl_device_t" to "dvi_ctrl_device" as per kernel coding standards. Issue found by checpatch.pl Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03staging: sm750fb: remove typedef for enum in ddk750_sii164.{c,h}Keerthi Reddy
Removing this will make sure that we are actually working with enum. Also it is not a good coding style to use typedef. In this commit remove typedef and also drop '_t' which traditionally means typedef Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03Staging: sm750fb: remove typedef for enum in ddk750_power.{c,h}Keerthi Reddy
Using typedef will hide that 'DPMS_t' is enum. Removing this will make sure that we are actually working with enum. Also it is not a good coding style to use typedef In this commit remove typedef and lowercaser the name 'DPMS_t'. And also drop '_t' which traditionally means typedef. Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: greybus: light: remove unnecessary error checkArvind Yadav
It is not necessary to check return value of gb_lights_channel_flash_config. gb_lights_channel_config returns both successful and error value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: greybus: light: Release memory obtained by kasprintfArvind Yadav
Free memory region, if gb_lights_channel_config is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: media: atomisp: Use kmalloc_array instead of kmallocGeorgiana Chelu
Prefer kmalloc_array over kmalloc with multiply because kmalloc_array performs additional checks before memory allocation. Fix the following issue reported by checkpatch.pl: * WARNING: Prefer kmalloc_array over kmalloc with multiply Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29atomisp2: remove cast from memory allocationAishwarya Pant
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>
2017-09-29Staging: media: atomisp: pci: Place constant on the right side in comparissonsGeorgiana Chelu
Fix issue found by checkpatch.pl script. WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: media: atomisp: pci: Move open brace '{' on the next lineGeorgiana Chelu
Fix the following issue found by checkpatch.pl: ERROR: open brace '{' following function definitions go on the next line Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: media: atomisp: Add blank line after declarationsGeorgiana Chelu
This patch adds a blank line after declarations to improve code readability. Issue find by checkpatch.pl script. WARNING: Missing a blank line after declarations Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: media: atomisp: Use unsigned int instead of unsignedGeorgiana Chelu
Fix the checkpatch.pl issue: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: rtl8188eu: core: Fix line over 80 charactersGeorgiana Chelu
Fix warning reported by checkpatch.pl script: WARNING: line over 80 characters Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: rtl8188eu: core: Add spaces around '+'Georgiana Chelu
Improve the coding style by adding spaces around arithmetic operation. Issue reported by checkpatch.pl script. Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: rtl8188eu: core: Use __func__ instead of function nameGeorgiana Chelu
Replace the function name from format string with the constant __func__ to avoid multiple changes in case the name of the function will be modified. Issue reported by checkpatch.pl script. Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: rtl8188eu: wrap lines in 80 charactersAishwarya Pant
Perform cleanup for all function declarations in core/rtw_mlme_ext wherever checkpatch complains about lines being over 80 characters long. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: rtl8188eu: remove implicit bool->int conversionsAishwarya Pant
Implicit type conversions are bad; they hinder readability of code and have potential to cause bugs. Here the variable wait_ack is always supplied a bool value while in function declarations it is defined as an int type. Fix it by defining wait_ack a bool type in all usages. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: rtl8188eu: remove unneeded conversions to boolAishwarya Pant
Patch suppresses the following warning issued by coccicheck: WARNING: conversion to bool not needed here Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: vc04_services: Remove typedef struct vchiq_2835_state_structMihaela Muraru
This patch removes typedef from struct and renames it from "typedef struct vchiq_2835_state_struct" to "struct vchiq_2835_state" as per kernel coding standards. Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29staging: vc04_services: Remove extern variableMihaela Muraru
This patch removes extern variable vchiq_arm_log_level, because it is already declared in vchiq_arm.h Issue found by checkpatch.pl Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: vc04_services: remove unused variablesKeerthi Reddy
the volatile fields of bcm2835_alsa_stream - control and status are not used. $ grep bcm2835_alsa_stream >From the above command all instances we see that all variables of 'bcm2835_alsa_stream' are declared as 'alsa_stream' So search for 'control' wherever we have 'alsa_stream' $ grep -l 'alsa_stream' | xargs grep "control" The above command returns where we don't any usage of 'control' field. which means that there is no usage of these fields. similarly for 'status' we see no usages. Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29Staging: vc04_services: bcm2835-camera: use BIT macroKeerthi Reddy
Use BIT macro instead of left shift Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>