diff options
author | Willy Tarreau <w@1wt.eu> | 2020-04-10 11:30:23 +0200 |
---|---|---|
committer | Denis Efremov <efremov@linux.com> | 2020-05-12 19:34:56 +0300 |
commit | 05f5e319a1eb017442cd0eec87ad52a62d8c3224 (patch) | |
tree | 5f505d006fe72ef358370510b04d811ffa60d12a /fs/cifs | |
parent | 12aebfac27ab69b5ed333c94fda45ef31ba2fc2a (diff) | |
download | linux-05f5e319a1eb017442cd0eec87ad52a62d8c3224.tar.gz |
floppy: cleanup: do not iterate on current_fdc in do_floppy_init()
There's no need to iterate on current_fdc in do_floppy_init() anymore,
in the first case it's only used as an array index to access fdc_state[],
so let's get rid of this confusing assignment. The second case is a bit
trickier because user_reset_fdc() needs to already know current_fdc when
called with drive==-1 due to this call chain:
user_reset_fdc()
lock_fdc()
set_fdc()
drive<0 ==> new_fdc = current_fdc
Note that current_drive is not used in this code part and may even not
match a unit belonging to current_fdc. Instead of passing -1 we can
simply pass the first drive of the FDC being initialized, which is even
cleaner as it will allow the function chain above to consistently assign
both variables.
Link: https://lore.kernel.org/r/20200410093023.14499-1-w@1wt.eu
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Denis Efremov <efremov@linux.com>
Diffstat (limited to 'fs/cifs')
0 files changed, 0 insertions, 0 deletions