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

2017-10-18 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

[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

[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

[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

[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

[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

[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 _dev->dev. For wrapper functions we can directly pass a

[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. ---

[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 _dev->dev. For wrapper functions we can directly pass a

[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 _dev->dev. For wrapper functions we can directly pass a

[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. ---

[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

[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

[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

[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

[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

[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.

[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

[PATCH v3] staging: wlan-ng: Fix struct definition's and variable type

2017-06-15 Thread sunil . m
From: Suniel Mahesh le16_to_cpu() accepts argument of type __le16 and cpu_to_le16() returns an argument of type __le16. This patch fixes: (a) the type of the variable that end's up getting return from cpu_to_le16(). (b) the member types of struct

[PATCH v2] staging: wlan-ng: Amend type mismatch warnings

2017-06-15 Thread sunil . m
From: Suniel Mahesh le16_to_cpu() accepts argument of type __le16 and cpu_to_le16() returns an argument of type __le16. This patch fixes warnings related to incorrect type in assignment and changes the types in the corresponding header file. The following type mismatch

[PATCH] staging: wlan-ng: Amend type mismatch warnings

2017-06-12 Thread sunil . m
From: Suniel Mahesh The following type mismatch warnings reported by sparse have been amended: warning: cast to restricted __le16 warning: incorrect type in assignment (different base types) Signed-off-by: Suniel Mahesh ---

[PATCH v4 4/6] staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct

2017-03-16 Thread sunil . m
From: Suniel Mahesh Replaced sizeof(struct foo) into sizeof(*ptr), found by checkpatch.pl Signed-off-by: Suniel Mahesh --- Changes for v4: - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter.

[PATCH v4 6/6] staging: rtl8192e: Fix blank lines and space after a cast

2017-03-16 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl checks: Blank lines aren't necessary after an open brace '{' and before a close brace '}', removed No space is necessary after a cast, removed Please don't use multiple blank lines, removed Signed-off-by: Suniel Mahesh

[PATCH v4 0/6] staging: rtl8192e: Fix coding style, warnings and checks

2017-03-16 Thread sunil . m
From: Suniel Mahesh Split earlier patches into multiple commits for easy review as suggested by Dan Carpenter. Modified subject, description and in few patches both for better readability as suggested by Greg KH. Dropped two patches from the earler series, as they were not

[PATCH v4 3/8] staging: rtl8192e: Remove unnecessary 'out of memory' message

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl warning: Possible unnecessary 'out of memory' message If it is out of memory, function should return with an appropriate error code. Since this function is of type void, a return statement is used. Signed-off-by: Suniel

[PATCH v3 6/8] staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct

2017-03-15 Thread sunil . m
From: Suniel Mahesh Replaced sizeof(struct foo) into sizeof(*ptr), found by checkpatch.pl Signed-off-by: Suniel Mahesh --- Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - Modified

[PATCH v3 4/8] staging: rtl8192e: Rectify pointer comparisions with NULL

2017-03-15 Thread sunil . m
From: Suniel Mahesh This patch simplifies code by replacing explicit NULL comparison with ! or unmark operator Reported by checkpatch.pl for comparison to NULL could be written '!foo' or 'foo' Signed-off-by: Suniel Mahesh --- Changes for v3: - Split

[PATCH v3 8/8] staging: rtl8192e: Fix blank lines and space after a cast

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl checks: Blank lines aren't necessary after an open brace '{' and before a close brace '}', removed No space is necessary after a cast, removed Please don't use multiple blank lines, removed Signed-off-by: Suniel Mahesh

[PATCH v3 2/8] staging: rtl8192e: Fix coding style

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl warning: line over 80 characters Signed-off-by: Suniel Mahesh --- Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - New patch addition to

[PATCH v3 7/8] staging: rtl8192e: Fix issues reported by checkpatch.pl

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl checks: spaces preferred around that 'operator', spacing provided Logical continuations should be on the previous line, modified accordingly Unnecessary parentheses around variables, removed Please use a blank line after

[PATCH v3 3/8] staging: rtl8192e: Remove unnecessary 'out of memory' message

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl warning: Possible unnecessary 'out of memory' message Signed-off-by: Suniel Mahesh --- Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H -

[PATCH v3 5/8] staging: rtl8192e: Fix unbalanced braces

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed unbalanced braces around else statement Add braces on all arms of the if-else statements to comply with kernel coding style. Signed-off-by: Suniel Mahesh --- Changes for v3: - Split earlier patches into multiple commits for

[PATCH v3 1/8] staging: rtl8192e: Fix comments as per kernel coding style

2017-03-15 Thread sunil . m
From: Suniel Mahesh Fixed the following checkpatch.pl warnings: Block comments should align the * on each line Block comments use * on subsequent lines Signed-off-by: Suniel Mahesh --- Changes for v3: - Split earlier patches into multiple commits

[PATCH v3 0/8] staging: rtl8192e: Fix coding style, warnings and checks

2017-03-15 Thread sunil . m
From: Suniel Mahesh Split earlier patches into multiple commits for easy review as suggested by Dan Carpenter. Modified subject, description and in few patches both for better readability as suggested by Greg KH. Fixed the following issues reported by checkpatch.pl: Block

[PATCH v2 2/5] staging: rtl8192e: Improve error handling

2017-03-09 Thread sunil . m
From: Suniel Mahesh Return -ENOMEM, if it is out of memory Signed-off-by: Suniel Mahesh --- Changes for v2: - Improve error handling reported by checkpatch.pl in rtl_core.c - new patch addition to the series - Rebased on top of next-20170306 ---

[PATCH v2 3/5] staging: rtl8192e: Rectify pointer comparisions

2017-03-09 Thread sunil . m
From: Suniel Mahesh Pointer comparison with NULL replaced by logical NOT Signed-off-by: Suniel Mahesh --- Changes for v2: - Rectify pointer comparisions reported by checkpatch.pl in rtl_core.c - new patch addition to the series - Rebased on top of

[PATCH v2 1/5] staging: rtl8192e: Fix coding style issues

2017-03-09 Thread sunil . m
From: Suniel Mahesh Fix coding style issues and comments in rtl_core.c Signed-off-by: Suniel Mahesh --- Changes for v2: - Split larger patch into multiple commits as suggested by Dan Carpenter - This patch fixes coding style issues, comments in

[PATCH v2 4/5] staging: rtl8192e: Fix unbalanced braces around else statement

2017-03-09 Thread sunil . m
From: Suniel Mahesh Fix unbalanced braces around else statement reported by checkpatch.pl Signed-off-by: Suniel Mahesh --- Changes for v2: - new patch addition to the series - Rebased on top of next-20170306 ---

[PATCH v2 5/5] staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct

2017-03-09 Thread sunil . m
From: Suniel Mahesh Prefer vzalloc(sizeof(*priv->pFirmware)...) over vzalloc(sizeof(struct rt_firmware)...) as reported by checkpatch.pl Signed-off-by: Suniel Mahesh --- Changes for v2: - new patch addition to the series - Rebased on top of

[PATCH v2 0/5] staging: rtl8192e: Fix coding style, warnings and checks

2017-03-09 Thread sunil . m
From: Suniel Mahesh Fixed coding style issues and improved error handling, return -ENOMEM, if it is out of memory instead of err message. Pointer comparisions with NUll are replaced by logical NOT. Fixed unbalanced braces around else statement and preferred to pass a