aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-03-27 05:50:19 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:55:53 -0400
commit023ff3eee6255390384e050d9daab1490c88edf8 (patch)
tree225e8295feab27f88839d14cb9aeb6ad9cb64e33
parent523f1dce37434a9a6623bf46e7893e2b4b10ac3c (diff)
[ALSA] sound: strlcpy is smart enough
strlcpy already accounts for the trailing zero in its length computation, so there is no need to substract one to the buffer size. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-onyx.c4
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c
index e91f9f66f395..ded516717940 100644
--- a/sound/aoa/codecs/snd-aoa-codec-onyx.c
+++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c
@@ -1018,7 +1018,7 @@ static int onyx_create(struct i2c_adapter *adapter,
1018 onyx->i2c.driver = &onyx_driver; 1018 onyx->i2c.driver = &onyx_driver;
1019 onyx->i2c.adapter = adapter; 1019 onyx->i2c.adapter = adapter;
1020 onyx->i2c.addr = addr & 0x7f; 1020 onyx->i2c.addr = addr & 0x7f;
1021 strlcpy(onyx->i2c.name, "onyx audio codec", I2C_NAME_SIZE-1); 1021 strlcpy(onyx->i2c.name, "onyx audio codec", I2C_NAME_SIZE);
1022 1022
1023 if (i2c_attach_client(&onyx->i2c)) { 1023 if (i2c_attach_client(&onyx->i2c)) {
1024 printk(KERN_ERR PFX "failed to attach to i2c\n"); 1024 printk(KERN_ERR PFX "failed to attach to i2c\n");
@@ -1033,7 +1033,7 @@ static int onyx_create(struct i2c_adapter *adapter,
1033 goto fail; 1033 goto fail;
1034 } 1034 }
1035 1035
1036 strlcpy(onyx->codec.name, "onyx", MAX_CODEC_NAME_LEN-1); 1036 strlcpy(onyx->codec.name, "onyx", MAX_CODEC_NAME_LEN);
1037 onyx->codec.owner = THIS_MODULE; 1037 onyx->codec.owner = THIS_MODULE;
1038 onyx->codec.init = onyx_init_codec; 1038 onyx->codec.init = onyx_init_codec;
1039 onyx->codec.exit = onyx_exit_codec; 1039 onyx->codec.exit = onyx_exit_codec;
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index 041fe52cbf29..2f771f57c76f 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -899,14 +899,14 @@ static int tas_create(struct i2c_adapter *adapter,
899 tas->i2c.addr = addr; 899 tas->i2c.addr = addr;
900 /* seems that half is a saner default */ 900 /* seems that half is a saner default */
901 tas->drc_range = TAS3004_DRC_MAX / 2; 901 tas->drc_range = TAS3004_DRC_MAX / 2;
902 strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE-1); 902 strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE);
903 903
904 if (i2c_attach_client(&tas->i2c)) { 904 if (i2c_attach_client(&tas->i2c)) {
905 printk(KERN_ERR PFX "failed to attach to i2c\n"); 905 printk(KERN_ERR PFX "failed to attach to i2c\n");
906 goto fail; 906 goto fail;
907 } 907 }
908 908
909 strlcpy(tas->codec.name, "tas", MAX_CODEC_NAME_LEN-1); 909 strlcpy(tas->codec.name, "tas", MAX_CODEC_NAME_LEN);
910 tas->codec.owner = THIS_MODULE; 910 tas->codec.owner = THIS_MODULE;
911 tas->codec.init = tas_init_codec; 911 tas->codec.init = tas_init_codec;
912 tas->codec.exit = tas_exit_codec; 912 tas->codec.exit = tas_exit_codec;