Age | Commit message (Collapse) | Author |
|
Commenting out code is a bad idea.
As comments are for explaining what code is about.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
I believe there is a missing break in the switch statement for
case V4L2_CID_FOCUS_STATUS as the current fall-through looks
suspect to me.
Detected by CoverityScan, CID#1416580 ("Missing break in switch")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
There is no need to perform a null check on frame as there is an earlier
null check check and return hence making the null check redundant.
Remove it.
Detected by CoverityScan, CID#1416563 ("Logically Dead Code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
md_type is an enum. On my tests, GCC treats it as unsigned but
according to the C standard it's an implementation dependant thing so we
should check for negatives.
Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
The function atomisp_set_stop_timeout on being called, simply returns
back. The function hasn't been mentioned in the TODO and doesn't have
FIXME code around. Hence, atomisp_set_stop_timeout and its calls have been
removed.
This was done using Coccinelle.
@@
identifier f;
@@
void f(...) {
-return;
}
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Remove gc2235_init() function definition and call, as it is used only
once in gc2235.c file. Replace the function call with return value,
__gc2235_init() function call.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Simplify function return by merging assignment and return into a single
line. The following coccinelle script is used to fix this issue.
@@
expression e;
local idexpression ret;
@@
-ret = e;
-return ret;
+return e;
This patch also removes unnecessary declarations.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Bool initializations should use true and false instead of 1 and 0.
Detected by coccinelle/misc/boolinit.cocci.
Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
In bcm2835_audio_open_connection(), if VCHI connection fails or
initialisation of VCHI audio instance fails vchi_instance needs to be
deallocated otherwise it will cause a memory leak.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
This patch de-allocates work when queue_work(..) fails in the
bcm2835-audio work functions
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
* Refactor conditional to check if memory allocation has failed and
immediately return (-ENOMEM); if block for success case is removed.
* Return the error value -EBUSY when queue_work() fails.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
It is better to propagate PTR_ERR value instead of a hardcoded value
(-EPERM here)
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
This patch replaces NULL values returned by vc_vchi_audio_init(...) with
error pointer values:
- Return ERR_PTR(-EINVAL) when too many instances of audio
service are initialised
- Return ERR_PTR(-ENOMEM) when kzalloc fails
- RETURN ERR_PTR(-EPERM) when vchi connections fail to open
Similarly, a NULL check where vc_vchi_audio_init(...) is called is
replaced by IS_ERR(..)
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Replace kmalloc and memset with kzalloc.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
declarations
This patch fixes the warnings reported by checkpatch.pl
for please use a blank line after function/struct/union/enum
declarations.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
function prototype arguments like 'struct vb_device_info *','unsigned
long' etc. should have an identifier name.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Function return type is 'int'. Returned variable is of type
'uint'. uint can be implicitly converted to int. Most significant bit
is not set so there is no risk in implicit conversion.
Remove unnecessary type cast.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits CHECK: Blank lines aren't necessary before a close
brace '}'. Previous attempts were made to make uniform the error
handling in dgnc but improvements are still possible.
Undo whitespace changes that should not have been made :(. Make return
statement placement uniform throughout dgnc. Fix checkpatch
CHECK. Make whitespace changes only.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
In various functions a return code variable is defined at the top of
function, for example;
rc = -ENODEV;
and then the variable is returned. This makes it harder to read since
it separates the error code from the return site.
Return the error code directly instead of using a variable.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
function
Convert macro GAT_CONFIG to static inline function as static inline
functions are preferred over macros. This change is possible since the
arguments at all call sites have the same type.
The uses were updated with Coccinelle:
@r1@
expression dev,reg,chan,src;
@@
-GAT_CONFIG(chan, src)
+pci224_gat_config(chan, src)
Also, the comment describing the macro has been removed.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Simplify function return by merging assignment and return into a single
line. The following coccinelle script is used to fix this issue.
@@
expression e;
local idexpression ret;
@@
-ret = e;
-return ret;
+return e;
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
This patch adjusts lines so that they are less than 80 char.
Checkpatch.pl idenitified the issue.
Signed-off-by: Craig Inches <Craig@craiginches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.
Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fix coding style issue.
Signed-off-by: Maciej Billewicz <maciej.billewicz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits ERROR: Macros with complex values should be enclosed
in parentheses. Error may be fixed by adding parentheses around macro
definition, macros are simple arithmetic statement.
Add parentheses around macro definitions. Fix 24 cases of identical
error. Do commented out macros also to save the next developer from
having to add them.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits various warnings, errors and checks;
ERROR:TRAILING_WHITESPACE: trailing whitespace
WARNING:SPACE_BEFORE_TAB: please, no space before tabs
WARNING:SPACE_BEFORE_TAB: please, no space before tabs
ERROR:CODE_INDENT: code indent should use tabs where possible
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
These are all trivial whitespace fixes. Fix them all in one
patch. Change only whitespace.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
'auth_type - 1' is used as an index into a key table. Adding a variable
appropriately named simplifies the code and adds meaning when
reading. Adding a pointer variable of type struct *kpa_key_t adds to
readability by removing the table access each time the key is used.
The key index is used to create a string so having it named adds
additional meaning when creating the string.
Declare variable 'key_index' and define it at declaration time. Declare
a pointer variable 'key' and define it to point to the correct key in
the key table.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Comment string is unnecessarily verbose. Checkpatch emits WARNING:
line over 80 characters.
Reduce comment string without loss of meaning.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits WARNING: quoted string split across lines. Line is
already over 80 characters long, adding 3 more does little to effect
line length while improving readibility.
Concatenate split string into single line.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits various warnings and checks;
WARNING: Avoid multiple line dereference
CHECK: Alignment should match open parenthesis
WARNING: line over 80 characters
CHECK: Blank lines aren't necessary before a close brace '}'
These are all whitespace fixes.
Refactor whitespace inline with kernel coding style. Fix various
checkpatch warnings.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits CHECK: Logical continuations should be on the
previous line. Also the same code section causes checkpatch to emit
WARNING: Avoid multiple line dereference.
Move logical line continuations onto the previous line. Move multiple
line dereferences onto single line.
Make these two changes in a single patch to give review a chance
to critique the final layout of the *complex* logical statement.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Code is deeply nested. One level of indentation may be removed by
inverting if statement conditional.
Invert conditional, return if new conditional evaluates to true.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Checkpatch emits WARNING: Too many leading tabs - consider code
refactoring. Function contains 5 levels of nesting and 14 local
variables. Code can be simplified and nesting reduced by refactoring
into separate functions.
WPA code is contained and may be factored out into a separate
function. This will reduce the length and complexity of
hostif_data_indication(). At times within the WPA code errors result
in the function returning. In order to maintain this behaviour new
function should return a status integer.
Factor out WPA code into separate function. Add only code needed to
get compilation to pass, including modifying return statements. Make
no other code changes, program logic is unchanged.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
This supports spelling unicode characters by just passing them to
the speech synthesis in direct mode.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
9831013cbdbd3d06430a1db01d8c32d50c7d1c04 ('speakup: convert screen
reading to 16bit characters') paved the way for handling unicode
characters in speakup, but for the review mode, it missed actually
getting unicode characters from the VC. This fixes by just turning the
use_unicode parameter to 1.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Tested-by: Zahari Yurukov <zahari.yurukov@gmail.com>
Reviewed-by: Chris Brannon <chris@the-brannons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fixed alignment of block commenents across whole driver.
Found using checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Changed permissions to octal across whole driver
Found by checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
All devm functions has a device structure as the first argument which is
required by dev_{err,info,dbg} printing functions.
This patch converts pr_err to dev_err as dev_* is preferred after calls
to devm functions.
Done using coccinelle:
@r1 exists@
expression e,e1;
identifier f =~ "^devm_";
identifier g =~ "^pcim_";
identifier h =~ "^dmam_";
@@
e=\(f\|g\|h\)(e1,...);
<+...
(
- pr_info(
+ dev_info(e1,
...);
|
- pr_err(
+ dev_err(e1,
...);
|
- pr_debug(
+ dev_dbg(e1,
...);
)
...+>
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Reduce the indentation level in spk_msg_set and remove
unnecessary return variable.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
The possible return values (0 or 1) for compare_specifiers
and fmt_validate represent whether a condition holds or not, so
conceptually, they are booleans.
Update documentation for these two functions.
Change type of variable 'still_comparing' from int to bool too,
inside fmt_validate, because it is intended to hold truth values
as well.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Signed-off-by: Alex Yashchenko <alexhoppus111@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fix bad indentation as reported by checkpatch.pl script.
Signed-off-by: Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
The patch resolves the checkpatch warning:
WARNING: function definition argument should also have an identifier name
Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
The sematic patch used for this is:
@@
identifier i;
constant c;
@@
return
- (
\(i\|-i\|i(...)\|c\)
- )
;
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
The sematic patch used for this is:
@@
identifier i;
constant c;
@@
return
- (
\(i\|-i\|i(...)\|c\)
- )
;
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
sparse report fixed:
drivers/staging//wlan-ng//hfa384x_usb.c:3517:35: warning: restricted __be64 degrades to integer
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: warning: incorrect type in assignment (different base types)
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: expected restricted __be64 [usertype] mactime
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: got unsigned long long
Computation on the value should be done when in machine format, not in big endian format.
Signed-off-by: Adrien Descamps <adrien.descamps@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fix some sparse warning by using correct endian types in structs and
local variables.
This patch only fix sparse warnings and do not change the logic.
Signed-off-by: Adrien Descamps <adrien.descamps@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Fixes following checkpatch warning:
"WARNING: %Lx is non-standard C, use %llx"
Signed-off-by: Manoj Sawai <mas@iitkgp.ac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|