You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2023/08/28 07:46:51 UTC
[GitHub] [nuttx] anchao opened a new pull request, #10420: mm/alloc: remove all unnecessary cast for alloc
anchao opened a new pull request, #10420:
URL: https://github.com/apache/nuttx/pull/10420
## Summary
mm/alloc: remove all unnecessary cast for alloc
## Impact
N/A
## Testing
ci-check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#issuecomment-1695231356
> please add a commit message
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1309104856
##########
Documentation/contributing/coding_style.rst:
##########
@@ -199,7 +199,7 @@ may be used in the file provided that it is used consistently.
malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr =
- (FAR struct some_medium_name_s *)malloc(sizeof(some_medium_name_s);
+ malloc(sizeof(some_medium_name_s);
Review Comment:
merge
##########
arch/xtensa/src/common/xtensa_oneshot.c:
##########
@@ -183,7 +183,7 @@ struct oneshot_lowerhalf_s *
xtensa_oneshot_initialize(uint32_t irq, uint32_t freq)
{
struct xoneshot_lowerhalf_s *lower =
- (struct xoneshot_lowerhalf_s *)kmm_zalloc(sizeof(*lower));
+ kmm_zalloc(sizeof(*lower));
Review Comment:
merge
##########
arch/arm/src/cxd56xx/cxd56_textheap.c:
##########
@@ -50,7 +50,7 @@
void *up_textheap_memalign(size_t align, size_t size)
{
void *ret;
- ret = (void *)kmm_malloc(size);
+ ret = kmm_malloc(size);
Review Comment:
merge
##########
arch/arm/src/cxd56xx/cxd56_usbdev.c:
##########
@@ -3394,7 +3394,7 @@ static int cxd56_usbdev_open(struct file *filep, const char *relpath,
/* Allocate the open file structure */
- priv = (struct cxd56_usbdev_file_s *)kmm_zalloc(
+ priv = kmm_zalloc(
Review Comment:
but no change
##########
arch/arm/src/kinetis/kinetis_usbhshost.c:
##########
@@ -5128,10 +5127,8 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
# ifndef CONFIG_KINETIS_EHCI_PREALLOCATE
/* Allocate a pool of free Queue Head (QH) structures */
- g_qhpool =
- (struct kinetis_qh_s *)kmm_memalign(32,
- CONFIG_KINETIS_EHCI_NQHS *
- sizeof(struct kinetis_qh_s));
+ g_qhpool = kmm_memalign(32, CONFIG_KINETIS_EHCI_NQHS *
+ sizeof(struct kinetis_qh_s));
Review Comment:
ditto
##########
arch/xtensa/src/esp32/esp32_himem_chardev.c:
##########
@@ -297,7 +297,7 @@ int himem_chardev_register(char *name, size_t size)
{
int ret = 0;
struct himem_chardev_s *dev;
- dev = (struct himem_chardev_s *)kmm_malloc(sizeof(struct himem_chardev_s));
Review Comment:
merge
##########
arch/arm/src/sama5/sam_flexcom_spi.c:
##########
@@ -1857,7 +1857,7 @@ struct spi_dev_s *sam_flex_spibus_initialize(int port)
* chip select structures.
*/
- flex_spics = (struct sam_flex_spics_s *)kmm_zalloc(
+ flex_spics = kmm_zalloc(
sizeof(struct sam_flex_spics_s));
Review Comment:
ditto
##########
arch/risc-v/src/bl602/bl602_os_hal.c:
##########
@@ -1068,7 +1068,7 @@ int bl_os_timer_start_periodic(void *timerid, long t_sec, long t_nsec)
void *bl_os_workqueue_create(void)
{
struct work_s *work = NULL;
- work = (struct work_s *)kmm_calloc(1, sizeof(struct work_s));
+ work = kmm_calloc(1, sizeof(struct work_s));
Review Comment:
merge
##########
boards/arm/stm32/stm32f429i-disco/src/stm32_bringup.c:
##########
@@ -327,7 +327,7 @@ int stm32_bringup(void)
{
uint8_t *start =
- (uint8_t *) kmm_malloc(CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);
+ kmm_malloc(CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);
Review Comment:
merge
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -5058,10 +5057,8 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
# ifndef CONFIG_IMXRT_EHCI_PREALLOCATE
/* Allocate a pool of free Queue Head (QH) structures */
- g_qhpool =
- (struct imxrt_qh_s *)kmm_memalign(32,
- CONFIG_IMXRT_EHCI_NQHS *
- sizeof(struct imxrt_qh_s));
+ g_qhpool = kmm_memalign(32, CONFIG_IMXRT_EHCI_NQHS *
+ sizeof(struct imxrt_qh_s));
Review Comment:
merge or align
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1308708525
##########
arch/arm64/src/common/arm64_fpu.c:
##########
@@ -171,7 +171,7 @@ static int arm64_fpu_procfs_open(struct file *filep, const char *relpath,
/* Allocate the open file structure */
- priv = (struct arm64_fpu_procfs_file_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct arm64_fpu_procfs_file_s));
Review Comment:
can this be merged to a single line?
##########
audio/audio.c:
##########
@@ -930,7 +930,7 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev)
/* Allocate the upper-half data structure */
- upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(
+ upper = kmm_zalloc(
sizeof(struct audio_upperhalf_s));
Review Comment:
can this be merged to a single line?
##########
fs/mount/fs_automount.c:
##########
@@ -213,7 +213,7 @@ static int automount_open(FAR struct file *filep)
/* Allocate a new open structure */
- opriv = (FAR struct automounter_open_s *)kmm_zalloc(
+ opriv = kmm_zalloc(
sizeof(struct automounter_open_s));
Review Comment:
can this be merged to a single line?
##########
arch/z80/src/z8/z8_i2c.c:
##########
@@ -638,7 +638,7 @@ FAR struct i2c_master_s *z8_i2cbus_initialize(int port)
/* Now, allocate an I2C instance for this caller */
- i2c = (FAR struct z8_i2cdev_s *)kmm_zalloc(sizeof(FAR struct z8_i2cdev_s));
+ i2c = kmm_zalloc(sizeof(FAR struct z8_i2cdev_s));
Review Comment:
```suggestion
i2c = kmm_zalloc(sizeof(struct z8_i2cdev_s));
```
##########
drivers/sensors/vl53l1x.c:
##########
@@ -1121,7 +1121,7 @@ int vl53l1x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
/* Initialize the vl53l1x device structure */
- priv = (FAR struct vl53l1x_dev_s *)kmm_malloc(
+ priv = kmm_malloc(
sizeof(struct vl53l1x_dev_s));
Review Comment:
can this be merged to a single line?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1309107477
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -5081,10 +5078,8 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
# ifndef CONFIG_IMXRT_EHCI_PREALLOCATE
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
- g_qtdpool =
- (struct imxrt_qtd_s *)kmm_memalign(32,
- CONFIG_IMXRT_EHCI_NQTDS *
- sizeof(struct imxrt_qtd_s));
+ g_qtdpool = kmm_memalign(32, CONFIG_IMXRT_EHCI_NQTDS *
+ sizeof(struct imxrt_qtd_s));
Review Comment:
ditto
##########
arch/arm/src/kinetis/kinetis_usbhshost.c:
##########
@@ -5151,10 +5148,8 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
# ifndef CONFIG_KINETIS_EHCI_PREALLOCATE
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
- g_qtdpool =
- (struct kinetis_qtd_s *)kmm_memalign(32,
- CONFIG_KINETIS_EHCI_NQTDS *
- sizeof(struct kinetis_qtd_s));
+ g_qtdpool = kmm_memalign(32, CONFIG_KINETIS_EHCI_NQTDS *
Review Comment:
ditto
##########
drivers/leds/pca9635pw.c:
##########
@@ -341,7 +341,7 @@ int pca9635pw_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the PCA9635PW device structure */
FAR struct pca9635pw_dev_s *priv =
- (FAR struct pca9635pw_dev_s *)kmm_malloc(sizeof(struct pca9635pw_dev_s));
+ kmm_malloc(sizeof(struct pca9635pw_dev_s));
Review Comment:
merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1308209089
##########
arch/arm/src/kinetis/kinetis_usbhshost.c:
##########
@@ -5152,7 +5152,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
g_qtdpool =
- (struct kinetis_qtd_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1309105370
##########
arch/arm/src/cxd56xx/cxd56_gnss.c:
##########
@@ -3131,7 +3131,7 @@ static int cxd56_gnss_register(const char *devpath)
}
};
- priv = (struct cxd56_gnss_dev_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct cxd56_gnss_dev_s));
Review Comment:
merge
##########
boards/arm/stm32/mikroe-stm32f4/src/stm32_appinit.c:
##########
@@ -291,7 +291,7 @@ int board_app_initialize(uintptr_t arg)
#if defined(CONFIG_RAMMTD) && defined(CONFIG_MIKROE_RAMMTD)
{
uint8_t *start =
- (uint8_t *) kmm_malloc(CONFIG_MIKROE_RAMMTD_SIZE * 1024);
+ kmm_malloc(CONFIG_MIKROE_RAMMTD_SIZE * 1024);
Review Comment:
merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1308350553
##########
arch/arm/src/cxd56xx/cxd56_geofence.c:
##########
@@ -631,7 +631,7 @@ static int cxd56_geofence_register(const char *devpath)
struct cxd56_geofence_dev_s *priv;
int ret;
- priv = (struct cxd56_geofence_dev_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct cxd56_geofence_dev_s));
Review Comment:
can this be merged to one line?
##########
arch/risc-v/src/bl602/bl602_oneshot_lowerhalf.c:
##########
@@ -366,7 +366,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
- priv = (struct bl602_oneshot_lowerhalf_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct bl602_oneshot_lowerhalf_s));
Review Comment:
can this be merged to a one line?
##########
arch/xtensa/src/esp32/esp32_oneshot_lowerhalf.c:
##########
@@ -348,7 +348,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
- priv = (struct esp32_oneshot_lowerhalf_s *)kmm_zalloc(
+ priv = kmm_zalloc(
Review Comment:
can this be merged to a one line?
##########
arch/xtensa/src/esp32/esp32_wlan.c:
##########
@@ -416,7 +416,7 @@ static inline struct wlan_pktbuf *wlan_alloc_buffer(struct wlan_priv_s *priv)
return NULL;
}
- pktbuf = (struct wlan_pktbuf *)kmm_malloc(
+ pktbuf = kmm_malloc(
sizeof(struct wlan_pktbuf) + WLAN_BUF_SIZE);
Review Comment:
can this be merged to a one line?
##########
drivers/analog/dac7554.c:
##########
@@ -246,11 +246,11 @@ FAR struct dac_dev_s *dac7554_initialize(FAR struct spi_dev_s *spi,
/* Initialize the DAC7554 device structure */
priv =
- (FAR struct dac7554_dev_s *)kmm_malloc(sizeof(struct dac7554_dev_s));
+ kmm_malloc(sizeof(struct dac7554_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/audio/tone.c:
##########
@@ -940,7 +940,7 @@ int tone_register(FAR const char *path, FAR struct pwm_lowerhalf_s *tone,
/* Allocate the upper-half data structure */
upper =
- (FAR struct tone_upperhalf_s *)kmm_zalloc(
+ kmm_zalloc(
sizeof(struct tone_upperhalf_s));
Review Comment:
can this be merged to a one line?
##########
drivers/sensors/as726x.c:
##########
@@ -398,7 +398,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
/* Initialize the AS726X device structure */
FAR struct as726x_dev_s *priv =
- (FAR struct as726x_dev_s *)kmm_malloc(sizeof(struct as726x_dev_s));
+ kmm_malloc(sizeof(struct as726x_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/sensors/bh1750fvi.c:
##########
@@ -372,7 +372,7 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the BH1750FVI device structure */
FAR struct bh1750fvi_dev_s *priv =
- (FAR struct bh1750fvi_dev_s *)kmm_malloc(sizeof(struct bh1750fvi_dev_s));
+ kmm_malloc(sizeof(struct bh1750fvi_dev_s));
Review Comment:
can this be merged to a one line?
##########
sched/mqueue/msginternal.c:
##########
@@ -107,7 +107,7 @@ void nxmsg_initialize(void)
{
FAR struct msgbuf_s *msg;
- msg = (FAR struct msgbuf_s *)kmm_malloc(sizeof(*msg) *
+ msg = kmm_malloc(sizeof(*msg) *
CONFIG_PREALLOC_MQ_MSGS);
Review Comment:
please align
##########
drivers/video/video.c:
##########
@@ -834,7 +834,7 @@ static int initialize_scene_parameter(FAR video_mng_t *vmng,
video_scene_params_t **vsp)
{
video_scene_params_t *sp =
- (FAR video_scene_params_t *)kmm_malloc(sizeof(video_scene_params_t));
+ kmm_malloc(sizeof(video_scene_params_t));
Review Comment:
can this be merged to a one line?
##########
arch/arm/src/cxd56xx/cxd56_hostif.c:
##########
@@ -393,7 +393,7 @@ static int hif_initialize(struct hostif_buff_s *buffer)
/* Setup driver structure */
drv->dev =
- (struct cxd56_hifdev_s *)kmm_malloc(sizeof(struct cxd56_hifdev_s) * num);
+ kmm_malloc(sizeof(struct cxd56_hifdev_s) * num);
Review Comment:
can this be merged to a one line?
##########
arch/xtensa/src/esp32s2/esp32s2_oneshot_lowerhalf.c:
##########
@@ -348,7 +348,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
- priv = (struct esp32s2_oneshot_lowerhalf_s *)kmm_zalloc(
+ priv = kmm_zalloc(
Review Comment:
can this be merged to a one line?
##########
arch/risc-v/src/common/riscv_addrenv_kstack.c:
##########
@@ -65,7 +65,7 @@ int up_addrenv_kstackalloc(struct tcb_s *tcb)
/* Allocate the kernel stack */
- tcb->xcp.kstack = (uintptr_t *)kmm_memalign(STACK_ALIGNMENT,
+ tcb->xcp.kstack = kmm_memalign(STACK_ALIGNMENT,
ARCH_KERNEL_STACKSIZE);
Review Comment:
```suggestion
tcb->xcp.kstack = kmm_memalign(STACK_ALIGNMENT,
ARCH_KERNEL_STACKSIZE);
```
##########
boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c:
##########
@@ -802,7 +802,7 @@ int smbus_sbd_initialize(int minor, struct i2c_slave_s *i2c_slave_dev)
/* Allocate the SMBus Smart Battery Data slave data structure */
smbus_sbd_dev->data =
- (struct smbus_sbd_data_s *)kmm_zalloc(sizeof(struct smbus_sbd_data_s));
+ kmm_zalloc(sizeof(struct smbus_sbd_data_s));
Review Comment:
can this be merged to a one line?
##########
arch/risc-v/src/esp32c3/esp32c3_oneshot_lowerhalf.c:
##########
@@ -348,7 +348,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
- priv = (struct esp32c3_oneshot_lowerhalf_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct esp32c3_oneshot_lowerhalf_s));
Review Comment:
can this be merged to a one line?
##########
boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c:
##########
@@ -771,7 +771,7 @@ int smbus_sbd_initialize(int minor, struct i2c_slave_s *i2c_slave_dev)
/* Allocate an SMBus Smart Battery Data slave device structure */
smbus_sbd_dev =
- (struct smbus_sbd_dev_s *)kmm_zalloc(sizeof(struct smbus_sbd_dev_s));
+ kmm_zalloc(sizeof(struct smbus_sbd_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/analog/ads1242.c:
##########
@@ -585,7 +585,7 @@ int ads1242_register(FAR const char *devpath, FAR struct spi_dev_s *spi,
/* Initialize the ADS1242 device structure */
priv =
- (FAR struct ads1242_dev_s *)kmm_malloc(sizeof(struct ads1242_dev_s));
+ kmm_malloc(sizeof(struct ads1242_dev_s));
Review Comment:
can this be merged to a one line?
##########
arch/xtensa/src/esp32s3/esp32s3_oneshot_lowerhalf.c:
##########
@@ -344,7 +344,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan, uint16_t resolution)
/* Allocate an instance of the lower-half driver */
- priv = (struct esp32s3_oneshot_lowerhalf_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct esp32s3_oneshot_lowerhalf_s));
Review Comment:
can this be merged to a one line?
##########
drivers/leds/ncp5623c.c:
##########
@@ -269,7 +269,7 @@ int ncp5623c_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the NCP5623C device structure */
FAR struct ncp5623c_dev_s *priv =
- (FAR struct ncp5623c_dev_s *)kmm_malloc(sizeof(struct ncp5623c_dev_s));
+ kmm_malloc(sizeof(struct ncp5623c_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/input/stmpe811_base.c:
##########
@@ -266,7 +266,7 @@ STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_master_s *dev,
/* Allocate the device state structure */
#ifdef CONFIG_STMPE811_MULTIPLE
- priv = (FAR struct stmpe811_dev_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct stmpe811_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/input/spq10kbd.c:
##########
@@ -973,7 +973,7 @@ int spq10kbd_register(FAR struct i2c_master_s *i2c,
DEBUGASSERT(config->attach != NULL && config->enable != NULL &&
config->clear != NULL);
- priv = (FAR struct spq10kbd_dev_s *)kmm_zalloc(
+ priv = kmm_zalloc(
sizeof(struct spq10kbd_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/power/battery/bq27426.c:
##########
@@ -419,7 +419,7 @@ FAR struct battery_gauge_dev_s *bq27426_initialize(
/* Initialize the bq27426 device structure */
- priv = (FAR struct bq27426_dev_s *)kmm_zalloc(sizeof(
+ priv = kmm_zalloc(sizeof(
struct bq27426_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/leds/lp503x.c:
##########
@@ -925,7 +925,7 @@ int lp503x_register(const char *devpath, struct i2c_master_s *i2c,
/* Initialize the LP503X device structure */
struct lp503x_dev_s *priv =
Review Comment:
for other PR: `FAR` is missing
##########
drivers/analog/ltc1867l.c:
##########
@@ -319,7 +319,7 @@ int ltc1867l_register(FAR const char *devpath, FAR struct spi_dev_s *spi,
/* Initialize the LTC1867L device structure */
adcpriv =
- (FAR struct ltc1867l_dev_s *)kmm_malloc(sizeof(struct ltc1867l_dev_s));
+ kmm_malloc(sizeof(struct ltc1867l_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/lcd/tda19988.c:
##########
@@ -722,7 +722,7 @@ static int tda19988_fetch_edid(struct tda1988_dev_s *priv)
int i;
edid_len = EDID_LENGTH * (blocks + 1);
Review Comment:
```suggestion
edid_len = EDID_LENGTH * (blocks + 1);
```
##########
drivers/leds/lp503x.c:
##########
@@ -925,7 +925,7 @@ int lp503x_register(const char *devpath, struct i2c_master_s *i2c,
/* Initialize the LP503X device structure */
struct lp503x_dev_s *priv =
- (struct lp503x_dev_s *)kmm_malloc(sizeof(struct lp503x_dev_s));
+ kmm_malloc(sizeof(struct lp503x_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/ioexpander/pca9538.c:
##########
@@ -908,7 +908,7 @@ FAR struct ioexpander_dev_s *pca9538_initialize
#ifdef CONFIG_PCA9538_MULTIPLE
/* Allocate the device state structure */
- pcadev = (FAR struct pca9538_dev_s *)kmm_zalloc
+ pcadev = kmm_zalloc
(sizeof(struct pca9538_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/sensors/apds9960.c:
##########
@@ -1199,7 +1199,7 @@ int apds9960_register(FAR const char *devpath,
/* Initialize the APDS9960 device structure */
FAR struct apds9960_dev_s *priv =
- (FAR struct apds9960_dev_s *)kmm_zalloc(sizeof(struct apds9960_dev_s));
+ kmm_zalloc(sizeof(struct apds9960_dev_s));
Review Comment:
can this be merged to a one line?
##########
sched/signal/sig_dispatch.c:
##########
@@ -170,7 +170,7 @@ static FAR sigpendq_t *nxsig_alloc_pendingsignal(void)
{
/* No... Allocate the pending signal */
- sigpend = (FAR sigpendq_t *)kmm_malloc((sizeof (sigpendq_t)));
+ sigpend = kmm_malloc((sizeof (sigpendq_t)));
Review Comment:
```suggestion
sigpend = kmm_malloc(sizeof(sigpendq_t));
```
##########
drivers/sensors/veml6070.c:
##########
@@ -274,7 +274,7 @@ int veml6070_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the VEML6070 device structure */
FAR struct veml6070_dev_s *priv =
- (FAR struct veml6070_dev_s *)kmm_malloc(sizeof(struct veml6070_dev_s));
+ kmm_malloc(sizeof(struct veml6070_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/usbdev/usbmsc.c:
##########
@@ -1456,10 +1456,10 @@ int usbmsc_bindlun(FAR void *handle, FAR const char *drvrpath,
if (!priv->iobuffer)
{
#ifdef CONFIG_USBMSC_WRMULTIPLE
- priv->iobuffer = (FAR uint8_t *)kmm_malloc(geo.geo_sectorsize *
+ priv->iobuffer = kmm_malloc(geo.geo_sectorsize *
CONFIG_USBMSC_NWRREQS);
Review Comment:
please align
##########
drivers/usbhost/usbhost_cdcmbim.c:
##########
@@ -629,7 +629,7 @@ static inline FAR struct usbhost_cdcmbim_s *usbhost_allocclass(void)
FAR struct usbhost_cdcmbim_s *priv;
DEBUGASSERT(!up_interrupt_context());
- priv = (FAR struct usbhost_cdcmbim_s *)kmm_malloc(
+ priv = kmm_malloc(
sizeof(struct usbhost_cdcmbim_s));
Review Comment:
can this be merged to a one line?
##########
sched/signal/sig_initialize.c:
##########
@@ -128,7 +128,7 @@ static FAR sigq_t *nxsig_alloc_block(sq_queue_t *siglist, uint16_t nsigs,
/* Allocate a block of pending signal actions. */
- sigqalloc = (FAR sigq_t *)kmm_malloc((sizeof(sigq_t)) * nsigs);
+ sigqalloc = kmm_malloc((sizeof(sigq_t)) * nsigs);
Review Comment:
```suggestion
sigqalloc = kmm_malloc(sizeof(sigq_t) * nsigs);
```
##########
sched/signal/sig_allocpendingsigaction.c:
##########
@@ -85,7 +85,7 @@ FAR sigq_t *nxsig_alloc_pendingsigaction(void)
{
/* No...Try the resource pool */
- sigq = (FAR sigq_t *)kmm_malloc((sizeof (sigq_t)));
+ sigq = kmm_malloc((sizeof (sigq_t)));
Review Comment:
```suggestion
sigq = kmm_malloc(sizeof(sigq_t));
```
##########
drivers/sensors/mcp9844.c:
##########
@@ -362,7 +362,7 @@ int mcp9844_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
/* Initialize the MCP9844 device structure */
FAR struct mcp9844_dev_s *priv =
- (FAR struct mcp9844_dev_s *)kmm_malloc(sizeof(struct mcp9844_dev_s));
+ kmm_malloc(sizeof(struct mcp9844_dev_s));
Review Comment:
can this be merged to a one line?
##########
drivers/video/video.c:
##########
@@ -834,7 +834,7 @@ static int initialize_scene_parameter(FAR video_mng_t *vmng,
video_scene_params_t **vsp)
{
video_scene_params_t *sp =
Review Comment:
`FAR` is missing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 merged pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #10420:
URL: https://github.com/apache/nuttx/pull/10420
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#issuecomment-1697111177
@pkarashchenko all addressed, thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1307419869
##########
arch/arm/src/kinetis/kinetis_usbhshost.c:
##########
@@ -5129,7 +5129,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
/* Allocate a pool of free Queue Head (QH) structures */
g_qhpool =
- (struct kinetis_qh_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
align
##########
arch/arm/src/kinetis/kinetis_usbhshost.c:
##########
@@ -5152,7 +5152,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
g_qtdpool =
- (struct kinetis_qtd_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
align
##########
arch/arm/src/cxd56xx/cxd56_usbdev.c:
##########
@@ -3394,7 +3394,7 @@ static int cxd56_usbdev_open(struct file *filep, const char *relpath,
/* Allocate the open file structure */
- priv = (struct cxd56_usbdev_file_s *)kmm_zalloc(
+ priv = kmm_zalloc(
Review Comment:
ditto
##########
arch/arm/src/cxd56xx/cxd56_usbdev.c:
##########
@@ -3489,7 +3489,7 @@ static int cxd56_usbdev_dup(const struct file *oldp,
/* Allocate a new container to hold the task and attribute selection */
- newattr = (struct cxd56_usbdev_file_s *)kmm_malloc(
+ newattr = kmm_malloc(
Review Comment:
ditto
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -5082,7 +5082,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
g_qtdpool =
- (struct imxrt_qtd_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
ditto
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -5059,7 +5059,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
/* Allocate a pool of free Queue Head (QH) structures */
g_qhpool =
- (struct imxrt_qh_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#issuecomment-1697621522
> Please fix the leftovers and we can move to merge
@pkarashchenko Done, please review again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #10420: mm/alloc: remove all unnecessary cast for alloc
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #10420:
URL: https://github.com/apache/nuttx/pull/10420#discussion_r1308208899
##########
arch/arm/src/cxd56xx/cxd56_usbdev.c:
##########
@@ -3394,7 +3394,7 @@ static int cxd56_usbdev_open(struct file *filep, const char *relpath,
/* Allocate the open file structure */
- priv = (struct cxd56_usbdev_file_s *)kmm_zalloc(
+ priv = kmm_zalloc(
Review Comment:
Done
##########
arch/arm/src/cxd56xx/cxd56_usbdev.c:
##########
@@ -3489,7 +3489,7 @@ static int cxd56_usbdev_dup(const struct file *oldp,
/* Allocate a new container to hold the task and attribute selection */
- newattr = (struct cxd56_usbdev_file_s *)kmm_malloc(
+ newattr = kmm_malloc(
Review Comment:
Done
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -5059,7 +5059,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
/* Allocate a pool of free Queue Head (QH) structures */
g_qhpool =
- (struct imxrt_qh_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
Done
##########
arch/arm/src/imxrt/imxrt_ehci.c:
##########
@@ -5082,7 +5082,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
g_qtdpool =
- (struct imxrt_qtd_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
Done
##########
arch/arm/src/kinetis/kinetis_usbhshost.c:
##########
@@ -5129,7 +5129,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
/* Allocate a pool of free Queue Head (QH) structures */
g_qhpool =
- (struct kinetis_qh_s *)kmm_memalign(32,
+ kmm_memalign(32,
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org