pkarashchenko commented on code in PR #6965:
URL: https://github.com/apache/incubator-nuttx/pull/6965#discussion_r990691527


##########
drivers/audio/vs1053.c:
##########
@@ -1647,22 +1647,22 @@ static int vs1053_resume(FAR struct audio_lowerhalf_s 
*lower)
 static int vs1053_enqueuebuffer(FAR struct audio_lowerhalf_s *lower,
                                 FAR struct ap_buffer_s *apb)
 {
-  FAR struct vs1053_struct_s *dev = (struct vs1053_struct_s *)lower;
+  FAR struct vs1053_struct_s *dev = (FAR struct vs1053_struct_s *)lower;
   struct audio_msg_s  term_msg;

Review Comment:
   ```suggestion
     struct audio_msg_s term_msg;
   ```



##########
drivers/audio/wm8776.c:
##########
@@ -1032,11 +976,11 @@ static int wm8776_reserve(FAR struct audio_lowerhalf_s 
*dev)
 #endif
 {
   FAR struct wm8776_dev_s *priv = (FAR struct wm8776_dev_s *) dev;

Review Comment:
   ```suggestion
     FAR struct wm8776_dev_s *priv = (FAR struct wm8776_dev_s *)dev;
   ```



##########
drivers/mtd/smart.c:
##########
@@ -4406,12 +4406,12 @@ static int smart_write_alloc_sector(FAR struct 
smart_struct_s *dev,
 
   memset(dev->rwbuffer, CONFIG_SMARTFS_ERASEDSTATE, dev->sectorsize);
   header = (FAR struct smart_sect_header_s *) dev->rwbuffer;

Review Comment:
   ```suggestion
     header = (FAR struct smart_sect_header_s *)dev->rwbuffer;
   ```



##########
drivers/input/ft5x06.c:
##########
@@ -986,10 +977,10 @@ static int ft5x06_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
 static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
                         bool setup)

Review Comment:
   ```suggestion
   static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
                          bool setup)
   ```



##########
fs/rpmsgfs/rpmsgfs.c:
##########
@@ -1059,7 +1042,7 @@ static int rpmsgfs_rewinddir(FAR struct inode *mountpt,
 static int rpmsgfs_bind(FAR struct inode *blkdriver, FAR const void *data,
                         FAR void **handle)
 {
-  FAR struct rpmsgfs_mountpt_s  *fs;
+  FAR struct rpmsgfs_mountpt_s *fs;
   FAR const char *cpuname = NULL;
   FAR char *options;
   char *saveptr;

Review Comment:
   ```suggestion
     FAR char *saveptr;
   ```



##########
sched/clock/clock_getres.c:
##########
@@ -45,7 +45,7 @@
 
 int clock_getres(clockid_t clock_id, struct timespec *res)

Review Comment:
   ```suggestion
   int clock_getres(clockid_t clock_id, FAR struct timespec *res)
   ```



##########
drivers/audio/vs1053.c:
##########
@@ -1439,12 +1439,12 @@ static int vs1053_start(FAR struct audio_lowerhalf_s 
*lower,
 static int vs1053_start(FAR struct audio_lowerhalf_s *lower)
 #endif
 {
-  FAR struct vs1053_struct_s *dev = (struct vs1053_struct_s *) lower;
-  struct mq_attr      attr;
-  struct sched_param  sparam;
-  pthread_attr_t      tattr;
-  int                 ret;
-  void                *value;
+  FAR struct vs1053_struct_s *dev = (FAR struct vs1053_struct_s *)lower;
+  struct mq_attr     attr;
+  struct sched_param sparam;
+  pthread_attr_t     tattr;
+  int                ret;
+  void               *value;

Review Comment:
   ```suggestion
     FAR void           *value;
   ```



##########
drivers/audio/wm8994.c:
##########
@@ -1559,11 +1544,11 @@ static int wm8994_reserve(FAR struct audio_lowerhalf_s 
*dev)
 #endif
 {
   FAR struct wm8994_dev_s *priv = (FAR struct wm8994_dev_s *) dev;

Review Comment:
   ```suggestion
     FAR struct wm8994_dev_s *priv = (FAR struct wm8994_dev_s *)dev;
   ```



##########
boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c:
##########
@@ -119,7 +119,7 @@ extern const uint8_t romfs_data_end[];
 int stm32_romfs_initialize(void)
 {
   size_t romfs_data_len

Review Comment:
   ```suggestion
     size_t romfs_data_len;
   ```



##########
drivers/mtd/mtd_config.c:
##########
@@ -559,8 +559,8 @@ static int  mtdconfig_findnextentry(FAR struct 
mtdconfig_struct_s *dev,
 static off_t mtdconfig_ramconsolidate(FAR struct mtdconfig_struct_s *dev)
 {
   FAR uint8_t *pbuf;
-  FAR struct  mtdconfig_header_s *phdr;
-  struct      mtdconfig_header_s  hdr;
+  FAR struct mtdconfig_header_s *phdr;
+  struct mtdconfig_header_s  hdr;

Review Comment:
   ```suggestion
     struct mtdconfig_header_s hdr;
   ```



##########
drivers/usbhost/usbhost_cdcmbim.c:
##########
@@ -855,7 +823,7 @@ static void usbhost_bulkin_work(FAR void *arg)
     DRVR_ASYNCH(hport->drvr, priv->bulkin,
                 (uint8_t *)priv->rxnetbuf, CDCMBIM_NETBUF_SIZE,

Review Comment:
   ```suggestion
                   (FAR uint8_t *)priv->rxnetbuf, CDCMBIM_NETBUF_SIZE,
   ```



##########
drivers/sensors/adxl372.c:
##########
@@ -884,7 +881,7 @@ int adxl372_register(FAR const char *devpath,
 
   priv->flink         = g_adxl372_list;
   g_adxl372_list      = priv;
-  config->leaf_handle = (void *) priv;
+  config->leaf_handle = (void *)priv;

Review Comment:
   ```suggestion
     config->leaf_handle = (FAR void *)priv;
   ```



##########
drivers/input/mxt.c:
##########
@@ -1532,10 +1523,10 @@ static int mxt_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
 static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
                         bool setup)

Review Comment:
   ```suggestion
   static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
                       bool setup)
   ```



##########
drivers/usbhost/usbhost_xboxcontroller.c:
##########
@@ -234,8 +228,8 @@ static inline int usbhost_tfree(FAR struct usbhost_state_s 
*priv);
 /* struct usbhost_registry_s methods */
 
 static struct usbhost_class_s *

Review Comment:
   ```suggestion
   static FAR struct usbhost_class_s *
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.c:
##########
@@ -64,11 +64,11 @@ void bcmf_initialize_interface_frames(void)
  ****************************************************************************/
 
 void bcmf_interface_free_frame(FAR struct bcmf_dev_s  *priv,

Review Comment:
   ```suggestion
   void bcmf_interface_free_frame(FAR struct bcmf_dev_s      *priv,
   ```



##########
drivers/mtd/smart.c:
##########
@@ -4709,9 +4709,9 @@ static int smart_writesector(FAR struct smart_struct_s 
*dev,
         }
       else
         {
-          (*((FAR uint16_t *) &header->seq))++;
-          if (*((FAR uint16_t *) &header->seq) == 0xffff)
-            *((FAR uint16_t *) &header->seq) = 1;
+          (*((FAR uint16_t *)&header->seq))++;
+          if (*((FAR uint16_t *)&header->seq) == 0xffff)
+            *((FAR uint16_t *)&header->seq) = 1;

Review Comment:
   ```suggestion
             if (*((FAR uint16_t *)&header->seq) == 0xffff)
               {
                 *((FAR uint16_t *)&header->seq) = 1;
               }
   ```



##########
drivers/usbhost/usbhost_xboxcontroller.c:
##########
@@ -160,7 +160,7 @@ struct usbhost_state_s
   uint8_t                              nwaiters;     /* Number of threads 
waiting for controller data */
   sem_t                                waitsem;      /* Used to wait for 
controller data */
   int16_t                              crefs;        /* Reference count on the 
driver instance */
-  sem_t                                exclsem;      /* Used to maintain 
mutual exclusive access */
+  mutex_t                              lock;         /* Used to maintain 
mutual exclusive access */
   struct work_s                        work;         /* For interacting with 
the worker thread */
   FAR uint8_t                         *tbuffer;      /* The allocated transfer 
buffer */
   FAR uint8_t                          obuffer[20];  /* The fixed output 
transfer buffer */

Review Comment:
   ```suggestion
     uint8_t                              obuffer[20];  /* The fixed output 
transfer buffer */
   ```



##########
drivers/video/video.c:
##########
@@ -3122,8 +3094,7 @@ static int video_unregister(FAR video_mng_t *v_mgr)
     }
   else
     {
-      nxsem_destroy(&v_mgr->lock_open_num);
-
+      nxmutex_destroy(&v_mgr->lock_open_num);
       unregister_driver((const char *)v_mgr->devpath);

Review Comment:
   ```suggestion
         unregister_driver((FAR const char *)v_mgr->devpath);
   ```



##########
fs/fat/fs_fat32util.c:
##########
@@ -1127,7 +1109,7 @@ int fat_putcluster(struct fat_mountpt_s *fs, uint32_t 
clusterno,
 int fat_removechain(struct fat_mountpt_s *fs, uint32_t cluster)

Review Comment:
   ```suggestion
   int fat_removechain(FAR struct fat_mountpt_s *fs, uint32_t cluster)
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.h:
##########
@@ -140,15 +117,15 @@ void bcmf_initialize_interface_frames(void);
  ****************************************************************************/
 
 void bcmf_interface_free_frame(FAR struct bcmf_dev_s  *priv,

Review Comment:
   ```suggestion
   void bcmf_interface_free_frame(FAR struct bcmf_dev_s      *priv,
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.c:
##########
@@ -64,11 +64,11 @@ void bcmf_initialize_interface_frames(void)
  ****************************************************************************/
 
 void bcmf_interface_free_frame(FAR struct bcmf_dev_s  *priv,
-                               bcmf_interface_frame_t *iframe)
+                               FAR bcmf_interface_frame_t *iframe)
 {
   FAR bcmf_interface_dev_t *ibus = (FAR bcmf_interface_dev_t *) priv->bus;

Review Comment:
   ```suggestion
     FAR bcmf_interface_dev_t *ibus = (FAR bcmf_interface_dev_t *)priv->bus;
   ```



##########
fs/fat/fs_fat32.h:
##########
@@ -864,7 +864,7 @@ struct fat_mountpt_s
   struct inode      *fs_blkdriver; /* The block driver inode that hosts the 
FAT32 fs */
   struct fat_file_s *fs_head;      /* A list to all files opened on this 
mountpoint */

Review Comment:
   ```suggestion
     FAR struct inode      *fs_blkdriver; /* The block driver inode that hosts 
the FAT32 fs */
     FAR struct fat_file_s *fs_head;      /* A list to all files opened on this 
mountpoint */
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdpcm.c:
##########
@@ -425,9 +425,9 @@ int bcmf_sdpcm_queue_frame(FAR struct bcmf_dev_s *priv,
                            struct bcmf_frame_s *frame, bool control)

Review Comment:
   ```suggestion
                              FAR struct bcmf_frame_s *frame, bool control)
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_interface.h:
##########
@@ -140,15 +117,15 @@ void bcmf_initialize_interface_frames(void);
  ****************************************************************************/
 
 void bcmf_interface_free_frame(FAR struct bcmf_dev_s  *priv,
-                               bcmf_interface_frame_t *iframe);
+                               FAR bcmf_interface_frame_t *iframe);
 
 /****************************************************************************
  * Name: bcmf_interface_allocate_frame
  ****************************************************************************/
 
-bcmf_interface_frame_t
+FAR bcmf_interface_frame_t
 *bcmf_interface_allocate_frame(FAR struct bcmf_dev_s *priv,

Review Comment:
   I think it is better to move `*` to row above



##########
fs/smartfs/smartfs.h:
##########
@@ -33,7 +33,7 @@
 
 #include <nuttx/mtd/mtd.h>
 #include <nuttx/fs/smart.h>
-#include <nuttx/semaphore.h>
+#include <nuttx/mutex.h>

Review Comment:
   But I do not see any structures of functions here referring nxmutex.



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdpcm.c:
##########
@@ -508,10 +508,10 @@ void bcmf_sdpcm_free_frame(FAR struct bcmf_dev_s *priv,
 
 struct bcmf_frame_s *bcmf_sdpcm_get_rx_frame(FAR struct bcmf_dev_s *priv)

Review Comment:
   ```suggestion
   FAR struct bcmf_frame_s *bcmf_sdpcm_get_rx_frame(FAR struct bcmf_dev_s *priv)
   ```



##########
include/nuttx/wireless/ieee80211/bcmf_gspi.h:
##########
@@ -60,32 +61,32 @@ typedef struct gspi_dev_s
    * following fields before calling gspi_register.
    */
 
-  FAR int  (*init)            (FAR struct gspi_dev_s   *gspi);
+  CODE int  (*init)            (FAR struct gspi_dev_s  *gspi);
 
-  FAR int  (*deinit)          (FAR struct gspi_dev_s   *gspi);
+  CODE int  (*deinit)          (FAR struct gspi_dev_s  *gspi);
 
-  FAR int  (*set_isr)         (FAR struct gspi_dev_s   *gspi,
-                               xcpt_t                   thread_isr,
-                               FAR void                *thread_isr_arg);
+  CODE int  (*set_isr)         (FAR struct gspi_dev_s  *gspi,
+                                xcpt_t                  thread_isr,
+                                FAR void               *thread_isr_arg);
 
-  FAR int  (*interrupt_enable)(FAR struct gspi_dev_s   *gspi,
-                              bool                     enable);
+  CODE int  (*interrupt_enable)(FAR struct gspi_dev_s  *gspi,
+                                bool                    enable);
 
-  FAR int  (*write)           (FAR struct gspi_dev_s  *gspi,
-                               bool                    increment,
-                               enum gspi_cmd_func_e    function,
-                               uint32_t                address,
-                               uint16_t                length,
-                               FAR const uint32_t     *data);
+  CODE int  (*write)           (FAR struct gspi_dev_s *gspi,
+                                bool                   increment,
+                                enum gspi_cmd_func_e   function,
+                                uint32_t               address,
+                                uint16_t               length,
+                                FAR const uint32_t    *data);
 
-  FAR int  (*read)            (FAR struct gspi_dev_s  *gspi,
-                               bool                    increment,
-                               enum gspi_cmd_func_e    function,
-                               uint32_t                address,
-                               uint16_t                length,
-                               FAR uint32_t           *buffer);
+  CODE int  (*read)            (FAR struct gspi_dev_s *gspi,
+                                bool                   increment,
+                                enum gspi_cmd_func_e   function,
+                                uint32_t               address,
+                                uint16_t               length,
+                                FAR uint32_t          *buffer);
 
-  sem_t                exclsem;
+  mutex_t                lock;

Review Comment:
   Please add `FAR` to `io_dev` as well



-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to