mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 13:52:22 +08:00
nuttx: use sizeof instead of define or number in snprintf
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
dd7ecd9aef
commit
d252b6229f
@@ -161,7 +161,7 @@ Sample Code to Mount the ROMFS Filesystem
|
||||
|
||||
/* Use the minor number to create a name for the ROM disk block device */
|
||||
|
||||
snprintf(devname, 32, "/dev/ram%d", minor);
|
||||
snprintf(devname, sizeof(devname), "/dev/ram%d", minor);
|
||||
|
||||
/* Mount the ROMFS file system */
|
||||
|
||||
|
||||
@@ -789,7 +789,7 @@ int lc823450_mtd_uninitialize(uint32_t devno)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devname, 16, "/dev/mtdblock%" PRId32, devno);
|
||||
snprintf(devname, sizeof(devname), "/dev/mtdblock%" PRId32, devno);
|
||||
|
||||
#ifdef CONFIG_MTD_REGISTRATION
|
||||
mtd_unregister(g_mtdmaster[ch]);
|
||||
|
||||
@@ -750,7 +750,7 @@ static int phyplus_stub_ioctl(struct file *filep, int cmd,
|
||||
int phyplus_stub_register(void)
|
||||
{
|
||||
char devname[16];
|
||||
snprintf(devname, 16, "/dev/phyplus");
|
||||
snprintf(devname, sizeof(devname), "/dev/phyplus");
|
||||
return register_driver(devname, &g_stub_drvrops, 0666, NULL);
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ int phyplus_stub_register(void)
|
||||
void phyplus_stub_unregister(void)
|
||||
{
|
||||
char devname[16];
|
||||
snprintf(devname, 16, "/dev/phyplus");
|
||||
snprintf(devname, sizeof(devname), "/dev/phyplus");
|
||||
unregister_driver(devname);
|
||||
}
|
||||
|
||||
|
||||
@@ -596,18 +596,16 @@ static int phyplus_getstatus(struct timer_lowerhalf_s *lower,
|
||||
int phyplus_timer_register(struct phyplus_timer_param_s
|
||||
*phyplus_timer_param)
|
||||
{
|
||||
const char *fmt;
|
||||
char devname[16];
|
||||
|
||||
fmt = "/dev/timer%u";
|
||||
|
||||
if ((phyplus_timer_param->timer_idx < 1) ||
|
||||
(phyplus_timer_param->timer_idx > 6))
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devname, 16, fmt, (unsigned int)phyplus_timer_param->timer_idx);
|
||||
snprintf(devname, sizeof(devname), "/dev/timer%u",
|
||||
phyplus_timer_param->timer_idx);
|
||||
return phyplus_timer_initialize(devname, phyplus_timer_param->timer_idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ int s32k1xx_eeeprom_register(int minor, uint32_t size)
|
||||
|
||||
/* Create a eeeprom device name */
|
||||
|
||||
snprintf(devname, 16, "/dev/eeeprom%d", minor);
|
||||
snprintf(devname, sizeof(devname), "/dev/eeeprom%d", minor);
|
||||
|
||||
/* Inode private data is a reference to the eeeprom device structure */
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@ int board_audio_initialize_driver(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/CXD56 audio device. */
|
||||
|
||||
@@ -524,7 +524,7 @@ int board_audio_initialize_driver(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm_in%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm_in%d", minor);
|
||||
|
||||
/* Finally, we can register the CXD56 audio input device. */
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ int lc823450_wm8776initialize(int minor)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
ret = audio_register(devname, pcm);
|
||||
|
||||
|
||||
@@ -256,7 +256,8 @@ static inline void lpc31_initsrc(void)
|
||||
|
||||
/* Now mount the file system */
|
||||
|
||||
snprintf(devname, 16, "/dev/mmcsd%d", CONFIG_EA3131_PAGING_MINOR);
|
||||
snprintf(devname, sizeof(devname), "/dev/mmcsd%d",
|
||||
CONFIG_EA3131_PAGING_MINOR);
|
||||
ret = nx_mount(devname, CONFIG_EA3131_PAGING_MOUNTPT, "vfat",
|
||||
MS_RDONLY, NULL);
|
||||
DEBUGASSERT(ret == OK);
|
||||
|
||||
@@ -257,7 +257,8 @@ static inline void lpc31_initsrc(void)
|
||||
|
||||
/* Now mount the file system */
|
||||
|
||||
snprintf(devname, 16, "/dev/mmcsd%d", CONFIG_EA3152_PAGING_MINOR);
|
||||
snprintf(devname, sizeof(devname), "/dev/mmcsd%d",
|
||||
CONFIG_EA3152_PAGING_MINOR);
|
||||
ret = nx_mount(devname, CONFIG_EA3152_PAGING_MOUNTPT, "vfat",
|
||||
MS_RDONLY, NULL);
|
||||
DEBUGASSERT(ret == OK);
|
||||
|
||||
@@ -93,7 +93,7 @@ int board_bmp180_initialize(int busno)
|
||||
{
|
||||
/* Then try to register the barometer sensor in I2C0 */
|
||||
|
||||
snprintf(devpath, 12, "/dev/press%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/press%d", devno);
|
||||
ret = bmp180_register(devpath, i2c);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ int board_i2sdev_initialize(int port)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devname, 12, "pcm%d", port);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", port);
|
||||
|
||||
ret = audio_register(devname, pcm);
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ int board_ina219_initialize(int busno)
|
||||
|
||||
/* Then register the sensor */
|
||||
|
||||
snprintf(devpath, 14, "/dev/voltamp%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/voltamp%d", devno);
|
||||
ret = ina219_register(devpath, i2c, 0x40, 100000, 0x00);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ int board_lcd_backpack_init(int devno, int busno, int rows, int cols)
|
||||
|
||||
/* Register the Segment LCD */
|
||||
|
||||
snprintf(devpath, 12, "/dev/slcd%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/slcd%d", devno);
|
||||
ret = pcf8574_lcd_backpack_register(devpath, i2c, &cfg);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ int board_max6675_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the temperature sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/temp%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/temp%d", devno);
|
||||
ret = max6675_register(devpath, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -770,7 +770,7 @@ int smbus_sbd_initialize(int minor, struct i2c_slave_s *i2c_slave_dev)
|
||||
{
|
||||
irqstate_t flags;
|
||||
struct smbus_sbd_dev_s *smbus_sbd_dev;
|
||||
char dev_name[24];
|
||||
char devname[24];
|
||||
int ret;
|
||||
|
||||
/* Make sure the initialization is not interrupted */
|
||||
@@ -789,13 +789,13 @@ int smbus_sbd_initialize(int minor, struct i2c_slave_s *i2c_slave_dev)
|
||||
{
|
||||
/* Create the device name string */
|
||||
|
||||
snprintf(dev_name, 24, "/dev/smbus-sbd%d", minor);
|
||||
snprintf(devname, sizeof(devname), "/dev/smbus-sbd%d", minor);
|
||||
|
||||
/* Register the driver. The associated private data is a reference to
|
||||
* the SMBus Smart Battery Data slave device structure.
|
||||
*/
|
||||
|
||||
ret = register_driver(dev_name, &g_smbus_sbd_fops, 0, smbus_sbd_dev);
|
||||
ret = register_driver(devname, &g_smbus_sbd_fops, 0, smbus_sbd_dev);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("register_driver failed: %d\n", -ret);
|
||||
|
||||
@@ -334,7 +334,7 @@ int sam_wm8904_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/WM8904/I2C/I2S audio device.
|
||||
*
|
||||
|
||||
@@ -123,7 +123,7 @@ int sam_audio_null_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/NULL audio device. */
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ int sam_wm8904_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/WM8904/I2C/I2S audio device.
|
||||
*
|
||||
|
||||
@@ -123,7 +123,7 @@ int sam_audio_null_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/NULL audio device. */
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ int sam_wm8904_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/WM8904/I2C/I2S audio device.
|
||||
*
|
||||
|
||||
@@ -178,7 +178,7 @@ int stm32_adau1961_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the ADAU1961/I2C/I2S audio device. */
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ int stm32_w25initialize(int minor)
|
||||
|
||||
/* Mount the file system at /mnt/w25 */
|
||||
|
||||
snprintf(devname, 12, "/mnt/w25%c", 'a' + minor);
|
||||
snprintf(devname, sizeof(devname), "/mnt/w25%c", 'a' + minor);
|
||||
ret = nx_mount(NULL, devname, "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ int board_hall3ph_initialize(int devno, int pha, int phb, int phc)
|
||||
|
||||
/* Initialize a Hall effect sensor interface. */
|
||||
|
||||
snprintf(devpath, 12, "/dev/hall%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/hall%d", devno);
|
||||
|
||||
ret = stm32_hall3ph_initialize(devpath, &cfg);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -93,7 +93,7 @@ int board_apa102_initialize(int devno, int spino)
|
||||
|
||||
/* Register the APA102 Driver at the specified location. */
|
||||
|
||||
snprintf(devpath, 13, "/dev/leddrv%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/leddrv%d", devno);
|
||||
ret = apa102_register(devpath, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ int board_apds9960_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the gesture sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/gest%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/gest%d", devno);
|
||||
ret = apds9960_register(devpath, &g_apds9960config.config);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ int board_bh1750_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the ambient light sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/light%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/light%d", devno);
|
||||
ret = bh1750fvi_register(devpath, i2c, BH1750FVI_I2C_ADDR);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ int board_bmp180_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the barometer sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/press%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/press%d", devno);
|
||||
ret = bmp180_register(devpath, i2c);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ int board_dhtxx_initialize(int devno)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devpath, 12, "/dev/hum%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/hum%d", devno);
|
||||
ret = dhtxx_register(devpath, &g_dhtxx_config);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -190,7 +190,7 @@ int board_drv8825_initialize(int devno)
|
||||
|
||||
drv8825_initialize();
|
||||
|
||||
snprintf(devname, 15, "/dev/stepper%d", devno);
|
||||
snprintf(devname, sizeof(devname), "/dev/stepper%d", devno);
|
||||
|
||||
ret = drv8825_register(devname, &g_drv8825_ops);
|
||||
|
||||
|
||||
@@ -241,6 +241,6 @@ int board_hcsr04_initialize(int devno)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devpath, 12, "/dev/dist%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/dist%d", devno);
|
||||
return hcsr04_register(devpath, &g_hcsr04config.config);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ int board_ina219_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/ina%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/ina%d", devno);
|
||||
ret = ina219_register(devpath, i2c, 0x40, 100000, 0x00);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ int board_lcd_backpack_init(int devno, int busno, int rows, int cols)
|
||||
|
||||
/* Register the Segment LCD */
|
||||
|
||||
snprintf(devpath, 12, "/dev/slcd%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/slcd%d", devno);
|
||||
ret = pcf8574_lcd_backpack_register(devpath, i2c, &cfg);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ int board_lis3dsh_initialize(int devno, int busno)
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(devpath, 12, "/dev/acc%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/acc%d", devno);
|
||||
ret = lis3dsh_register(devpath, spi, &acc0_config);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ int board_lm75_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the temperature sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/temp%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/temp%d", devno);
|
||||
ret = lm75_register(devpath, i2c, 0x48);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ int board_max31855_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the temperature sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/temp%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/temp%d", devno);
|
||||
ret = max31855_register(devpath, spi, devno);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ int board_max6675_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the temperature sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/temp%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/temp%d", devno);
|
||||
ret = max6675_register(devpath, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ int board_mlx90614_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the Infrared Thermometer sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/therm%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/therm%d", devno);
|
||||
ret = mlx90614_register(devpath, i2c, MLX90614_ADDRESS);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ int board_mpl115a_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the barometer sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/press%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/press%d", devno);
|
||||
ret = mpl115a_register(devpath, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@ int board_nunchuck_initialize(int devno, int busno)
|
||||
|
||||
/* Register the joystick device as /dev/nunchuck0 */
|
||||
|
||||
snprintf(devpath, 15, "/dev/nunchuck%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/nunchuck%d", devno);
|
||||
iinfo("Initialize joystick driver: %s\n", devpath);
|
||||
|
||||
ret = nunchuck_register(devpath, i2c);
|
||||
|
||||
@@ -55,7 +55,7 @@ int board_qencoder_initialize(int devno, int timerno)
|
||||
/* Initialize a quadrature encoder interface. */
|
||||
|
||||
sninfo("Initializing the quadrature encoder using TIM%d\n", timerno);
|
||||
snprintf(devpath, 12, "/dev/qe%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/qe%d", devno);
|
||||
ret = stm32_qeinitialize(devpath, timerno);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@ int board_tone_initialize(int devno)
|
||||
|
||||
/* Register the Audio Tone driver at "/dev/tone0" */
|
||||
|
||||
snprintf(devpath, 12, "/dev/tone%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/tone%d", devno);
|
||||
ret = tone_register(devpath, tone, oneshot);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ int board_veml6070_initialize(int devno, int busno)
|
||||
|
||||
/* Then register the light sensor */
|
||||
|
||||
snprintf(devpath, 14, "/dev/uvlight%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/uvlight%d", devno);
|
||||
ret = veml6070_register(devpath, i2c, VEML6070_I2C_DATA_LSB_CMD_ADDR);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ int board_ws2812_initialize(int devno, int spino, uint16_t nleds)
|
||||
|
||||
/* Register the WS2812 driver at the specified location. */
|
||||
|
||||
snprintf(devpath, 13, "/dev/leddrv%d", devno);
|
||||
snprintf(devpath, sizeof(devpath), "/dev/leddrv%d", devno);
|
||||
ret = ws2812_leds_register(devpath, spi, nleds);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ int stm32_w25initialize(int minor)
|
||||
|
||||
/* Mount the file system at /mnt/w25 */
|
||||
|
||||
snprintf(devname, 12, "/mnt/w25%c", 'a' + minor);
|
||||
snprintf(devname, sizeof(devname), "/mnt/w25%c", 'a' + minor);
|
||||
ret = nx_mount(NULL, devname, "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -141,7 +141,7 @@ int stm32_cs4344_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/CS4344/I2S audio device.
|
||||
*
|
||||
|
||||
@@ -126,7 +126,7 @@ int stm32_w25initialize(int minor)
|
||||
|
||||
/* Mount the file system at /mnt/w25 */
|
||||
|
||||
snprintf(devname, 12, "/mnt/w25%c", 'a' + minor);
|
||||
snprintf(devname, sizeof(devname), "/mnt/w25%c", 'a' + minor);
|
||||
ret = nx_mount(NULL, devname, "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -342,7 +342,7 @@ int stm32_cs43l22_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the PCM/CS43L22/I2C/I2S audio device.
|
||||
*
|
||||
|
||||
@@ -140,7 +140,7 @@ int board_cs4344_initialize(int devno, int port)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", devno);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", devno);
|
||||
|
||||
/* Finally, we can register the PCM/CS4344/I2S audio device.
|
||||
*
|
||||
|
||||
@@ -286,7 +286,7 @@ int stm32_wm8994_initialize(int minor)
|
||||
|
||||
/* Create a device name */
|
||||
|
||||
snprintf(devname, 12, "pcm%d", minor);
|
||||
snprintf(devname, sizeof(devname), "pcm%d", minor);
|
||||
|
||||
/* Finally, we can register the ADAU1961/I2C/I2S audio device. */
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ int stm32_adc_setup(int adcno)
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
snprintf(devname, 1, "/dev/adc%d", adcno);
|
||||
snprintf(devname, sizeof(devname), "/dev/adc%d", adcno);
|
||||
|
||||
#endif
|
||||
#if defined(CONFIG_STM32H7_ADC1)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user