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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 13 Oct 2017 19:16:32 +0200
From:   Bhumika Goyal <bhumirks@...il.com>
To:     julia.lawall@...6.fr, perex@...ex.cz, tiwai@...e.com,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc:     Bhumika Goyal <bhumirks@...il.com>
Subject: [PATCH 1/2] sound: oss: make the function argument as const

Make the function argument struct audio_driver *driver of the function
sound_install_audiodrv as const as it's memory contents are only copied
during a memcpy call. So, the fields of the structure to which driver
points to never gets modified and therefore the argument can be made
const.
Add const to the prototype too.

Signed-off-by: Bhumika Goyal <bhumirks@...il.com>
---
 sound/oss/dev_table.c | 2 +-
 sound/oss/dev_table.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c
index 6dad515..dbb9a3b 100644
--- a/sound/oss/dev_table.c
+++ b/sound/oss/dev_table.c
@@ -48,7 +48,7 @@ struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = {
 
 static int sound_alloc_audiodev(void);
 
-int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
+int sound_install_audiodrv(int vers, char *name, const struct audio_driver *driver,
 			int driver_size, int flags, unsigned int format_mask,
 			void *devc, int dma1, int dma2)
 {
diff --git a/sound/oss/dev_table.h b/sound/oss/dev_table.h
index 0199a31..b388ed0 100644
--- a/sound/oss/dev_table.h
+++ b/sound/oss/dev_table.h
@@ -371,7 +371,7 @@ struct sound_timer_operations
 
 #define AUDIO_DRIVER_VERSION	2
 #define MIXER_DRIVER_VERSION	2
-int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
+int sound_install_audiodrv(int vers, char *name, const struct audio_driver *driver,
 			int driver_size, int flags, unsigned int format_mask,
 			void *devc, int dma1, int dma2);
 int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ