02 Oct, 2016
2 commits
-
All the chunks of the patch apply to comments save the first one.
Signed-off-by: Fernando Apesteguia
Signed-off-by: Greg Kroah-Hartman -
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
6248 1024 0 7272 1c68
drivers/staging/dgnc/dgnc_sysfs.oFile size after:
text data bss dec hex filename
6288 960 0 7248 1c50
drivers/staging/dgnc/dgnc_sysfs.oSigned-off-by: Bhumika Goyal
Acked-by: Julia Lawall
Signed-off-by: Greg Kroah-Hartman
27 Sep, 2016
11 commits
-
It was used to get a board structure with dgnc_BoardsByMajor array.
But this driver already has the array for managing initialized board
as dgap_board[]. It can be used for searching the board structure
by major number.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The dgnc_major_serial_registered and dgnc_major_serial_registered
do not need to use to check whether the tty driver is registered or not.
These variables are used only in dgnc_cleanup_tty() function,
This function will be called normally with initialized board structure.
It means the dgnc_cleanup_tty() cannot be called with unregistered tty.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The dgnc_tty_uninit() doesn't match with dgnc_tty_init() at all.
And also the dgnc_cleanup_tty() is only called for exiting the module.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The dgnc_free_irq() will free the requested IRQ from
the dgnc_request_irq().Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The dgnc_finalize_board_init() function has only job for
requesting the IRQ. It should be renamed to dgnc_request_irq()Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The dgnc_tty_unregister() will be called when
the dgnc_tty_register() is failed.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The functions related with tty device initialization are needed
to be moved from dgnc_found_board() to dgnc_init_one().Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The ioremap() function can be failed, so it need to have error
handling in dgnc_do_remap(). And also the return type of
dgnc_do_remap() should be changed from "void" to "int"Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
There is a temporary message buffer for the boot message
in dgnc_found_board() but the buffer was not used anywhere in
dgnc driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The channel array in board_t was initialized in dgnc_found_board()
with NULL. But the channel is going to initialize in dgnc_tty_init().
So the channel array doesn't need to set NULL for initailization.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman
26 Sep, 2016
1 commit
-
As reported by checkpatch.
Signed-off-by: Fernando Apesteguia
Signed-off-by: Greg Kroah-Hartman
20 Sep, 2016
1 commit
-
Instead of storing the return value of a function call into a variable and
then returning it, we can club the two into a single return statement. This
change was made using the following semantic patch by Coccinelle:@@
local idexpression ret;
expression e;
@@-ret =
+return
e;
-return ret;Signed-off-by: Rehas Sachdeva
Signed-off-by: Greg Kroah-Hartman
18 Sep, 2016
1 commit
-
Fixed a coding style issue.
Signed-off-by: Cathal Mullaney
Signed-off-by: Greg Kroah-Hartman
16 Sep, 2016
2 commits
-
This patch fixes the checkpatch.pl warning: Line over 80 characters.
Also, the word 'because' was spelled as 'Becuz' and has been corrected.Signed-off-by: Rehas Sachdeva
Signed-off-by: Greg Kroah-Hartman -
This patch fixes the checkpatch.pl warning:
Line over 80 characters.Signed-off-by: Rehas Sachdeva
Signed-off-by: Greg Kroah-Hartman
12 Sep, 2016
2 commits
-
Convert DRIVER_ATTR() macro with DRIVER_ATTR_RO/RW and
DEVICE_ATTR() macro with DEVICE_ATTR_RO()Signed-off-by: Matias Mucciolo
Signed-off-by: Greg Kroah-Hartman -
Fix alignment in multi line comment block.
Remove extra '*' to use the preferred comment style as in Documentation/CodingStyle
Signed-off-by: Fernando Apesteguia
Signed-off-by: Greg Kroah-Hartman
01 Sep, 2016
1 commit
-
The dgnc_maxcps_room() function must be called only for print device.
The if-statement for checking print device checks before calling
dgnc_maxcps_room() and also this function doesn't need to have any
data except channel_t.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman
21 Aug, 2016
1 commit
-
fix checkpatch.pl warning about 'line over 80 characters'.
Signed-off-by: Anson Jacob
Signed-off-by: Greg Kroah-Hartman
16 Aug, 2016
16 commits
-
The 'ch_intr_rx' variable was used only for increasing.
So the 'ch_intr_rx' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The 'ch_intr_tx' variable was used only for increasing.
So the 'ch_intr_tx' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The 'ch_intr_modem' variable was used only for increasing.
So the 'ch_intr_modem' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The 'intr_rx' variable was used only for increasing.
So the 'intr_rx' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The 'intr_tx' variable was used only for increasing.
So the 'intr_tx' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The 'intr_modem' variable was used only for increasing.
So the 'intr_modem' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
the "brd" was already checked for NULL before calling dgnc_do_remap().
the dgnc_do_remap() function was called only
from the dgnc_found_board() and the DGNC_BOARD_MAGIC value
was assigned to "brd->magic" in dgcn_found_board(). So it doesn't
need to check about magic value.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The 'intr_count' variable was used only for increasing.
So the 'intr_count' variable is not useful for this driver.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
the "brd" value cannot be NULL in dgnc_finalize_board_init().
Because "brd" as a parameter of this function was already
checked for NULL.the dgnc_finalize_board_init() as a static function was called
only from dgnc_found_board() function and brd->magic value
was assigned once in dgnc_found_board(). So it doesn't need to
check for DGNC_BOARD_MAGIC value.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
Re-arrange the functions for removing forward declarations in dgnc_cls.c file.
Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The dgnc_set_modem_info() used only channel_t variable.
Any other variables were used only for checking NULL.So fist parameter changed from "tty_struct" to "channel_t" and
useless NULL checks and variables are removed.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The unit struct(un_t) was not used in dgnc_tty_hangup().
Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The local variable "bd" was not used in dgnc_carrier() function.
Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
Add the __exit macro to the dgnc_cleanup_module(void) function
in dgnc_driver.cSigned-off-by: Joshua Houghton
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
...
09 May, 2016
1 commit
-
the "ch" from brd structure could be NULL, it need to
check for NULL.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman