lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <55510DE0.3080909@redhat.com>
Date:	Mon, 11 May 2015 22:15:28 +0200
From:	Denys Vlasenko <dvlasenk@...hat.com>
To:	Giuliano Pochini <pochini@...ny.it>, Takashi Iwai <tiwai@...e.de>,
	Jaroslav Kysela <perex@...e.cz>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Object code duplication in sound/pci/echoaudio/

There are fourteen files in sound/pci/echoaudio/, namely:

darla20.c darla24.c echo3g.c gina20.c gina24.c indigo.c
indigodj.c indigodjx.c indigoio.c indigoiox.c layla20.c
layla24.c mia.c mona.c

Which use the following method of "code reuse":

#include "echoaudio_dsp.c"
#include "echoaudio_gml.c"
#include "echoaudio.c"

echoaudio.c is not a header file, it contains a bunch of
static functions, some of a considerable size.
This makes those functions to be duplicated many times over.

For instance, there are fourteen instances of init_engine(),
each 1117 bytes long. Fourteen instances of pcm_open(), each 556 bytes
long.

11 get_firmware
10 free_firmware
13 audiopipe_free
14 init_hw
14 hw_rule_capture_format_by_channels
14 hw_rule_capture_channels_by_format
14 hw_rule_playback_format_by_channels
14 hw_rule_playback_channels_by_format

and so on.

In my humble opinion, this is not a good coding practice.
You should not duplicate functions like this.
Where possible, you need to reuse a single instance of a function.

According to git, author of these drivers is Giuliano Pochini
<pochini@...ny.it>.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ