Refactor code to improve the SAM score 07/316107/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 13 Aug 2024 14:00:28 +0000 (16:00 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 13 Aug 2024 14:54:03 +0000 (16:54 +0200)
Change-Id: I2a1a27e67d761e67a4881294580a1fe8ad1bd710

src/upgrade-apply-deltafs/common/common.h [new file with mode: 0644]
src/upgrade-apply-deltafs/ua.c

diff --git a/src/upgrade-apply-deltafs/common/common.h b/src/upgrade-apply-deltafs/common/common.h
new file mode 100644 (file)
index 0000000..d7ede58
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * upgrade-apply-deltafs
+ *
+ * Copyright (c) 2017 - 2024 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <stdio.h>
+#include "../engine/fota_log.h"
+FILE *__log_out_file__;
+unsigned int __log_level__ =
+       (LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_ENGINE | LOG_INFO);
index ecd21c0637c35d228f6c0f6dd55187ca5e58e609..890846cbc0ebae579d34404debaa089d6b58faae 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "ua.h"
 #include "fota_util.h"
+#include "common/common.h"
 #include "engine/SS_Common.h"
 #include "engine/SS_UPI.h"
 #include "engine/fota_common.h"
@@ -87,10 +88,6 @@ typedef struct temp_opt{
 
 static ua_delta_info_t s_delta_info;
 
-unsigned int __log_level__ =
-       (LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_ENGINE | LOG_INFO);
-FILE *__log_out_file__;
-
 static void save_result(int result);
 static void save_cause(int cause);