]> git.baikalelectronics.ru Git - kernel.git/commit
staging: axis-fifo: initialize timeouts in init only
authorKhadija Kamran <kamrankhadijadj@gmail.com>
Thu, 16 Mar 2023 20:09:00 +0000 (01:09 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:40 +0000 (17:32 +0100)
commit7d6b80f192e67612d61f16d7094b1effac74b300
tree3acfe614d96fb82e88eab7cfe58352f3907a831f
parent57fbb60e29dfc3eea14ecc6ee3046d784c8aedda
staging: axis-fifo: initialize timeouts in init only

[ Upstream commit 752cbd8f191678e86aa754f795546b7f06b7f171 ]

Initialize the module parameters, read_timeout and write_timeout once in
init().

Module parameters can only be set once and cannot be modified later, so we
don't need to evaluate them again when passing the parameters to
wait_event_interruptible_timeout().

Convert datatype of {read,write}_timeout from 'int' to 'long int' because
implicit conversion of 'long int' to 'int' in statement
'{read,write}_timeout = MAX_SCHEDULE_TIMEOUT' results in an overflow.

Change format specifier for {read,write}_timeout from %i to %li.

Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Link: https://lore.kernel.org/r/ZBN3XAsItCiTk7CV@khadija-virtual-machine
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/axis-fifo/axis-fifo.c