@@ -113,9 +113,6 @@ enum qspif_default_instructions {
113
113
QSPIF_ULBPR = 0x98 , // Clears all write-protection bits in the Block-Protection register
114
114
};
115
115
116
- // Local Function
117
- static int local_math_power (int base, int exp);
118
-
119
116
// General QSPI instructions
120
117
#define QSPIF_INST_WSR1 0x01 // Write status register 1
121
118
#define QSPIF_INST_RSR1 0x05 // Read status register 1
@@ -882,7 +879,7 @@ int QSPIFBlockDevice::_sfdp_detect_page_size(uint8_t *basic_param_table_ptr, int
882
879
if (basic_param_table_size > QSPIF_BASIC_PARAM_TABLE_PAGE_SIZE_BYTE) {
883
880
// Page Size is specified by 4 Bits (N), calculated by 2^N
884
881
int page_to_power_size = ((int )basic_param_table_ptr[QSPIF_BASIC_PARAM_TABLE_PAGE_SIZE_BYTE]) >> 4 ;
885
- page_size = local_math_power ( 2 , page_to_power_size) ;
882
+ page_size = 1 << page_to_power_size;
886
883
tr_debug (" Detected Page Size: %d" , page_size);
887
884
} else {
888
885
tr_debug (" Using Default Page Size: %d" , page_size);
@@ -1610,17 +1607,3 @@ qspi_status_t QSPIFBlockDevice::_qspi_write_status_registers(uint8_t *reg_buffer
1610
1607
1611
1608
return QSPI_STATUS_OK;
1612
1609
}
1613
-
1614
- /* ********************************************/
1615
- /* ************* Local Functions **************/
1616
- /* ********************************************/
1617
- static int local_math_power (int base, int exp)
1618
- {
1619
- // Integer X^Y function, used to calculate size fields given in 2^N format
1620
- int result = 1 ;
1621
- while (exp) {
1622
- result *= base;
1623
- exp--;
1624
- }
1625
- return result;
1626
- }
0 commit comments