Commit Graph

389 Commits

Author SHA1 Message Date
Daeseok Youn 3ca4b20a76 staging: dgnc: remove redundant local variable for
The local variable "bd" was not used in dgnc_carrier() function.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15 19:06:09 +02:00
Daeseok Youn 290e3abacc staging: dgnc: remove useless error value assignment
The "result" variable in dgnc_get_mstat() was initialized with
"-EIO". But if the "ch" is not null, "result" will be set to zero
and if the "ch" is null, dgnc_get_mstat() will return "-ENXIO" as
an error. So "-EIO" error value was useless in dgnc_get_mstat().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15 19:06:09 +02:00
Daeseok Youn 10334418d6 staging: dgnc: remove redundant NULL checks in
The dgnc_block_til_ready() is only used in dgnc_tty_open().
The unit data(struct un_t) was stored into tty->driver_data in dgnc_tty_open().
And also tty and un were tested about NULL so these variables doesn't
need to check for NULL in dgnc_block_til_ready().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15 19:06:09 +02:00
Joshua Houghton 598b1529d6 staging: dgnc: add __exit macro to dgnc_driver.c
Add the __exit macro to the dgnc_cleanup_module(void) function
in dgnc_driver.c

Signed-off-by: Joshua Houghton <josh@awful.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15 19:06:09 +02:00
Linus Torvalds 2f37dd131c Staging and IIO driver update for 4.7-rc1
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.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlc/00QACgkQMUfUDdst+ynXYQCdG9oEsw4CCItbjGfQau5YVGbd
 TOcAnA19tZz+Wcg3sLT8Zsm979dgVvDt
 =9UG/
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

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
  ...
2016-05-20 22:20:48 -07:00
Daeseok Youn bddb153108 staging: dgnc: Need to check for NULL of ch
the "ch" from brd structure could be NULL, it need to
check for NULL.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09 14:10:03 +02:00
Daeseok Youn c246e2305a staging: dgnc: remove redundant condition check
dgnc_board(brd) was already checked for NULL before calling
neo_parse_isr(). And also port doesn't need to check.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09 14:10:03 +02:00
Daeseok Youn edd19a2f9f staging: dgnc: fix 'line over 80 characters'
fix checkpatch.pl warning about 'line over 80 characters'.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09 14:10:03 +02:00
Daeseok Youn a5b90ef7a1 staging: dgnc: clean up the dgnc_get_modem_info()
the "ch" in dgnc_get_modem_info() was already checked before calling
this function and also if "ch" is not NULL, dgnc_get_mstat() returns
valid value so it doesn't need to check an error.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09 14:10:03 +02:00
Daeseok Youn a0ca97b808 staging: dgnc: Fix a NULL pointer dereference
The error handling for print_drive after calling tty_alloc_driver()
was needed. But there was error handling but too late for this.
Error handling code moved after tty_alloc_driver() call.

Fixes: 60b3109e5e ("staging: dgnc: use tty_alloc_driver instead of kcalloc")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 22:57:14 -07:00
Peter Hurley 18900ca65a tty: Replace TTY_IO_ERROR bit tests with tty_io_error()
Abstract TTY_IO_ERROR status test treewide with tty_io_error().
NB: tty->flags uses atomic bit ops; replace non-atomic bit test
with test_bit().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30 09:26:55 -07:00
Daeseok Youn 60b3109e5e staging: dgnc: use tty_alloc_driver instead of kcalloc
The tty_alloc_driver() can allocate memory for ttys and termios.
And also allocated memory will be released easily with
put_tty_driver() call.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn e47e7379ce staging: dgnc: remove redundant NULL check in
There were already checking NULL about channel_t / un_t
before calling dgnc_maxcps_room().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn 16f10a825d staging: dgnc: return -ENOMEM when kzalloc failed
The kzalloc can be failed when memory is not enough
to allocate. When kzalloc failed, it need to return
error code with ENOMEM

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn 6b3752d8ce staging: dgnc: remove blank line
fix checkpatch.pl warning:
Blank lines aren't necessary after an open brace '{'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn ea753f2a59 staging: dgnc: remove parenthesis around the CONST |
remove parenthesis around the CONST | CONST.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Juanma de Hoyos 24039c589b drivers/staging/dgnc: Added spaces around a bitwise OR.
Coding rules request placing bitwise OR operators between empty spaces
for better readibility. This patch applies this format to a line in
dgnc_tty.c file.

Signed-off-by: Juanma de Hoyos <juanmahv@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn b9f8463728 staging: dgnc: fix CamelCase in dgnc_tty.c
fix checkpatch.pl warning about 'Avoid CamelCase'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-04 12:41:24 -07:00
Daeseok Youn 8670a56ff7 staging: dgnc: remove too many traverse pointer
The "ch->ch_bd" is already assined to "bd" but this is only
for checking null or MAGIC number.
in the dgnc_tty_ioctl function, bd can be used for referencing
to board_ops structure.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-04 12:41:24 -07:00
Daeseok Youn 56d118c243 staging: dgnc: clean up dgnc_input function
This is for fixing checkpatch.pl warning about
"Alignment should match open parenthesis" but if that is
fixed, code line is over 80 characters.
I think "ch->ch_rqueue + tail + i" could be declared once in
the begining of loop.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-31 13:11:27 -07:00
Daeseok Youn e491e716dc staging: dgnc: remove useless variables for saving tty's
It doesn't need to save major number with variable.
And there are no use of these variables(dgnc_serial_major and
dgnc_transparent_print_major)

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-31 13:11:27 -07:00
Daeseok Youn 3996ae3482 staging: dgnc: fix Logical continuations.
fix checkpatch.pl warning about
'Logical continuations should be on the previous line'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 21:06:17 -07:00
Daeseok Youn ffe4f32946 staging: dgnc: fix 'line over 80 characters'
fix checkpatch.pl warning about 'line over 80 characters'.
I just moved all line comment to above if statement.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 21:06:17 -07:00
Daeseok Youn a1115c9f78 staging: dgnc: remove parenthesis around the CONST |
remove parenthesis around the CONST | CONST.
It will be also fixed checkpatch.pl warning about
"Alignment should match open parenthesis" becasue
parenthesis were removed by this patch.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 21:06:17 -07:00
Daeseok Youn d8bf4bee49 staging: dgnc: replace dgnc_offset_table with bit shift.
the dgnc_offset_table has a same value with (1 << port).
So I tried to replace dgnc_offset_table array with 1 << port.
And also there are redundant assignments(tmp and current_port)
inside while loop for checking uart port, and remove them.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 21:06:17 -07:00
Daeseok Youn 318723e4ff staging: dgnc: fix Logical continuations should be on the
fix checkpatch.pl warning about 'Logical continuations
should be on the previous line' in dgnc_neo.c file.

I think the 'force' need to check first, because if the 'force' is true,
it doesn't need to call another function call.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Daeseok Youn 6175e73dee staging: dgnc: fix 'line over 80 characters'
fix checkpatch.pl warning about 'line over 80 characters'
in dgnc_neo.c

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Daeseok Youn 195d85c1a0 staging: dgnc: remove unused variable in dgnc_board
TtyRefCnt was not used anywhere in dgnc.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Daeseok Youn a25ad52020 staging: dgnc: fix CamelCase in dgnc_drvier.h and
fix checkpatch.pl warning about CamelCase

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Daeseok Youn 80e3e241fa staging: dgnc: fix CamelCase in dgnc_driver.c
fix checkpatch.pl warning about CamelCase.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Daeseok Youn 992aa7b59f staging: dgnc: fix camelcase of SerialDriver and PrintDriver
fix the checkpatch.pl warning about CamelCase.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sam Horlbeck Olsen 57d8dfed85 staging: dgnc: Add whitespace around OR'd flags ("|")
This patch fixes the checkpatch.pl message:

CHECK: spaces preferred around that '|' (ctx:VxV)
+	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
                                    ^                   ^

As per the guidelines for coding style in the kernel, I have updated the
digi international driver to include spaces around the OR'd flags; not only
is this formatting issue caught by `checkpatch.pl`, in the next `if` block
the correct formatting is used, leading to both incorrect and inconsistent
code formatting.

This patch puts the line in question at 82 characters---while this is over
the recommended limit, there are no clear locations to break the line and it
barely breaks the cutoff.

Signed-off-by: Sam Horlbeck Olsen <sam.horlsen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Linus Torvalds 9dffdb38d8 Staging driver patches for 4.6-rc1
Here is the big staging driver pull request for 4.6-rc1.
 
 Lots of little things here, over 1600 patches or so.  Notible is all of
 the good Lustre work happening, those developers have finally woken up
 and are cleaning up their code greatly.  The Outreachy intern
 application process is also happening, which brought in another 400 or
 so patches.  Full details are in the very long shortlog.
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlbrc3EACgkQMUfUDdst+ylu5ACgpdTKjrZn2vHElW3GRhTpzJdQ
 wz8AoJDeur2DmBkQrKD5/u/WL4UTRNZJ
 =+Q6N
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here is the big staging driver pull request for 4.6-rc1.

  Lots of little things here, over 1600 patches or so.  Notable is all
  of the good Lustre work happening, those developers have finally woken
  up and are cleaning up their code greatly.  The Outreachy intern
  application process is also happening, which brought in another 400 or
  so patches.  Full details are in the very long shortlog.

  All of these have been in linux-next with no reported issues"

* tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits)
  staging: lustre: fix aligments in lnet selftest
  staging: lustre: report minimum of two buffers for LNet selftest load test
  staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
  staging: lustre: filter remaining extra spacing for lnet selftest
  staging: lustre: remove extra spacing when setting variable for lnet selftest
  staging: lustre: remove extra spacing of variable declartions for lnet selftest
  staging: lustre: fix spacing issues checkpatch reported in lnet selftest
  staging: lustre: remove returns in void function for lnet selftest
  staging: lustre: fix bogus lst errors for lnet selftest
  staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc
  staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc
  staging: android: ion: fix up file mode
  staging: ion: debugfs invalid gfp mask
  staging: rts5208: Replace pci_enable_device with pcim_enable_device
  Staging: ieee80211: Place constant on right side of the test.
  staging: speakup: Replace del_timer with del_timer_sync
  staging: lowmemorykiller: fix 2 checks that checkpatch complained
  staging: mt29f_spinand: Drop void pointer cast
  staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN
  staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED
  ...
2016-03-17 22:13:41 -07:00
Sudip Mukherjee 18f038e6bf staging: dgnc: cleanup properly
dgnc_cleanup_module() was called when the module unloaded to do a total
cleanup and it was also called if pci_register_driver() fails. But
dgnc_cleanup_module() will try dgnc_remove_driver_sysfiles() but the
sysfiles will be created only if pci_register_driver() succeeds.
So if pci_register_driver() fails and we try dgnc_cleanup_module() then we
were getting:

[  942.001479] BUG: unable to handle kernel NULL pointer dereference at 00000018
[  942.001482] IP: [<c122c7a8>] sysfs_remove_file_ns+0x8/0x20

with part of the call trace as:

[  942.001544] Call Trace:
[  942.001555]  [<c149acc6>] driver_remove_file+0x16/0x20
[  942.001571]  [<f864a708>] dgnc_remove_driver_sysfiles+0x18/0x40 [dgnc]
[  942.001575]  [<f8643ac7>] dgnc_cleanup_module+0x47/0x260 [dgnc]
[  942.001577]  [<f86cb000>] ? 0xf86cb000
[  942.001580]  [<f86cb1e6>] dgnc_init_module+0x1e6/0x1000 [dgnc]

Lets have a separate cleanup function which will execute
dgnc_remove_driver_sysfiles() depending on the argument passed to it.

Reported-by: Navy Cheng <navych@126.com>
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sudip Mukherjee b3ca2e08e7 staging: dgnc: unregister pci driver
We may choose to load the module without the hardware present. That will
register the pci driver but since probe will not succeed so
dgnc_NumBoards will be 0. Now if we unload the module then the pci
driver stays registered as dgnc_NumBoards is 0. And if we try to load
the module again it fails with the error:
"Driver 'dgnc' is already registered."

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sudip Mukherjee e9961fc16f staging: dgnc: remove pci_unregister_driver
If pci_register_driver() fails then dgnc_NumBoards can never be more
than zero. dgnc_NumBoards is incremented only at the end of a successful
probe. And moreover if the pci driver has failed to register then we
never need to unregister it. Lets just print the warning, perform the
cleanup and exit with the error code.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sudip Mukherjee 757b816e40 staging: dgnc: remove unneeded else
If pci_enable_device() fails then we can return directly.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Rehas Sachdeva 8d0d4cc5a4 staging: dgnc: Break line after boolean operator
The preferred way to break up long math lines is to break after an arthimetic
or boolean operator. This patch fixes the checkpatch.pl warning:
Logical continuations should be on the previous line.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Rehas Sachdeva 8e8d27f7d5 staging: dgnc: Fix block comment style
This patch fixes the block comment style.
1. The checkpatch.pl warning:
Block comments use a trailing */ on a separate line.
2. '====' separator is unnecessary and should not be used.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Rehas Sachdeva 05b30f4999 staging: dgnc: Avoid multiple blank lines
This patch fixes the checkpatch.pl warnings regarding multiple blank
lines as single blank line is the preferred coding style.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Rehas Sachdeva adcb56f92e staging: dgnc: Add spaces around '|' and '<<'
One space on either side of binary and ternary operators is preferred.
This patch fixes the related checkpatch.pl warnings.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Eva Rachel Retuya 0b7ceaa665 staging: dgnc: delete parentheses around right hand side of assignment
Eliminate unneeded parentheses around the right hand side of an
assignment. Coccinelle semantic patch used:
@@
expression e1, e2;
identifier v;
@@

(
 v = (e1 == e2)
|
 v = (e1 != e2)
|
 v = (e1 <= e2)
|
 v = (e1 >= e2)
|
 v =
- (
	e1
- )
)

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Hari Prasath Gujulan Elango 127bf16602 staging: dgnc: convert to wait_event_interruptible_timeout
This patch makes use of wait_event_interruptible_timeout to achieve
timeout functionality.This is a TODO mentiond in the comment which is also
removed.It also aligns with what the function is supposed to do as in the
comments.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:51:46 -08:00
Peter Hurley 9db276f8f0 tty: Use termios c_*flag macros
Expressions of the form "tty->termios.c_*flag & FLAG"
are more clearly expressed with the termios flags macros,
I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG().

Convert treewide.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-28 14:13:44 -08:00
Peter Hurley 6aa56785e7 staging: digi: Replace open-coded tty_wakeup()
The open-coded tty_wakeup()s are attempts to workaround fixed bugs
in the line discipline write_wakeup() method. Replace with tty_wakeup().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-27 15:01:42 -08:00
Jitendra Kumar Khasdev 6e411751f0 staging: dgnc: dgnc_cls.c: Replaced udelay by usleep_range
This patch is to file dgnc_cls.c that fixes up udelay function by
usleep_range.
It is safe to use according to the following documentation
Documentation/timers/timers-howto.txt. So that is why I have given
an appropriate time range.

Signed-off-by: Jitendra Kumar Khasdev <jkhasdev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:52:34 -08:00
Nizam Haider f7f2b10a82 Staging: dgnc: dgnc_tty: Typo error dgnc_wmove comment
Fix Typo errror in the comment section of dgnc_wmove

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:50:59 -08:00
Nizam Haider 013514946c Staging: dgnc: dgnc_neo.c Braces {} should be used on all arms of this statement
Fix Checlpatch warning
HECK: braces {} should be used on all arms of this statement

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:50:59 -08:00
Bogicevic Sasa 5bff5d9f2b driver:staging:dgnc Fix spaces preferred around that ...
This fixes all "spaces preferred around that ..." messages from
checkpatch.pl

Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:50:56 -08:00
Shraddha Barke b4f286a953 Staging: dgnc: Remove unused #include header file
Since the things defined by digi.h are not used in dgnc_utils.c,
remove the header from this file.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla f4edff5208 staging: dgnc: dgnc_driver: Remove useless initialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Amitoj Kaur Chawla d09c1b96a7 staging: dgnc: dgnc_tty: Remove useless initialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Cristina Moraru 51c826f073 staging: dgnc: Fix lines over 80 characters
Fix 'line over 80 characters' checkpatch.pl
warnings

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Salva Peiró 4b6184336e staging/dgnc: fix info leak in ioctl
The dgnc_mgmt_ioctl() code fails to initialize the 16 _reserved bytes of
struct digi_dinfo after the ->dinfo_nboards member. Add an explicit
memset(0) before filling the structure to avoid the info leak.

Signed-off-by: Salva Peiró <speirofr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:51:40 -07:00
Parshuram Thombare 36e712a8a1 staging: dgnc: simplify a trivial if-return sequence
Signed-off-by: Parshuram Thombare <thombarepr@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:09:51 -07:00
Sudip Mukherjee 7df227c4ec staging: dgnc: remove parenthesis
checkpatch was warning us about extra unneeded parenthesis.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Sudip Mukherjee e352d3f19e staging: dgnc: alignment style
checkpatch was warning us that the alignment should match the open
parenthesis.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Sudip Mukherjee 6f418259ec staging: dgnc: remove space after cast
Space is not necessary after typecast.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Sudip Mukherjee 205fc1fc95 staging: dgnc: remove blankline after brace
Blank lines are not needed after opening braces. checkpatch was giving
us warnings about this.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Sudip Mukherjee 40215ddffc staging: dgnc: remove blankline before brace
Blank lines are not needed before closing braces. checkpatch was giving
warning about this.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Sudip Mukherjee 9753007ed7 staging: dgnc: remove multiple blank lines
checkpatch warns us about multiple blank lines which are not needed.
Remove them.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Salah Triki 51abf45c23 staging: dgnc: take a lock when storing value in dgnc_poll_tick
Reads of dgnc_poll_tick are protected by dgnc_poll_lock spinlock, but the write
to dgnc_poll_tick is not. It could theoretically race.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:14 +01:00
Sudip Mukherjee 6d99d6a3cf staging: dgnc: remove dgnc_init_globals function
The dgnc_init_globals() function is only initializing the timer so
initialize it directly and remove dgnc_init_globals() and change the
comment appropriately.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:14 +01:00
Sudip Mukherjee 482e191d61 staging: dgnc: remove initialization of global
globals variable will be initialied to 0 and the global pointers will be
to NULL. No need to initialize them separately.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:14 +01:00
Sudip Mukherjee e24bb0ed81 staging: dgnc: remove NULL test
This NULL test is not required as iounmap will validate the argument.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:13 +01:00
Sudip Mukherjee 60acb623c9 staging: dgnc: change style of NULL comparison
Change the NULL comparison style as warned by checkpatch.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:10 +01:00
Sudip Mukherjee 2d9920eca4 staging: dgnc: remove unused variables
These variables were only assigned some values but were never used.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:52:32 +01:00
Cristina Moraru 851f306d6e staging: dgnc: Fix line over 80 characters warning
Fix 'line over 80 characters' checkpatch warning

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:52:32 +01:00
Cristina Moraru c76d294f32 staging: dgnc: Fix indentation warning
Fixed 'suspect code indent for conditional statements (8, 24)' Warning

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:36:00 +02:00
Anjali Menon 4ddc2f06c8 staging: dgnc: Fixed line over 80 characters long
This is a patch that fixes line over 80 characters coding style
warning detected by checkpatch.pl.

WARNING: line over 80 characters

Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:44 -07:00
Joe Perches 35bb99bf65 staging: dgnc: Remove unnecessary externs
Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:51:57 -07:00
Navy Cheng f3c709b8fc Staging: dgnc: dgnc_driver.h: remove unnecessary comments
The public headers is well known by others and the redundant commits make
the code mess. Remove the comments of the public headers to make the code
tidy.

Signed-off-by: Navy Cheng <navych@126.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:14:53 -07:00
Hari Prasath Gujulan Elango 7f5ad01816 staging: dgnc: free memory allocated
The memory allocated in dgnc_tty_register() for two objects is not freed
anywhere.This patch addresses this by freeing the memory in
dgnc_tty_uninit.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 21:15:17 -07:00
Hari Prasath Gujulan Elango d8a76d669a staging: dgnc: fix typo in comments secion
This patch fixes a typo in the comments section as warned by
checkpatch.pl

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 21:13:48 -07:00
Hari Prasath Gujulan Elango 0aae092b5e staging: dgnc: remove ununsed Macro
Remove the ununsed Macro

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:30:04 -07:00
Gujulan Elango, Hari Prasath (H.) 7960386273 staging: dgnc: delete all references to 'flipbuf'
This patch deletes all references to 'flipbuf'.Memory is allocated and
freed but never used anywhere in the driver.Also deleted an ununsed
Macro defined in the header file.

Signed-off-by: Gujulan Elango Hari Prasath <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:26:27 +09:00
Wim de With 8ad524ffb2 staging: dgnc: fix line length over 80 chars in dgnc_sysfs.c
This patch fixes most of the lines over 80 characters long in
dgnc_sysfs.c. I couldn't find a way to break line 202-207 in a sensible
way. If there is a way, let me know.

Signed-off-by: Wim de With <nauxuron@wimdewith.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:26:27 +09:00
Buţiu Alexandru Octavian b2d3977f7d Staging: dgnc: fixed coding style issue in digi.h
Fixed coding style issue "warning line over 80 characters"
detected by checkpatch.pl in digi.h

Signed-off-by: Buţiu Alexandru Octavian <predator5047@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:26:26 +09:00
Giedrius Statkevičius eef94f6b7b staging: dgnc: remove redundant check
count doesn't get changed in between identical checks in
dgnc_tty_write() so remove the second check

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:01 +02:00
Giedrius Statkevičius a74d8e2167 staging: dgnc: remove dead code in dgnc_tty_write()
Remove the dead code protected by in_user in dgnc_tty_write() because it
is set to 0 and never changed to 1 thus the code in ifs never gets
executed.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:01 +02:00
Giedrius Statkevičius 071494d832 staging: dgnc: remove redundant !ch checks
Remove checks that are redundant since we don't have boards with partially
initialized ->channels[i].

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:00 +02:00
Giedrius Statkevičius ce2927e9a3 staging: dgnc: don't forget to check if ->channels[i] is NULL in dgnc_tty_uninit()
Add a check if ->channels[i] is NULL because a NULL pointer may be dereferenced
in case one of the allocations failed

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:00 +02:00
Giedrius Statkevičius fa52d96c3e staging: dgnc: clean up allocation of ->channels[i]
Check if kzalloc fails in dgnc_tty_init() and if it does then free all
previously allocated ->channels[i] and set them to NULL. This makes the code
less error/bug prone because instead of needing programmers attention to add
checks everywhere we do that in one place. Also, remove a bogus comment and
check in the same loop because ->channels[i] isn't allocated anywhere else.
Finally, remove a unnecessary check if ->channels[i] is NULL in the next loop
because it can't be.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:00 +02:00
Giedrius Statkevičius 86b4e7e270 staging: dgnc: remove some dead code from dgnc_tty.c
Remove some dead code that will never be executed or which serves no purpose

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:59 +02:00
Carlos E. Garcia 69e98df782 Staging: fixed multiple spelling errors.
Fixed multiple spelling errors.

Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:58 +02:00
Ioana Ciornei c471c989ad staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err()
Fix the following checkpatch warning:
WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:37:57 +02:00
Giedrius Statkevičius c754ff966d dgnc: Clean up dgnc_sysfs.h
Remove redundant blank lines, move absolute include after relative
include.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:41:00 +01:00
Giedrius Statkevičius 3b84f2d910 dgnc: remove unused stuff from dgnc_cls.h
Remove unused defines from dgnc_cls.h

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:41:00 +01:00
Giedrius Statkevičius 20dad75285 dgnc: remove old 2.4-2.6 compat kernel defines
dgnc_kcompat.h contains some old legacy defines in case the kernel
doesn't have __user defined but for current kernel versions these
defines don't make sense and are useless so remove them. Move the
TTY_FLIPBUF_SIZE define to digi.h because it's used in the code.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:40:59 +01:00
Giedrius Statkevičius d533a524a8 dgnc: use linux/types.h instead of dgnc_types.h
Dgnc_types.h unnecesarily defines TRUE as 1 and FALSE as 0 because we
already have a widely used linux/types.h so convert all TRUE to true,
FALSE to false and edit the dgnc_board struct to make sure it uses
"bool".

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:40:59 +01:00
Giedrius Statkevičius 850b41f7ba dgnc: get rid of dpacompat.h, move remaining stuff to digi.h
Dpacompat.h contained a lot of unused #defines and only few things are
used from it so since we've trimmed down digi.h, now we can delete
dpacompat.h and move remaining stuff into digi.h.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:40:59 +01:00
Giedrius Statkevičius 944b3ad426 dgnc: clean up digi.h
Remove a lot of unused structs and defines from digi.h. We still have to
be careful with TIOCM_LE and TIOCMSET/TIOCMBIC because termios.h and
ioctls.h respectfully redefine them.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:40:59 +01:00
Giedrius Statkevičius f82d189c33 dgnc: remove unused dgnc_ioctl_name() command
dgnc_ioctl_name() is never used anywhere so remove it

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:40:59 +01:00
Dan Carpenter 4bef52f377 staging: dgnc: some off by one bugs
"dgnc_NumBoards" is the number of filled out elements in the
dgnc_Board[] array.  "->nasync" and "->maxports" are the same value.
They are the number of channels in the ->channels[] array so these tests
should be ">=" instead of ">" so we avoid reading past the end of the
arrays.

I cleaned up the conditions in dgnc_mgmt_ioctl() a bit.  There was a
work around for the off by one bug in the case where there were no
boards which is no longer needed.  "channel" is unsigned so it can't be
negative.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 15:31:24 +01:00
Quentin Lambert 5ec2936508 Staging: dgnc: release the lock before testing for nullity
The refactoring intrduced in
c84a083b99 ("Staging: dgnc: Use goto for spinlock release before return")
inverts the order in which the lock is released and ld is tested for nullity.

This patch restores the execution flow.

Fixes: c84a083b99 ("Staging: dgnc: Use goto for spinlock release before return")
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 17:34:11 +01:00
Quentin Lambert c84a083b99 Staging: dgnc: Use goto for spinlock release before return
spin_unlock_irqrestore() is called at several
different places before exiting. This patch uses a goto statement
to factorize these calls.

Coccinelle was used to generate this patch.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:13:41 +01:00
Quentin Lambert f6a14cf04f Staging: dgnc: Use goto for error handling
This patch introduces goto statments for error handling
and in cases where a lock needs to be released.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@candidates exists@
identifier f, label;
statement s;
position p1, p2, p3;
@@

  f@p1(...) {
  ...when any

    if@p2(...) {
    ...when any
      s

      return@p3 ...;
    }
  ...when any
  }

@good1 exists@
identifier candidates.f, candidates.label;
statement candidates.s;
position candidates.p1, candidates.p2;
@@

  f@p1(...) {
  ...when any

    if(...) {
    ...when any
      s
      return ...;
    }
    ...when any

    if@p2(...) {...}
  ...when any
 }

@depends on good1@
identifier candidates.f, candidates.label;
position candidates.p1, candidates.p3;
@@

   f@p1(...) {
   ...when any
*  return@p3 ...;
  }

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:13:41 +01:00
Somya Anand 64e784c457 Staging: dgnc: Remove redundant parentheses
This patch removes the redundant parentheses inorder to make code
simplified. While doing this, the precedence order of the operation
is taken into consideration to keep the logic of the code intact.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:12:28 +01:00
Quentin Lambert 9f9de64c09 Staging: dgnc: dgnc_driver: Add a missing call to dgnc_tty_uninit
This function is called on the previous and the next failure branches.
This patch adds the call on the branch where it seems to be missing.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:12:28 +01:00
Giedrius Statkevičius 1f2e089f68 dgnc: clean up comments at start of files
Remove FSF address because it's known in the past that it has changed.
Also, remove the pointless "do not change the coding style" comments
because it's one of the reasons why it's in staging and it's quite
contradictory to what it says in TODO. Also, they contain wrong e-mails
of people which are responsible for these drivers - see TODO or
MAINTAINERS for that. We can preserve the original copyright at the top
of the most files because it shows who originally made them.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:11:17 +01:00
Giedrius Statkevičius d7f355d7b0 dgnc: Remove unneeded dgnc_state array of strings
Dgnc_state array of strings is never used anywhere and it seems pretty
useless anyway since the board state enum names speak for themselves.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:10:18 +01:00
Navya Sri Nizamkari 2e363be0aa staging: dgnc: Use kcalloc instead of kzalloc.
This patch uses kcalloc instead of kzalloc function.
A coccinelle script was used to make this change.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:10:18 +01:00
Dan Carpenter cb1185a4ae staging: dgnc: off by one in dgnc_mgmt_ioctl()
"dgnc_NumBoards" is the number of initialized elements in the
dgnc_Board[] array so the comparison should be ">=" instead of ">" so we
don't read invalid data.  We can remove the special handling of the
empty array now that we've fixed this bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:08:58 +01:00
Giedrius Statkevičius 65da04c1ca dgnc: Make all lines under 80 characters in dgnc_driver.c
Some of the lines are over 80 characters in dgnc_driver.c so fix them by
moving the comments closer to the code, tidying the comments to make
them smaller, and remove a redundant space after +.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:05:57 +01:00
Giedrius Statkevičius e9210a0309 dgnc: Make all lines under 80 characters in dgnc_cls.h
Some of the lines are over 80 characters so fix that by moving the
comments before the struct definition and before #define's.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:05:57 +01:00
Giedrius Statkevičius 85c748dfcb dgnc: Remove redundant blank lines in dgnc_cls.c
There are a lot double of blank lines in dgnc_cls.c thus remove them to make
the file follow the CodingStyle. Also, remove one blank line at the
end of dgnc_cls.c.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:05:27 +01:00
Cass May f11cc56875 dgnc: Move DG_PART definition from Makefile to dgnc_driver.h
Avoid deprecated usage of EXTRA_CFLAGS by moving definition of DG_PART into dgnc_driver.h

Signed-off-by: Cass May <cass@cassm.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:05:27 +01:00
Cass May fd933bae14 dgnc: Remove superfluous EXTRA_CFLAGS variable
Clean up Makefile by removing unnecessary definition of DG_NAME.

Signed-off-by: Cass May <cass@cassm.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12 11:05:26 +01:00
Darshana Padmadas a3d81a379b drivers: staging: dgnc: Replace min with min_t
This patch replaces min with min_t and eliminates
the following warning found by checkpatch.pl:

WARNING: min() should probably be min_t(uint, n, 12)

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:30:40 +01:00
Salah Triki 5f9dca1e7d Staging: dgnc: Fix checking return value of register_chrdev
The failure code is negative. So check <0 instead of <=0.
Return the failure code instead of -ENXIO.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:12:22 -08:00
Salah Triki 834d86735d staging: dgnc: fix braces {} are not necessary for single statement blocks
This patch fixes the following checkpatch.pl warning:
braces {} are not necessary for single statement blocks

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:12:22 -08:00
Cristina Opriceana f40e06f0b7 Staging: dgnc: Replace printk() with dev_dbg()
This patch replaces printk() with dev_dbg() in order to avoid the
suggestion of using a more specific function while printing debug
information. Warning found by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 15:12:14 -08:00
Cristina Opriceana c28645e3ca Staging: dgnc: Replace printk with dev_err
This patch fixes the following checkpatch.pl warning:
WARNING: Prefer [subsystem eg: netdev]_err over printk(KERN_ERR, ...).

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 15:12:14 -08:00
Gamze POLAT b0487a7c73 Staging: dgnc: Removed trailing whitespace
Removed trailing whitespaces to improve code readability and remove
checkpatch warning.

Signed-off-by: Gamze POLAT <gamzepolat94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 13:15:41 -08:00
Aya Mahfouz 38e0c9d27a staging: dgnc: replace init_timer by setup_timer
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.

The issue was discovered using the following coccinelle script:

@@
expression ds, e1, e2;
@@

-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 13:12:40 -08:00
Vatika Harlalka 371ec40392 Staging: dgnc: Fix warning of code style
This patch fixes checkpatch.pl WARNING:
Line longer than 80 chars.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24 14:14:39 -08:00
Vatika Harlalka 9e39ab27fb Staging: dgnc: Removed trailing whitespace to improve readability.
Removed trailing whitespaces to improve code readability and remove checkpatch warning.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24 14:14:39 -08:00
Vatika Harlalka 985d251b7e Staging: dgnc: Indented code to increase readability
Indented code and fixed checkpatch warning to enhance readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24 14:14:39 -08:00
Davidlohr Bueso 2be90fef97 drivers/staging: use current->state helpers
Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments,
keeping track of who changed the state.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28 11:25:28 -08:00
Andrew Milkovich 6f6304b85f Staging: dgnc: fixed some coding style errors
This patch fixes the following checkpatch.pl error:
ERROR: Macros with complex values should be enclosed in parentheses
Outer parentheses were added to macro definitions.

Signed-off-by: Andrew Milkovich <amilkovich@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 20:04:15 +08:00
Krzysztof Adamski 60e27886fd staging: dgnc: fix long lines in PCI device table
This patch fixes coding style of PCI device table declaration.

Signed-off-by: Krzysztof Adamski <k@japko.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 20:03:23 +08:00
Alexey Khoroshilov d7312aab23 staging: dgnc: implement proper error handling in dgnc_start()
dgnc_start() ignores errors in class_create() and device_create()
and it does not deallocate resources if dgnc_tty_preinit() fails.

The patch implements proper error handling.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:04:12 -08:00
Tapasweni Pathak fc33bd2921 staging: dgnc: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:05:46 -07:00
Aya Mahfouz ac611dc60f staging: dgnc: dgnc_kcompat.h: remove unused macro
This patch removes the macro PARM_INT after removing all the variables
that depended on it.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz 2a71a3c7c7 staging: dgnc: remove debug symbols
This patch removes all of the debug symbols and the variable dgnc_debug
since they are not used anywhere in the code.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz ade5b9435b staging: dgnc: remove unused variable named rawreadok
This patch removes the variable rawreadok since it is only intialized
but not used in any of the driver functions.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz 6db43a9c38 staging: dgnc: dgnc_driver: remove all occurences of trcbuf_size
This patch removes the variable trcbuf_size given there is no real
use for it anymore. All of the debug variables in this driver is
basically dead code.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz 8a43572c32 staging: dgnc: dgnc_kcompat.h: remove unused macros
This patch removes the macros PARM_STR and PARM_ULONG given that they
are not used anywhere in the driver files.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Jiayi Ye 308c32f9e8 staging: dgnc: delete successive assignments to the same location
Successive assignments to the same location is meaningless and can be
deleted. The Coccinelle semantic patch was used to find cases.

@@
expression e1,e2,e3;
@@

(
 (<+...e1++...+>)=e2;
|
 (<+...e1--...+>)=e2;
|
 (<+...++e1...+>)=e2;
|
 (<+...--e1...+>)=e2;
|
e1=e2;
e1 = <+...e1...+>;
|
*e1=e2;
*e1=e3;
)

Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 15:41:43 +08:00
Somya Anand 36beff6e20 Staging: dgnc: Remove unused sniff code
The output written by dgnc_sniff_nowait_nolock() is never used
anywhere since commit 35cf904593 ("staging: dgnc: removes proc code")
deleted the code that used to copy it to user space.
dgnc_sniff_nowait_nolock() uses 'timeval' to create header timestamps for
the data dump.

32-bit systems using 'struct timeval' will break in the year 2038,
This patch removes dgnc_sniff_nowait_nolock() and all ch_sniff_* members
of struct channel_t defined in "dgnc_driver.h". It also removes their usage
from the driver files and hence y2038 issue is also resolved.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 08:34:25 +08:00
Dilek Uzulmez feba47a74d staging: dgnc: Remove space before tabs
This patch fixes the warning of "Please, no space before tab" produced
by checkpatch.pl. The modified file: dgnc_tty.c

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:18 +08:00
Roberta Dobrescu 1f26adc94a staging: dgnc: Remove non-standard APR/RAPR printing macros
This patch removes non-standard macros used by dgnc driver for printing error
or debugging messages. These are replaced by dev_err/dev_dbg (when possible)
or pr_err. There were cases where the message is completely removed since is
not adding any useful information.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:18 +08:00
Heena Sirwani ca5dd0b83d Staging: dgnc: Compress two lines of code into one.
The following patch merges two lines of code into one using coccinelle
and removes unused variables. The semantic patch used is as follows:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:18 +08:00
Linus Torvalds 683a52a101 TTY/Serial driver patches for 3.18-rc1
Here's the big tty/serial driver patchset for 3.18-rc1.
 
 Lots of little things in here, some good work from Peter Hurley on the
 tty core, and in lots of drivers.  There are also lots of other driver
 updates in here as well, full details in the changelog below.
 
 All have been in the linux-next tree for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlQ0aDwACgkQMUfUDdst+ymueACeI1i2exlGaBBSVQuUK2Jmx8Uz
 nukAn3KPuvvx+MKfMMBRpK0DQCzTxv4P
 =dwv1
 -----END PGP SIGNATURE-----

Merge tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver updates from Greg KH:
 "Here's the big tty/serial driver patchset for 3.18-rc1.

  Lots of little things in here, some good work from Peter Hurley on the
  tty core, and in lots of drivers.  There are also lots of other driver
  updates in here as well, full details in the changelogs.

  All have been in the linux-next tree for a while"

* tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (99 commits)
  Revert "serial/core: Initialize the console pm state"
  tty: serial: 8250: use 32bit variable for rpm_tx_active
  tty: serial: msm: Add earlycon support
  serial/core: Initialize the console pm state
  serial: asc: Conditionally use readl_relaxed (COMPILE_TEST)
  serial: of-serial: add PM suspend/resume support
  m68k: AMIGA_BUILTIN_SERIAL should depend on TTY
  asm/uapi: Add definition of TIOC[SG]RS485
  tty/metag_da: Add console_poll module parameter
  serial: 8250_pci: remove rts_n override from Baytrail quirk
  serial: cadence: Add generic earlycon support
  serial: imx: change the wait even to interruptiable
  serial: imx: terminate the RX DMA when the UART is suspending
  serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
  serial: 8250: Add Quark X1000 to 8250_pci.c
  tty: omap-serial: pull out calculation from baud_is_mode16
  tty: omap-serial: fix division by zero
  xen_hvc: no reason to write the type key on xenstore
  tty: serial: 8250_core: remove UART_IER_RDI in serial8250_stop_rx()
  tty: serial: 8250_core: use the ->line argument as a hint in serial8250_find_match_or_unused()
  ...
2014-10-08 06:52:11 -04:00
Ebru Akagunduz 446393e960 staging: dgnc: Fix do not add new typedefs
This patch fixes "do not add new typedefs"
checkpatch.pl warning in dgnc_types.h

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Yeliz Taneroglu 3fad9641ab staging: dgnc: Fix no spaces at the start of a line in dpacompat.h
The following patch the checkpatch.pl warning:

drivers/staging/dgnc/dpacompat.h:27 warning: please, no spaces at the start of a line

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy 0eaa02e66d Staging: dgnc: Add missing blank line
This fixes the following checkpatch.pl warning:
WARNING: Missing a blank line after declarations

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy 3c4019d3e0 Staging: dgnc: Remove unnecessary braces
This fixes the following checkpatch.pl warnings:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy c313fe2c34 Staging: dgnc: Remove return in void function
This fixes the following checkpatch.pl warnings:
WARNING: void function return statements are not generally useful

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy ac9080029d Staging: dgnc: Remove space before parenthesis
This fixes the following checkpatch.pl error:
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:53:38 -04:00
Roberta Dobrescu b4e28a6142 staging: dgnc: dgnc_driver.h: Remove non-standard spinlock's macros
This patch removes non-standard spinlock's macros as they are no longer
used by this driver.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:52:12 -04:00
Roberta Dobrescu 66663dc103 staging: dgnc: dgnc_driver.c: Replace non-standard spinlock's macros
This patch replaces non-standard spinlock's macros.
It is done using coccinelle and the following semantic patch:

@@
expression x;
@@

- DGNC_SPINLOCK_INIT(x)
+ spin_lock_init(&x)

@@
expression x, y;
@@

- DGNC_LOCK(x, y)
+ spin_lock_irqsave(&x, y)

@@
expression x, y;
@@

- DGNC_UNLOCK(x, y)
+ spin_unlock_irqrestore(&x, y)

@used_by_lock exists@
typedef ulong;
symbol lock_flags;
position p1, p2;
@@

(
 ulong lock_flags@p1;
|
 unsigned long lock_flags@p2;
)
...
(
 spin_lock_irqsave(..., lock_flags)
|
 spin_unlock_irqrestore(..., lock_flags)
)

@@
position used_by_lock.p1, used_by_lock.p2;
@@

(
- ulong lock_flags@p1;
+ unsigned long flags;
|
- unsigned long lock_flags@p2;
+ unsigned long flags;
)
<...
- lock_flags
+ flags
...>

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:52:12 -04:00
Roberta Dobrescu 7be869b072 staging: dgnc: dgnc_neo.c: Replace non-standard spinlock's macros
This patch replaces non-standard spinlock's macros.
It is done using coccinelle and the following semantic patch:

@@
expression x;
@@

- DGNC_SPINLOCK_INIT(x)
+ spin_lock_init(&x)

@@
expression x, y;
@@

- DGNC_LOCK(x, y)
+ spin_lock_irqsave(&x, y)

@@
expression x, y;
@@

- DGNC_UNLOCK(x, y)
+ spin_unlock_irqrestore(&x, y)

@used_by_lock exists@
typedef ulong;
symbol lock_flags;
position p1, p2;
@@

(
 ulong lock_flags@p1;
|
 unsigned long lock_flags@p2;
)
...
(
 spin_lock_irqsave(..., lock_flags)
|
 spin_unlock_irqrestore(..., lock_flags)
)

@@
position used_by_lock.p1, used_by_lock.p2;
@@

(
- ulong lock_flags@p1;
+ unsigned long flags;
|
- unsigned long lock_flags@p2;
+ unsigned long flags;
)
<...
- lock_flags
+ flags
...>

Additionally replace 'lock_flags2' with 'flags2'.
This was done by hand since it had only 3 occurences and all in this file.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:52:12 -04:00
Roberta Dobrescu a44b508a32 staging: dgnc: dgnc_tty.c: Replace non-standard spinlock's macros
This patch replaces non-standard spinlock's macros.
It is done using coccinelle and the following semantic patch:

@@
expression x;
@@

- DGNC_SPINLOCK_INIT(x)
+ spin_lock_init(&x)

@@
expression x, y;
@@

- DGNC_LOCK(x, y)
+ spin_lock_irqsave(&x, y)

@@
expression x, y;
@@

- DGNC_UNLOCK(x, y)
+ spin_unlock_irqrestore(&x, y)

@used_by_lock exists@
typedef ulong;
symbol lock_flags;
position p1, p2;
@@

(
 ulong lock_flags@p1;
|
 unsigned long lock_flags@p2;
)
...
(
 spin_lock_irqsave(..., lock_flags)
|
 spin_unlock_irqrestore(..., lock_flags)
)

@@
position used_by_lock.p1, used_by_lock.p2;
@@

(
- ulong lock_flags@p1;
+ unsigned long flags;
|
- unsigned long lock_flags@p2;
+ unsigned long flags;
)
<...
- lock_flags
+ flags
...>

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:52:12 -04:00
Roberta Dobrescu 9a03d7c8cf staging: dgnc: dgnc_mgmt.c: Replace non-standard spinlock's macros
This patch replaces non-standard spinlock's macros.
It is done using coccinelle and the following semantic patch:

@@
expression x;
@@

- DGNC_SPINLOCK_INIT(x)
+ spin_lock_init(&x)

@@
expression x, y;
@@

- DGNC_LOCK(x, y)
+ spin_lock_irqsave(&x, y)

@@
expression x, y;
@@

- DGNC_UNLOCK(x, y)
+ spin_unlock_irqrestore(&x, y)

@used_by_lock exists@
typedef ulong;
symbol lock_flags;
position p1, p2;
@@

(
 ulong lock_flags@p1;
|
 unsigned long lock_flags@p2;
)
...
(
 spin_lock_irqsave(..., lock_flags)
|
 spin_unlock_irqrestore(..., lock_flags)
)

@@
position used_by_lock.p1, used_by_lock.p2;
@@

(
- ulong lock_flags@p1;
+ unsigned long flags;
|
- unsigned long lock_flags@p2;
+ unsigned long flags;
)
<...
- lock_flags
+ flags
...>

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:50:54 -04:00
Gulsah Kose 42c4d46e38 staging: dgnc: Fixed white space warning.
This patch fixes "please, no space before tabs" checkpatch.pl warning in
digi.h

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:50:54 -04:00
Roberta Dobrescu 707505b58e staging: dgnc: Replace non-standard spinlock's macros
This patch replaces non-standard spinlock's macros.
It is done using coccinelle and the following semantic patch:

@@
expression x;
@@

- DGNC_SPINLOCK_INIT(x)
+ spin_lock_init(&x)

@@
expression x, y;
@@

- DGNC_LOCK(x, y)
+ spin_lock_irqsave(&x, y)

@@
expression x, y;
@@

- DGNC_UNLOCK(x, y)
+ spin_unlock_irqrestore(&x, y)

@used_by_lock exists@
typedef ulong;
symbol lock_flags;
position p1, p2;
@@

(
 ulong lock_flags@p1;
|
 unsigned long lock_flags@p2;
)
...
(
 spin_lock_irqsave(..., lock_flags)
|
 spin_unlock_irqrestore(..., lock_flags)
)

@@
position used_by_lock.p1, used_by_lock.p2;
@@

(
- ulong lock_flags@p1;
+ unsigned long flags;
|
- unsigned long lock_flags@p2;
+ unsigned long flags;
)
<...
- lock_flags
+ flags
...>

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 20:31:32 -07:00
Gulsah Kose 77b55d84aa staging: dgnc: Fix unnecessary braces warning.
Fixes "braces {} are not necessary for single statement blocks"
checkpatch.pl warnings in dgnc_sysfs.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 13:36:56 -07:00
Roberta Dobrescu fb33aa47a0 staging: dgnc: Check sscanf return value
This fixes the following checkpatch.pl warnings:
WARNING: unchecked sscanf return value

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:25:23 -07:00
Gulsah Kose f23e875fd2 staging: dgnc: Fix unnecessary space warning.
Fixed "Unnecessary space before function pointer argument" checkpatch.pl
warning in dgnc_driver.h

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:25:22 -07:00