diff src/ui/mfw/mfw_ffs.c @ 188:92abb46dc1ba

src/ui/mfw/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 06:10:27 +0000
parents 67bfe9f274f6
children
line wrap: on
line diff
--- a/src/ui/mfw/mfw_ffs.c	Tue Jan 19 05:41:26 2021 +0000
+++ b/src/ui/mfw/mfw_ffs.c	Tue Jan 19 06:10:27 2021 +0000
@@ -18,40 +18,40 @@
     ETM . ETM shows error "Maximum open file reached"
     Solution: As the relience flag is enabled, to solve this issue, function Flash_formatted()
     is now checking the return value of ffs_opendir() to close the mmi/ directory properly.
-    Also MMI is calling mfw_close_dir() to close mmi/jpeg/ directory while exiting from camera 
+    Also MMI is calling mfw_close_dir() to close mmi/jpeg/ directory while exiting from camera
     application.
 
 
-	Jan 10, 2007 DR: OMAPS00110568 x0039928	
+	Jan 10, 2007 DR: OMAPS00110568 x0039928
 	Description: Remove duplication of FFS.Flashdata from GDI
 	Solution: Added two new functions get_ffs_tty_status() and get_ffs_ttypftype()
-	
+
     	Nov 07, 2006 ER: OMAPS00102732 x0pleela
 	Description: FFS Support for Intel Sibley Flash - Intel 256+64 non-ADMUX (PF38F4050M0Y0C0Q)
-	Solution: Closing the opened directory if readdir is not successful and the new code 
+	Solution: Closing the opened directory if readdir is not successful and the new code
    			is under the compilation flag FF_MMI_RELIANCE_FFS
 
    	Sep 08, 2006 DR: OMAPS00091250 x0pleela
  	Description:The phone resets if no MEPD data is presented
- 	Solution: Added new function ffs_flash_write() which writes a string into FFS 	
+ 	Solution: Added new function ffs_flash_write() which writes a string into FFS
 
     xrashmic 22 Aug, 2004 MMI-SPR-32798
     Adding the support for screen capture using a dynamically assigned key.
 
     Apr 14, 2005	REF: CRR 29991   xpradipg
-    Description:	Optimisation 5: Remove the static allocation and use dynamic 
+    Description:	Optimisation 5: Remove the static allocation and use dynamic
     			allocation/ deallocation for pb_list and black_list
     Solution:	The static definition is removed and replaced with the dynamic
-    			allocation   
+    			allocation
 
-    Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu 
+    Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu
     Issue description:  Golite booting problem.
     Solution: If the FFS is not formatted, prevent writing into FFS.
 
     Aug 25, 2004  REF: CRR 20655  xnkulkar
     Description: Voice Memo functionality not working
-    Solution:	  The voice recording functionality was failing because 
-    			 " mmi" folder is not present. As a solution, we create the 
+    Solution:	  The voice recording functionality was failing because
+    			 " mmi" folder is not present. As a solution, we create the
     			 "mmi" folder and then proceed with recording.
 */
 
@@ -132,7 +132,7 @@
 #endif
 #endif
 
-//	Apr 14, 2005	REF: CRR 29991   xpradipg 
+//	Apr 14, 2005	REF: CRR 29991   xpradipg
 //	New file added for the blacklist. The total length along with the path aand
 //	file name should not exceed 20 characters
 #ifdef FF_MMI_OPTIM
@@ -146,7 +146,7 @@
 #endif
 #ifdef TI_PS_HCOMM_CHANGE
 #define _hCommMMI  hCommACI
-#else 
+#else
 #define hCommMMI  hCommACI
 #endif
 
@@ -185,16 +185,16 @@
 */
 //x0pleela 08 Sep, 2006  DR: OMAPS00091250
 void mfw_flash_write(char *Msg,...)
-{  
-	fd_t fd= -1;   
-	char log_ffs_buf[256];	
+{
+	fd_t fd= -1;
+	char log_ffs_buf[256];
 	va_list varpars;
-	va_start (varpars, Msg);      
+	va_start (varpars, Msg);
 	vsprintf(log_ffs_buf,Msg,varpars);
-	va_end (varpars);   
-	
+	va_end (varpars);
+
 	fd = ffs_open((const char*)"/mmiMEPD", FFS_O_APPEND | FFS_O_WRONLY );
-	if(fd < 0) 
+	if(fd < 0)
 		fd=ffs_open((const char*)"/mmiMEPD", FFS_O_CREATE |FFS_O_WRONLY );
 	if(fd > 0)
 	{
@@ -204,17 +204,17 @@
 }
 
 effs_t flash_write(void)
-{ 
+{
 
-//  Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu 
+//  Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu
 //  Issue description:  Golite booting problem.
 //  Solution: If the FFS is not formatted, dont write into the FFS.
-               
-	if ( flash_formatted() == TRUE) 
+
+	if ( flash_formatted() == TRUE)
 	{
   		return (flash_data_write("/mmi","mmidata",  &FFS_flashData, sizeof(FFS_flashData)));
 	}
-	else 
+	else
 	{
 		TRACE_EVENT("ERROR flash_data_write(): NOT FORMATTED!");
 		// Return NOT formatted message.
@@ -254,7 +254,7 @@
         TRACE_EVENT_P1("val = %d", val);
         /* Error, presumably -ve as in FFS_ERRORS, or the actual number of bytes read */
     }
-    return val; 	
+    return val;
 }
 #else
 int flash_read()
@@ -270,7 +270,7 @@
 #endif
 
 effs_t flash_data_write(const char* dir_name, const char* file_name, void* data_pointer, int data_size)
-{ 
+{
     T_FFS_DIR dir;
     int val;
     char file[200];
@@ -282,7 +282,7 @@
         return EFFS_NOFORMAT;
     }
 
-#ifndef PCM_2_FFS   
+#ifndef PCM_2_FFS
     val = FFS_opendir(dir_name, &dir);
 #else
     val = ffs_opendir((const signed char *)dir_name, &dir);
@@ -290,8 +290,8 @@
 
     if(val < 0)
     {
-    
-#ifndef PCM_2_FFS    
+
+#ifndef PCM_2_FFS
         val = FFS_mkdir(dir_name);
 #else
 	val = ffs_mkdir(dir_name);
@@ -305,23 +305,23 @@
         default:
                 TRACE_ERROR("The FFS directory could not be created!");
               	TRACE_EVENT_P2("val = %d dir name = %s", val, dir_name);
-            return (effs_t)val; 	
+            return (effs_t)val;
         }
     }
 
     sprintf(file, "%s/%s", dir_name, file_name);
-	
-#ifdef PCM_2_FFS	
+
+#ifdef PCM_2_FFS
     val = ffs_fwrite( (const S8 *) file, data_pointer, data_size);
 #else
     val = FFS_fwrite( file, data_pointer, data_size);
 #endif
 
     if(val NEQ EFFS_OK)
-    {  
+    {
         TRACE_ERROR("The FFS file could not be created");
       	TRACE_EVENT_P2("val = %d file name = %s", val, file);
-    }  
+    }
 
 
 //x0pleela 07 Nov, 2006 DVT: OMAPS00102732
@@ -329,16 +329,16 @@
 #if defined ( PCM_2_FFS    ) || defined( FF_MMI_RELIANCE_FFS)
     ffs_closedir( &dir );
 #endif
-    
+
     return (effs_t)val;
 }
 
 /* Marcus: Issue 1719: 11/02/2003: Changed return value from effs_t to int */
 int flash_data_read(const char* dir_name, const char* file_name, void* data_pointer, int data_size)
-{ 
+{
     int val;
     char file[200];
-      
+
     sprintf(file, "%s/%s", dir_name, file_name);
 
 #ifdef PCM_2_FFS
@@ -346,7 +346,7 @@
 #else
     val = FFS_fread( file, data_pointer, data_size);
 #endif
-    
+
     if (val NEQ data_size)
     {
         TRACE_ERROR("The FFS data could not be read!");
@@ -364,14 +364,14 @@
    char sFileName[100];
 
     /* Attempt to open "/mmi" directory */
-#ifndef PCM_2_FFS    
+#ifndef PCM_2_FFS
     val = FFS_opendir("/mmi", &dir);
 #else
 	val = ffs_opendir("/mmi", &dir);
-#endif	
-    
+#endif
 
-    /* If return val is not EFFS_NOFORMAT then 
+
+    /* If return val is not EFFS_NOFORMAT then
      * assume that FFS is formatted.
      */
     if (val == EFFS_NOFORMAT)
@@ -384,21 +384,21 @@
             while (ffs_readdir (&dir, sFileName, 100) > 0x0 );
 
 	//x0pleela 07 Nov, 2006 DVT: OMAPS00102732
-	//Adding the MMI compilation flag FF_MMI_RELIANCE_FFS			
-		//x0pleela 31 Oct, 2006  
+	//Adding the MMI compilation flag FF_MMI_RELIANCE_FFS
+		//x0pleela 31 Oct, 2006
 		//Closing the directory aa per the new FFS logic
-#ifdef FF_MMI_RELIANCE_FFS		
+#ifdef FF_MMI_RELIANCE_FFS
 		ffs_closedir(&dir);
 #endif
             	return TRUE;
-           
+
         }
-        else if (EFFS_NOTFOUND == val) 
-        {                                               
+        else if (EFFS_NOTFOUND == val)
+        {
             /* if the mmi directory was not found, but the FFS was formatted, */
             /* create the mmi dir.*/
 
-#ifndef PCM_2_FFS    
+#ifndef PCM_2_FFS
             val = FFS_mkdir("/mmi");
 #else
             val = ffs_mkdir("/mmi");
@@ -416,7 +416,7 @@
     }
         return TRUE;
 }
-    
+
 /*
 Aug 25, 2004  REF: CRR 20655  xnkulkar
 
@@ -430,7 +430,7 @@
 void flash_makedir(char * dir_name)
 {
 	T_FFS_DIR dir;
-#ifndef PCM_2_FFS    
+#ifndef PCM_2_FFS
 	int   val = FFS_opendir(dir_name , &dir);
 #else
 	int   val = ffs_opendir(dir_name , &dir);
@@ -439,8 +439,8 @@
 
 	if(val < 0)
 	{
-   
-#ifndef PCM_2_FFS    
+
+#ifndef PCM_2_FFS
 		val = FFS_mkdir(dir_name);
 #else
 		val = ffs_mkdir(dir_name);
@@ -453,17 +453,17 @@
 			default:
 				TRACE_ERROR("The FFS directory could not be created!");
 				TRACE_EVENT_P2("val = %d dir name = %s", val, dir_name);
-				return; 	
+				return;
 		}
 	}
-	
+
 //x0pleela 07 Nov, 2006 DVT: OMAPS00102732
 	//Adding the MMI compilation flag FF_MMI_RELIANCE_FFS
 #if defined( PCM_2_FFS) || defined (FF_MMI_RELIANCE_FFS)
     ffs_closedir( &dir );
 #endif
 
-}	
+}
 
 #ifdef MMI_EM_ENABLED
 #ifndef NEPTUNE_BOARD
@@ -518,14 +518,14 @@
 #endif
 
 
-// Apr 14, 2005	REF: CRR 29991   xpradipg 
+// Apr 14, 2005	REF: CRR 29991   xpradipg
 #ifdef FF_MMI_OPTIM
 /*******************************************************************************
 
  $Function:		flash_MMI_blackList_open
 
  $Description:	This opens the blacklist file
- 
+
  $Returns:		value of the open result
 
  $Arguments:	none
@@ -533,7 +533,7 @@
 *******************************************************************************/
 int8 flash_MMI_blackList_open( )
 {
-	T_FFS_FD file=EFFS_NOFORMAT;	
+	T_FFS_FD file=EFFS_NOFORMAT;
 	/*a0393213 compiler warnings removal - variable status removed*/
 	if(flash_formatted())
 	{
@@ -542,7 +542,7 @@
 		{
 			TRACE_FUNCTION("the file does not exist and is created");
 			file = FFS_open(BLACK_LIST_PATH_AND_FILE, FFS_O_RDWR | FFS_O_CREATE);
-			if(file < 0 ) 
+			if(file < 0 )
 			{
 				TRACE_FUNCTION("file creation failed");
 				return file;
@@ -557,7 +557,7 @@
  $Function:		flash_MMI_blackList_close
 
  $Description:	This closes the file opened for read operation
- 
+
  $Returns:		zero for success and -1 for failure
 
  $Arguments:	handle - handle of the file to be closed
@@ -567,7 +567,7 @@
 {
 	FFS_close((T_FFS_FD)handle);
 }
-		
+
 /*******************************************************************************
 
  $Function:		flash_MMI_blackList_write
@@ -583,7 +583,7 @@
 int flash_MMI_blackList_write(U8 *data, SHORT len, SHORT offset)
 {
 
-	T_FFS_FD file;	
+	T_FFS_FD file;
 	/*a0393213 compiler warnings removal - variable status removed*/
 	TRACE_FUNCTION("flash_MMI_blackList_write()");
 	if(flash_formatted())
@@ -594,14 +594,14 @@
 		{
 			TRACE_FUNCTION("the file does not exist and is created");
 			file = FFS_open(BLACK_LIST_PATH_AND_FILE, FFS_O_RDWR | FFS_O_CREATE);
-			if(file < 0 ) 
+			if(file < 0 )
 			{
 				TRACE_FUNCTION("file creation failed");
 				return file;
 			}
 		}
 		TRACE_FUNCTION("the file exist and is opened");
-#ifdef PCM_2_FFS		
+#ifdef PCM_2_FFS
 		ffs_seek(file, offset, FFS_SEEK_SET);
 		ffs_write(file, (void*)data, len);
 		ffs_close(file);
@@ -609,20 +609,20 @@
 		FFS_seek(file, offset, FFS_SEEK_SET);
 		FFS_write(file, (void*)data, len);
 		FFS_close(file);
-#endif		
+#endif
 
 		return 0;
 	}
 	else
-		return -1;	
-		
+		return -1;
+
 }
 /*******************************************************************************
 
  $Function:		flash_MMI_blackList_read
 
  $Description:	This reads the blacklisted numbers onto the data buffer
- 				
+
  $Returns:		zero for success and -1 for failure
 
  $Arguments:	data - buffer into which  data is retrieved from the file
@@ -653,17 +653,17 @@
 
   ffs_stat((const signed char *)name, &stat);
   n = stat.size / recsize;
-  
+
   if (index > n)
     return EFFS_NOTFOUND;
 
-  if (stat.size <= (T_PSPDF_SMS*MAX_NO_SMS))  
+  if (stat.size <= (T_PSPDF_SMS*MAX_NO_SMS))
   {
     result = ffs_file_read((const signed char *)name, &buf, stat.size);
-    if (result == stat.size) 
+    if (result == stat.size)
     {
       memcpy(addr, &buf[(index-1)*recsize], recsize);
-      result = recsize; 
+      result = recsize;
     }
   }
 
@@ -683,10 +683,10 @@
   if (index > n)
     return EFFS_NOTFOUND;
 
-  if (stat.size <= (T_PSPDF_SMS*MAX_NO_SMS))  
+  if (stat.size <= (T_PSPDF_SMS*MAX_NO_SMS))
   {
     result = ffs_file_read((const signed char *)name, &buf, stat.size);
-    if (result == stat.size) 
+    if (result == stat.size)
     {
       memcpy(&buf[(index-1)*recsize], addr, recsize);
       result = ffs_file_write((const signed char *)name, &buf, stat.size, (FFS_O_CREATE|FFS_O_TRUNC));
@@ -705,7 +705,7 @@
  $Function:		get_ffs_tty_status
 
  $Description:	Gives the status of tty in Flash
- 
+
  $Returns:		tty status
 
  $Arguments:	None
@@ -721,7 +721,7 @@
  $Function:		get_ffs_tty_pftype
 
  $Description:	This gives the tty profile type to be loaded
- 
+
  $Returns:		tty profile type
 
  $Arguments:	None