For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is
a pointer to a const-qualified type.

Signed-off-by: Radoslav Kolev <[email protected]>
---
 grub-core/osdep/linux/ofpath.c | 4 ++--
 util/probe.c                   | 6 +++---
 util/resolve.c                 | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c
index 24a4d5c8d..cbcc4332f 100644
--- a/grub-core/osdep/linux/ofpath.c
+++ b/grub-core/osdep/linux/ofpath.c
@@ -488,13 +488,13 @@ check_hba_identifiers (const char *sysfs_path, int 
*vendor, int *device_id)
 static void
 check_sas (const char *sysfs_path, int *tgt, unsigned long int *sas_address)
 {
-  char *ed = strstr (sysfs_path, "end_device");
+  char *ed;
   char *p, *q, *path;
   char phy[21];
   int fd;
   size_t path_size;
 
-  if (!ed)
+  if (!strstr(sysfs_path, "end_device"))
     return;
 
   /* SAS devices are identified using disk@$PHY_ID */
diff --git a/util/probe.c b/util/probe.c
index 81d91cf59..a9158d640 100644
--- a/util/probe.c
+++ b/util/probe.c
@@ -70,7 +70,7 @@ char *
 grub_util_guess_bios_drive (const char *orig_path)
 {
   char *canon;
-  char *ptr;
+  const char *ptr;
   canon = grub_canonicalize_file_name (orig_path);
   if (!canon)
     return NULL;
@@ -99,7 +99,7 @@ char *
 grub_util_guess_efi_drive (const char *orig_path)
 {
   char *canon;
-  char *ptr;
+  const char *ptr;
   canon = grub_canonicalize_file_name (orig_path);
   if (!canon)
     return NULL;
@@ -128,7 +128,7 @@ char *
 grub_util_guess_baremetal_drive (const char *orig_path)
 {
   char *canon;
-  char *ptr;
+  const char *ptr;
   canon = grub_canonicalize_file_name (orig_path);
   if (!canon)
     return NULL;
diff --git a/util/resolve.c b/util/resolve.c
index b6e26312f..5310a5521 100644
--- a/util/resolve.c
+++ b/util/resolve.c
@@ -138,8 +138,8 @@ read_dep_list (FILE *fp)
 static char *
 get_module_name (const char *str)
 {
-  char *base;
-  char *ext;
+  const char *base;
+  const char *ext;
 
   base = strrchr (str, '/');
   if (! base)
@@ -164,9 +164,9 @@ get_module_name (const char *str)
 static char *
 get_module_path (const char *prefix, const char *str)
 {
-  char *dir;
+  const char *dir;
   char *base;
-  char *ext;
+  const char *ext;
   char *ret;
 
   ext = strrchr (str, '.');
-- 
2.52.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to