All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Cc: Christian Franke <Christian.Franke@t-online.de>
Subject: On gratuitous modularization
Date: Mon, 25 Jan 2010 09:06:20 +0100	[thread overview]
Message-ID: <20100125080620.GA14131@thorin> (raw)


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	other threads:[~2010-01-25  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25  8:06 Robert Millan [this message]
2010-01-25 20:13 ` On gratuitous modularization Christian Franke
2010-01-26 16:54   ` Robert Millan
2010-02-07  0:37   ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-07 12:01     ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100125080620.GA14131@thorin \
    --to=rmh@aybabtu.com \
    --cc=Christian.Franke@t-online.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.