+/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2010 - Maxim Levitsky
*
block_size = info->erasesize;
size_in_megs = info->size / (1024 * 1024);
- if (sector_size != SM_SECTOR_SIZE && sector_size != SM_SMALL_PAGE)
+ if (!IN_SET(sector_size, SM_SECTOR_SIZE, SM_SMALL_PAGE))
goto exit;
switch(size_in_megs) {
for (offset = 0 ; offset < block_size * spare_count ;
offset += sector_size) {
lseek(mtd_fd, SEEK_SET, offset);
- if (read(mtd_fd, cis_buffer, SM_SECTOR_SIZE) == SM_SECTOR_SIZE){
+ if (read(mtd_fd, cis_buffer, SM_SECTOR_SIZE) == SM_SECTOR_SIZE) {
cis_found = 1;
break;
}