grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On gratuitous modularization


From: Robert Millan
Subject: On gratuitous modularization
Date: Mon, 25 Jan 2010 09:06:20 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Please be careful when adding modules.  I see that too often new modules
are added without any real need to host this code separately.

There are many examples where this happened.  I just noticed:

commands/hdparm.c:  struct grub_disk_ata_pass_through_parms apt;
commands/hdparm.c:  if (grub_disk_ata_pass_through (disk, &apt))
commands/hdparm.c:  struct grub_disk_ata_pass_through_parms apt;
commands/hdparm.c:  if (grub_disk_ata_pass_through (disk, &apt))
commands/hdparm.c:  struct grub_disk_ata_pass_through_parms apt;
commands/hdparm.c:  if (grub_disk_ata_pass_through (disk, &apt))
commands/hdparm.c:  if (! grub_disk_ata_pass_through)
disk/ata_pthru.c:                      struct grub_disk_ata_pass_through_parms 
*parms)
disk/ata_pthru.c:  grub_disk_ata_pass_through = grub_ata_pass_through;
disk/ata_pthru.c:  if (grub_disk_ata_pass_through == grub_ata_pass_through)
disk/ata_pthru.c:    grub_disk_ata_pass_through = NULL;
include/grub/disk.h:struct grub_disk_ata_pass_through_parms
include/grub/disk.h:extern grub_err_t (* 
EXPORT_VAR(grub_disk_ata_pass_through)) (grub_disk_t,
include/grub/disk.h:               struct grub_disk_ata_pass_through_parms *);
kern/disk.c:grub_err_t (* grub_disk_ata_pass_through) (grub_disk_t,
kern/disk.c:        struct grub_disk_ata_pass_through_parms *);

this seems unnecessary.  ata_pthru is very small.  If it's only used by hdparm,
why not just merge it?  This also avoids the additional code in kernel.

A similar example is aout.mod, which is just a helper for loaders of *BSD
kernels.

Please also see Okuji's article on this subject:

  http://grub.enbug.org/OnSplittingModules

-- 
Robert Millan

  "Be the change you want to see in the world" -- Gandhi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]