]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/mtd_probe/probe_smartmedia.c
Add SPDX license identifiers to source files under the GPL
[thirdparty/systemd.git] / src / udev / mtd_probe / probe_smartmedia.c
index 6a6c5522a765365cefac3f9acad75d0c8ba537d2..eb74fe1eb638598eb72cd4828519bfc0a747c9c8 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2010 - Maxim Levitsky
  *
@@ -54,7 +55,7 @@ void probe_smart_media(int mtd_fd, mtd_info_t* info)
         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) {
@@ -73,7 +74,7 @@ void probe_smart_media(int mtd_fd, mtd_info_t* info)
         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;
                 }