[PATCH v3] staging: ccree: fix boolreturn.cocci warning

2017-10-17 Thread sunil . m
From: Suniel Mahesh This fixes the following coccinelle warning: WARNING: return of 0/1 in function 'ssi_is_hw_key' with return type bool. return "false" instead of 0. Signed-off-by: Suniel Mahesh --- Changes for v3: - Changed the commit log even more to give an accurate description of the c

[PATCH v2] staging: ccree: fix boolreturn.cocci warning

2017-10-17 Thread sunil . m
From: Suniel Mahesh Return "false" instead of 0. This fixes the following coccinelle warning: WARNING: return of 0/1 in function 'ssi_is_hw_key' with return type bool. Signed-off-by: Suniel Mahesh --- Changes for v2: - Changed the commit log to give a more accurate description of the changes

[PATCH v2] staging: ccree: Fix bool comparison

2017-10-17 Thread sunil . m
From: Suniel Mahesh Comparision operator "equal to" not required on a variable "foo" of type "bool". Bool has only two values, can be used directly or with logical not. This fixes the following coccinelle warning: WARNING: Comparison of bool to 0/1 Signed-off-by: Suniel Mahesh --- Changes for

[PATCH] staging: ccree: fix boolreturn.cocci warning

2017-10-16 Thread sunil . m
From: Suniel Mahesh This fixes the following coccinelle warning: WARNING: return of 0/1 in function 'ssi_is_hw_key' with return type bool. Signed-off-by: Suniel Mahesh --- Note: - Patch was tested and built(ARCH=arm) on latest linux-next. - No build issues reported, however it was not teste

[PATCH] staging: ccree: Fix bool comparison

2017-10-16 Thread sunil . m
From: Suniel Mahesh Bool tests don't need comparisons. This fixes the following coccinelle warning: WARNING: Comparison of bool to 0/1 Signed-off-by: Suniel Mahesh --- Note: - Patch was tested and built(ARCH=arm) on latest linux-next. - No build issues reported, however it was not tested o

[PATCH] staging: ccree: local variable "dev" not required

2017-10-04 Thread sunil . m
From: Suniel Mahesh There is no need to create a local pointer variable "dev" and pass it various API's, instead use plat_dev which is enumerated by platform core on successful probe. Signed-off-by: Suniel Mahesh --- Note: - Patch was tested and built(ARCH=arm) on staging-testing. - No build is

[PATCH v3] staging: ccree: Convert to platform_{get,set}_drvdata()

2017-10-04 Thread sunil . m
From: 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

[PATCH] staging: ccree: else is not generally useful after a break or return

2017-09-21 Thread sunil . m
From: Suniel Mahesh Fixes checkpatch warnings: WARNING: else is not generally useful after a break or return Signed-off-by: Suniel Mahesh --- Note: - Patch was tested and built(ARCH=arm) on next-20170921. No build issues reported. --- drivers/staging/ccree/ssi_request_mgr.c | 5 ++--- 1 fil

[PATCH v2] staging: ccree: Convert to platform_{get,set}_drvdata()

2017-09-21 Thread sunil . m
From: 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

[PATCH] staging: ccree: Convert to platform_{get,set}_drvdata()

2017-09-21 Thread sunil . m
From: 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

[PATCH] staging: ccree: Fix unnecessary NULL check before kfree'ing it

2017-07-20 Thread sunil . m
From: Suniel Mahesh kfree(NULL) is safe and their is no need for a NULL check. Pointed out by checkpatch. Signed-off-by: Suniel Mahesh --- Note: - Patch was compile tested and built(ARCH=arm) on next-20170719. No build issues reported. --- drivers/staging/ccree/ssi_hash.c | 25 --

[PATCH v2 1/3] staging: ccree: Replace kzalloc with devm_kzalloc

2017-07-18 Thread sunil . m
From: Suniel Mahesh It is recommended to use managed function devm_kzalloc, which simplifies driver cleanup paths and driver code. This patch does the following: (a) replace kzalloc with devm_kzalloc. (b) drop kfree(), because memory allocated with devm_kzalloc() is automatically freed on driver

[PATCH v2 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-07-18 Thread sunil . m
From: Suniel Mahesh It is recommended to use managed function devm_ioremap_resource(), which simplifies driver cleanup paths and driver code. This patch does the following: (a) replace request_mem_region(), ioremap() and corresponding error handling with devm_ioremap_resource(). (b) remove struct

[PATCH v2 3/3] staging: ccree: Use platform_get_irq and devm_request_irq

2017-07-18 Thread sunil . m
From: Suniel Mahesh It is recommended to use managed function devm_request_irq(), which simplifies driver cleanup paths and driver code. This patch does the following: (a) replace platform_get_resource(), request_irq() and corresponding error handling with platform_get_irq() and devm_request_irq(

[PATCH 3/3] staging: ccree: Use platform_get_irq and devm_request_irq

2017-07-15 Thread sunil . m
From: Suniel Mahesh It is recommended to use managed function devm_request_irq(), which simplifies driver cleanup paths and driver code. This patch does the following: (a) replace platform_get_resource(), request_irq() and corresponding error handling with platform_get_irq() and devm_request_irq(

[PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-07-15 Thread sunil . m
From: Suniel Mahesh It is recommended to use managed function devm_ioremap_resource(), which simplifies driver cleanup paths and driver code. This patch does the following: (a) replace request_mem_region(), ioremap() and corresponding error handling with devm_ioremap_resource(). (b) remove struct

[PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc

2017-07-15 Thread sunil . m
From: Suniel Mahesh It is recommended to use managed function devm_kzalloc, which simplifies driver cleanup paths and driver code. This patch does the following: (a) replace kzalloc with devm_kzalloc. (b) drop kfree(), because memory allocated with devm_kzalloc() is automatically freed on driver

[PATCH 0/3] staging: ccree: Employ devm_* functions, remove redundant code

2017-07-15 Thread sunil . m
From: Suniel Mahesh Hi This patch series replaces the current API's which request for device resources in driver probe, with devm_*() functions of the kernel framework as recommended by the kernel community. Doing so simplifies driver cleanup paths and code organization. The current set of A