diff options
Diffstat (limited to 'drivers/mtd/chips/cfi_util.c')
| -rw-r--r-- | drivers/mtd/chips/cfi_util.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index 6f16552cd59f..ef0aa6890bc0 100644 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common Flash Interface support: * Generic utility functions not dependent on command set * * Copyright (C) 2002 Red Hat * Copyright (C) 2003 STMicroelectronics Limited - * - * This code is covered by the GPL. */ #include <linux/module.h> @@ -26,7 +25,7 @@ void cfi_udelay(int us) { if (us >= 1000) { - msleep((us+999)/1000); + msleep(DIV_ROUND_UP(us, 1000)); } else { udelay(us); cond_resched(); @@ -108,11 +107,14 @@ map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi #if BITS_PER_LONG >= 64 case 8: onecmd |= (onecmd << (chip_mode * 32)); + fallthrough; #endif case 4: onecmd |= (onecmd << (chip_mode * 16)); + fallthrough; case 2: onecmd |= (onecmd << (chip_mode * 8)); + fallthrough; case 1: ; } @@ -161,11 +163,14 @@ unsigned long cfi_merge_status(map_word val, struct map_info *map, #if BITS_PER_LONG >= 64 case 8: res |= (onestat >> (chip_mode * 32)); + fallthrough; #endif case 4: res |= (onestat >> (chip_mode * 16)); + fallthrough; case 2: res |= (onestat >> (chip_mode * 8)); + fallthrough; case 1: ; } @@ -436,4 +441,5 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, EXPORT_SYMBOL(cfi_varsize_frob); +MODULE_DESCRIPTION("Common Flash Interface Generic utility functions"); MODULE_LICENSE("GPL"); |
