02 Oct, 2016
1 commit
-
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};@ok1@
identifier r1.i;
position p;
expression e1;
@@
(
sysfs_remove_group(e1,&i@p)
|
sysfs_create_group(e1,&i@p)
)@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;File size before:
text data bss dec hex filename
7551 1440 16 9007 232f
drivers/staging/speakup/kobjects.oFile size after:
text data bss dec hex filename
7671 1312 16 8999 2327
drivers/staging/speakup/kobjects.oSigned-off-by: Bhumika Goyal
Acked-by: Samuel Thibault
Signed-off-by: Greg Kroah-Hartman
22 Sep, 2016
3 commits
-
This issue was found by checkpatch.
Signed-off-by: Sandhya Bankar
Signed-off-by: Greg Kroah-Hartman -
This patch was found by checkpatch.
Signed-off-by: Sandhya Bankar
Signed-off-by: Greg Kroah-Hartman -
Issue found by checkpatch.
Signed-off-by: Katie Dunne
Signed-off-by: Greg Kroah-Hartman
12 Sep, 2016
1 commit
-
All operations with synth buffer should be protected,
as there are global pointers, which should be modified atomically.Found by Linux Driver Verification project (linuxtesting.org)
Signed-off-by: Pavel Andrianov
Acked-by: Vaishali Thakkar
Reviewed-by: Samuel Thibault
Signed-off-by: Greg Kroah-Hartman
16 Aug, 2016
2 commits
-
synth_add allows one to add MAXSYNTHS synths to the synths array;
however it always NULLifies the next synth in the array which
means that on the MAXSYNTHS synth we get an out-of-bounds write of
the NULL to the synths array. Make the synths array MAXSYNTHS + 1
elements in size to allow for the final NULL sentinal to avoid the
out-of-bounds write.Issue found wit CoverityScan, CID#744671
Signed-off-by: Colin Ian King
Reviewed-by: Samuel Thibault
Signed-off-by: Greg Kroah-Hartman -
Fix the checkpatch.pl warning "No space is necessary after a cast".
Signed-off-by: Laurence Rochfort
Signed-off-by: Greg Kroah-Hartman
21 May, 2016
1 commit
-
Pull staging and IIO driver updates from Greg KH:
"Here's the big staging and iio driver update for 4.7-rc1.I think we almost broke even with this release, only adding a few more
lines than we removed, which isn't bad overall given that there's a
bunch of new iio drivers added.The Lustre developers seem to have woken up from their sleep and have
been doing a great job in cleaning up the code and pruning unused or
old cruft, the filesystem is almost readable :)Other than that, just a lot of basic coding style cleanups in the
churn. All have been in linux-next for a while with no reported
issues"* tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits)
Staging: emxx_udc: emxx_udc: fixed coding style issue
staging/gdm724x: fix "alignment should match open parenthesis" issues
staging/gdm724x: Fix avoid CamelCase
staging: unisys: rename misleading var ii with frag
staging: unisys: visorhba: switch success handling to error handling
staging: unisys: visorhba: main path needs to flow down the left margin
staging: unisys: visorinput: handle_locking_key() simplifications
staging: unisys: visorhba: fail gracefully for thread creation failures
staging: unisys: visornic: comment restructuring and removing bad diction
staging: unisys: fix format string %Lx to %llx for u64
staging: unisys: remove unused struct members
staging: unisys: visorchannel: correct variable misspelling
staging: unisys: visorhba: replace functionlike macro with function
staging: dgnc: Need to check for NULL of ch
staging: dgnc: remove redundant condition check
staging: dgnc: fix 'line over 80 characters'
staging: dgnc: clean up the dgnc_get_modem_info()
staging: lustre: lnet: enable configuration per NI interface
staging: lustre: o2iblnd: properly set ibr_why
staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini
...
01 May, 2016
1 commit
-
Abstract TTY_THROTTLED bit tests with tty_throttled().
Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman
28 Mar, 2016
2 commits
-
Compiling speakup driver with sparse produces following warning:
drivers/staging/speakup/serialio.c:22:9: warning: incorrect type in
initializer (different base types)
drivers/staging/speakup/serialio.c:22:9: expected unsigned int
[unsigned] flags
drivers/staging/speakup/serialio.c:22:9: got restricted upf_tThis patch fixes it.
Signed-off-by: Okash Khawaja
Acked-by: Samuel Thibault
Signed-off-by: Greg Kroah-Hartman -
Previously, speakup would see the hi-font bit in attributes.
Since this bit has nothing to do with attributes, we need to clear it.Signed-off-by: Samuel Thibault
Signed-off-by: Greg Kroah-Hartman
12 Mar, 2016
1 commit
-
Use del_timer_sync to ensure timer is stopped on all CPUs before
the driver exists and the timer should not run when the module is
being removed. Since the timer is not called from an interrupt
context, this change is safe and will not cause deadlock.The Coccinelle semantic patch used to make this change is as
follows:
//
@r@
declarer name module_exit;
identifier ex;
@@module_exit(ex);
@@
identifier r.ex;
@@ex(...) {
}
//Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: Greg Kroah-Hartman
06 Mar, 2016
3 commits
-
Remove unnecessary test on synth->alive since it has already been
tested previously.This fixes the following smatch warning:
drivers/staging/speakup/synth.c:182 spk_synth_is_alive_restart() warn:
we tested 'synth->alive' before and it was 'false'Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: Greg Kroah-Hartman -
Remove multiple assignments by factorizing.
Coccinelle semantic patch used:
@@ identifier x,y; constant z; @@
- x=y=z;
+ x=z;
+ y=z;Signed-off-by: Alison Schofield
Signed-off-by: Greg Kroah-Hartman -
Add space around operator '|'. Problem found using checkpatch.pl
CHECK: spaces preferred around that '|' (ctx:VxV)Signed-off-by: Dilek Uzulmez
Signed-off-by: Greg Kroah-Hartman
15 Feb, 2016
1 commit
-
Use trailing */ on a separate line when it is a block comment.
This patch fixes the last of the checkpatch warnings for the file.Signed-off-by: Janani Ravichandran
Signed-off-by: Greg Kroah-Hartman
12 Feb, 2016
2 commits
-
Simplify function return by merging assignment and return into
one command line. Remove (now) unused local variable.Found using Coccinelle:
@@
expression e, ret;
@@-ret =
+return
e;
-return ret;Signed-off-by: Alison Schofield
Acked-by: Julia Lawall
Signed-off-by: Greg Kroah-Hartman -
This patch removes commented out code as it contributes to code clutter.
Signed-off-by: Janani Ravichandran
Signed-off-by: Greg Kroah-Hartman
08 Feb, 2016
2 commits
-
Fix checkpatch.pl check:CHECK: spaces preferred around that '|'.
Add spaces around operands to fix these warnings.Signed-off-by: Bhumika Goyal
Signed-off-by: Greg Kroah-Hartman -
We want the upstream staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman
02 Feb, 2016
2 commits
-
mn10300 uses an mmio-driven uart. This is not supported by speakup, so
prevent from enabling it.Signed-off-by: Samuel Thibault
Signed-off-by: Greg Kroah-Hartman -
This fixes a merge issue with the panel driver, and picks up fixes in
iio and other drivers that we want here.Signed-off-by: Greg Kroah-Hartman
01 Feb, 2016
1 commit
-
Pull tty/serial fixes from Greg KH:
"Here are some small tty/serial driver fixes for 4.5-rc2.They resolve a number of reported problems (the ioctl one specifically
has been pointed out by numerous people) and one patch adds some new
device ids for the 8250_pci driver. All have been in linux-next
successfully"* tag 'tty-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: 8250_pci: Add Intel Broadwell ports
staging/speakup: Use tty_ldisc_ref() for paste kworker
n_tty: Fix unsafe reference to "other" ldisc
tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
tty: Retry failed reopen if tty teardown in-progress
tty: Wait interruptibly for tty lock on reopen
29 Jan, 2016
8 commits
-
Previously, speakup would always read the non-scrolled part of the VT,
even when the VT is scrolled back with shift-page. This patch makes
vt.c export screen_pos so that speakup can use it to properly access
the content of the scrolled-back VT.This was tested with both vgacon and fbcon.
Signed-off-by: Samuel Thibault
Reviewed-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Commit f79b0d9c223c ("staging: speakup: Fixed warning
instead of ") broke the port information in the speakup
driver: SERIAL_PORT_DFNS only gets defined if asm/serial.h is included,
and no other header includes asm/serial.h.We here make sure serialio.c does get the arch-specific definition of
SERIAL_PORT_DFNS from asm/serial.h, if any.Along the way, this makes sure that we do have information for the
requested serial port number (index)Fixes: f79b0d9c223c ("staging: speakup: Fixed warning instead of ")
Signed-off-by: Samuel Thibault
Cc: stable # 3.18
Signed-off-by: Greg Kroah-Hartman -
FSF mailing address is no longer required to be specified. Hence
removed.
Detected using checkpatchSigned-off-by: Shraddha Barke
Signed-off-by: Greg Kroah-Hartman -
Fix "warning: expression using sizeof bool" messages caught by sparse.
Resending directly to SPEAKUP maintainers.Signed-off-by: Jeff Becker
Signed-off-by: Greg Kroah-Hartman -
This patch does the following:
* changed the complicated if statements to simple case statements
* in case of E_DEFAULT, no need to return error as ERESTART,
because this is the user asked for. Hence function should return success.
* ret variable is 0 always, hence removed it.
* removed one ternary operator, as it was always returning the status value only,
and hence removed the status variable tooSigned-off-by: Saurabh Sengar
Signed-off-by: Greg Kroah-Hartman -
Rewrite comparisons to NULL so they dont show any checkpatch errors anymore.
"vc_cons[i].d != NULL" => "vc_cons[i].d"Signed-off-by: Christian Colic
Signed-off-by: Greg Kroah-Hartman -
Fix checkpatch error: "braces {} should be used on all arms of this statement"
by adding the necessary braces around the "if".Signed-off-by: Christian Colic
Signed-off-by: Greg Kroah-Hartman -
Fix checkpatch check: CHECK: spaces preferred around that '-' (ctx:VxV)
Add spaces around operands to fix these warnings.Signed-off-by: Christian Colic
Reviewed-by: Luis de Bethencourt
Signed-off-by: Greg Kroah-Hartman
27 Jan, 2016
1 commit
-
As the function documentation for tty_ldisc_ref_wait() notes, it is
only callable from a tty file_operations routine; otherwise there
is no guarantee the ref won't be NULL.The key difference with the VT's paste_selection() is that is an ioctl,
where __speakup_paste_selection() is completely async kworker, kicked
off from interrupt context.Fixes: 28a821c30688 ("Staging: speakup: Update __speakup_paste_selection()
tty (ab)usage to match vt")
Cc:
Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman
05 Nov, 2015
1 commit
-
Pull staging driver updates from Greg KH:
"Here's the big staging driver update for 4.4-rc1. If you were
disappointed for 4.3-rc1 that we didn't contribute enough changesets,
you should be happy with this pull request of over 2400 patches.But overall we removed more lines of code than we added, which is nice
to see. Full details in the shortlog.All of these have been in linux-next for a while"
Greg, I've never been disappointed in how few commits Staging
contributes to the kernel.. Never.* tag 'staging-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (2431 commits)
Staging: rtl8192u: ieee80211: added missing blank lines
Staging: rtl8192u: ieee80211: removed unnecessary braces
Staging: rtl8192u: ieee80211: corrected block comments
Staging: rtl8192u: ieee80211: corrected indent
Staging: rtl8192u: ieee80211: added missing spaces after if
Staging: rtl8192u: ieee80211: added missing space around '='
Staging: rtl8192u: ieee80211: fixed position of else statements
Staging: rtl8192u: ieee80211: fixed open brace positions
staging: rdma: ipath: Remove unneeded vairable.
staging: rtl8188eu: pwrGrpCnt variable removed in store_pwrindex_offset function
staging: rtl8188eu: new variable for hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt] in store_pwrindex_offset function
staging: rtl8188eu: checkpatch fixes: 'Avoid CamelCase' in hal/bb_cfg.c
staging: rtl8188eu: checkpatch fixes: line over 80 characters splited into two parts
staging: rtl8188eu: checkpatch fixes: alignment should match open parenthesis
staging: rtl8188eu: checkpatch fixes: unnecessary parentheses removed in hal/bb_cfg.c
staging: rtl8188eu: checkpatch fixes: spaces preferred around that '|' in hal/bb_cfg.c
staging: rtl8188eu: operator = replaced by += in loop increment
staging: rtl8188eu: occurrence of the 5 GHz code marked
staging: rtl8188eu: increment placed into for loop header
staging: rtl8188eu: while loop replaced by for loop in rtw_restruct_wmm_ie
...
25 Oct, 2015
1 commit
-
Remove multiple assignments by factorizing them.Problem found using
checkpatch.pl
CHECK: multiple assignments should be avoidedSigned-off-by: Burcin Akalin
Signed-off-by: Greg Kroah-Hartman
20 Oct, 2015
1 commit
-
Signed-off-by: Ingo Molnar
17 Oct, 2015
3 commits
-
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
//
@@
type T;
identifier x;
constant C;
expression e;
@@T x
- = C
;
x = e;
//Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: Greg Kroah-Hartman -
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
//
@@
type T;
identifier x;
constant C;
expression e;
@@T x
- = C
;
x = e;
//Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: Greg Kroah-Hartman -
Thus using the preferred style for multi-line coments as
mentioned in Documentation/CodingStyle.It also silences 'Block comments use * on subsequent lines'
and 'Block comments use a trailing */ on a separate line'
checkpatch.pl warnings.Signed-off-by: Cristina Moraru
Signed-off-by: Greg Kroah-Hartman
13 Oct, 2015
1 commit
-
We want the fixes in here as well.
Signed-off-by: Greg Kroah-Hartman
08 Oct, 2015
1 commit
-
ARRAY_SIZE is more concise to use when the size of an array is divided
by the size of its type or the size of its first element.Changes made using Coccinelle-
@@
type T;
T[] E;
@@- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)Signed-off-by: Shraddha Barke
Signed-off-by: Greg Kroah-Hartman