浏览代码

/dev/mem: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gustavo A. R. Silva 7 年之前
父节点
当前提交
5faecb0162
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/char/mem.c

+ 1 - 0
drivers/char/mem.c

@@ -765,6 +765,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
 	switch (orig) {
 	switch (orig) {
 	case SEEK_CUR:
 	case SEEK_CUR:
 		offset += file->f_pos;
 		offset += file->f_pos;
+		/* fall through */
 	case SEEK_SET:
 	case SEEK_SET:
 		/* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
 		/* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
 		if ((unsigned long long)offset >= -MAX_ERRNO) {
 		if ((unsigned long long)offset >= -MAX_ERRNO) {