]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: topology: constify some structures
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 28 Dec 2022 01:42:40 +0000 (01:42 +0000)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 28 Dec 2022 01:49:03 +0000 (01:49 +0000)
libblkid/src/topology/dm.c
libblkid/src/topology/ioctl.c
libblkid/src/topology/lvm.c
libblkid/src/topology/sysfs.c

index 77146e2e2cdb553cd87296dbbc63d1b1973ebb73..612b5df3369e2a544c8ee9af0ae5b37f1e41adfc 100644 (file)
@@ -29,7 +29,7 @@ static int is_dm_device(dev_t devno)
 static int probe_dm_tp(blkid_probe pr,
                const struct blkid_idmag *mag __attribute__((__unused__)))
 {
-       const char *paths[] = {
+       const char * const paths[] = {
                "/usr/local/sbin/dmsetup",
                "/usr/sbin/dmsetup",
                "/sbin/dmsetup"
index 3aba09e4fc27e77e1d7458c0986a01691319d509..df9c8037a66a4786f9a074f8b287a72b4bd2f97c 100644 (file)
@@ -21,7 +21,7 @@
 /*
  * ioctl topology values
  */
-static struct topology_val {
+static const struct topology_val {
 
        long  ioc;
 
@@ -43,7 +43,7 @@ static int probe_ioctl_tp(blkid_probe pr,
        size_t i;
 
        for (i = 0; i < ARRAY_SIZE(topology_vals); i++) {
-               struct topology_val *val = &topology_vals[i];
+               const struct topology_val *val = &topology_vals[i];
                int rc = 1;
                unsigned int data;
 
index 6ab7a5019e12218e9374909ec3f9cb53cf9b30af..af1a612998b5626af478f7c8e82ccc5fabd921ee 100644 (file)
@@ -35,7 +35,7 @@ static int is_lvm_device(dev_t devno)
 static int probe_lvm_tp(blkid_probe pr,
                const struct blkid_idmag *mag __attribute__((__unused__)))
 {
-       const char *paths[] = {
+       const char * const paths[] = {
                "/usr/local/sbin/lvdisplay",
                "/usr/sbin/lvdisplay",
                "/sbin/lvdisplay"
index 745cd115aaf87cafbc0126707bee56e4ea78b9e5..05adc2ee3c52a7d3436e75b2556cfcf6ce35b342 100644 (file)
@@ -23,7 +23,7 @@
 /*
  * Sysfs topology values (since 2.6.31, May 2009).
  */
-static struct topology_val {
+static const struct topology_val {
 
        /* /sys/dev/block/<maj>:<min>/<ATTR> */
        const char *attr;
@@ -58,7 +58,7 @@ static int probe_sysfs_tp(blkid_probe pr,
        rc = 1;         /* nothing (default) */
 
        for (i = 0; i < ARRAY_SIZE(topology_vals); i++) {
-               struct topology_val *val = &topology_vals[i];
+               const struct topology_val *val = &topology_vals[i];
                int ok = ul_path_access(pc, F_OK, val->attr) == 0;
 
                rc = 1; /* nothing */