- if (ao_log_present())
- printf("Storage must be empty before changing log size\n");
- else if (block > 1024 && (r & (block - 1)))
- printf("Flight log size must be multiple of %d kB\n", block);
- else if (r > log_max)
- printf("Flight log max %d kB\n", log_max);
- else {
- _ao_config_edit_start();
- ao_config.flight_log_max = r << 10;
- _ao_config_edit_finish();
+ r = r << 10;
+ if (ao_log_present()) {
+ if (r != ao_config.flight_log_max)
+ printf("Storage must be empty before changing log size\n");
+ return;
+ }
+ if (r > ao_storage_log_max) {
+ printf("Flight log max %d kB\n", ao_storage_log_max >> 10);
+ return;