Alright,

Here is 3 that i found in libdiskfs
with this query:
rg '^\s*[a-zA-Z_][a-zA-Z0-9_]*\s*:\s*\S' libdiskfs/

But i don't see any others in libdiskfs.
I will go over others separately if that is fine?


On Wed, Apr 15, 2026 at 5:33 PM Samuel Thibault <[email protected]>
wrote:

> Hello,
>
> You can systematize this kind of patch, over the whole source code, it's
> really more readable :)
>
> Samuel
>
> Milos Nikic, le mer. 15 avril 2026 17:30:46 -0700, a ecrit:
> > ---
> >  libdiskfs/disk-pager.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c
> > index f392fc42..6eaa3c62 100644
> > --- a/libdiskfs/disk-pager.c
> > +++ b/libdiskfs/disk-pager.c
> > @@ -35,8 +35,8 @@ struct pager_requests *diskfs_disk_pager_requests;
> >  static void fault_handler (int sig, long int sigcode, struct sigcontext
> *scp);
> >  static struct hurd_signal_preemptor preemptor =
> >    {
> > -  preemptor: NULL,
> > -  handler: (sighandler_t) &fault_handler,
> > +  .preemptor = NULL,
> > +  .handler = (sighandler_t) &fault_handler,
> >    };
> >
> >  void
> > --
> > 2.53.0
> >
>
From 6ff378fd81cf8a094781a04baddb55bce24b08ae Mon Sep 17 00:00:00 2001
From: Milos Nikic <[email protected]>
Date: Wed, 15 Apr 2026 18:02:25 -0700
Subject: [PATCH] libdiskfs: Use designated initializers

---
 libdiskfs/dir-lookup.c   | 6 +++---
 libdiskfs/disk-pager.c   | 4 ++--
 libdiskfs/fsys-getroot.c | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index b08c0c0d..4f266734 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -508,9 +508,9 @@ diskfs_S_dir_lookup (struct protid *dircred,
       mach_port_t rendezvous = MACH_PORT_NULL;
       struct flock64 lock =
         {
-         l_start: 0,
-         l_len: 0,
-         l_whence: SEEK_SET
+         .l_start = 0,
+         .l_len = 0,
+         .l_whence = SEEK_SET
        };
 
       if (flags & O_EXLOCK)
diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c
index f392fc42..6eaa3c62 100644
--- a/libdiskfs/disk-pager.c
+++ b/libdiskfs/disk-pager.c
@@ -35,8 +35,8 @@ struct pager_requests *diskfs_disk_pager_requests;
 static void fault_handler (int sig, long int sigcode, struct sigcontext *scp);
 static struct hurd_signal_preemptor preemptor =
   {
-  preemptor: NULL,
-  handler: (sighandler_t) &fault_handler,
+  .preemptor = NULL,
+  .handler = (sighandler_t) &fault_handler,
   };
 
 void
diff --git a/libdiskfs/fsys-getroot.c b/libdiskfs/fsys-getroot.c
index 4debdf8b..c3345085 100644
--- a/libdiskfs/fsys-getroot.c
+++ b/libdiskfs/fsys-getroot.c
@@ -48,10 +48,10 @@ diskfs_S_fsys_getroot (struct diskfs_control *pt,
   struct iouser user;
   struct peropen peropen_context =
   {
-    root_parent: dotdot,
-    shadow_root_parent: MACH_PORT_NULL,
-    shadow_root: _diskfs_chroot_directory ? diskfs_root_node : NULL, /* XXX */
-    path: NULL,
+    .root_parent = dotdot,
+    .shadow_root_parent = MACH_PORT_NULL,
+    .shadow_root = _diskfs_chroot_directory ? diskfs_root_node : NULL, /* XXX */
+    .path = NULL,
   };
 
   if (!pt)
-- 
2.53.0

Reply via email to