diff options
| author | Thorsten Blum <[email protected]> | 2024-07-10 21:52:39 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2024-07-31 11:12:02 +0000 |
| commit | 104831a17518796fb29e803fe07eb87ce9df884d (patch) | |
| tree | ff00f04a994d5a4f346de6c625f73d70de2fbda4 /drivers/cdx/controller/mcdi.c | |
| parent | comedi: ni_*: do not declare unused variable range_ni_E_ao_ext (diff) | |
| download | kernel-104831a17518796fb29e803fe07eb87ce9df884d.tar.gz kernel-104831a17518796fb29e803fe07eb87ce9df884d.zip | |
hpet: Optimize local variable data type in hpet_alloc()
The local variable period uses at most 32 bits and can be a u32 instead
of unsigned long. The upper 32 bits are all 0 after masking and right
shifting cap by HPET_COUNTER_CLK_PERIOD_SHIFT and can be discarded.
Since do_div() casts the divisor to u32 anyway, changing the data type
of period to u32 also removes the following Coccinelle/coccicheck
warning reported by do_div.cocci:
WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead
Signed-off-by: Thorsten Blum <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/cdx/controller/mcdi.c')
0 files changed, 0 insertions, 0 deletions
