1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys: replace DEBUGF with corresponding DEBUG calls

This commit is contained in:
Oleg Hahm 2015-09-11 23:15:38 +02:00
parent 2841a08574
commit fac95806a8
4 changed files with 31 additions and 22 deletions

View File

@ -285,7 +285,8 @@ int tripledes_encrypt(const cipher_context_t *context, const uint8_t *plain, uin
uint32_t work[2];
if (!key) {
DEBUGF("[ERROR] Could NOT malloc space for the des3_key_s struct.\r\n");
DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the des3_key_s struct.\r\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
return -1;
}
@ -293,7 +294,8 @@ int tripledes_encrypt(const cipher_context_t *context, const uint8_t *plain, uin
res = des3_key_setup(context->context, key);
if (res < 0) {
DEBUGF("[ERROR] des3_key_setup failed with Code %i\r\n", res);
DEBUG("%s:%d in %s: [ERROR] des3_key_setup failed with Code %i\r\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res);
free(key);
return -2;
}
@ -318,7 +320,8 @@ int tripledes_decrypt(const cipher_context_t *context, const uint8_t *crypt, uin
uint32_t work[2];
if (!key) {
DEBUGF("[ERROR] Could NOT malloc space for the des3_key_s struct.\r\n");
DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the des3_key_s struct.\r\n",
__FILE__, __LINE__, DEBUG_FUNC);
return -1;
}
@ -326,7 +329,8 @@ int tripledes_decrypt(const cipher_context_t *context, const uint8_t *crypt, uin
res = des3_key_setup(context->context, key);
if (res < 0) {
DEBUGF("[ERROR] des3_key_setup failed with Code %i\r\n", res);
DEBUG("%s:%d in %s: [ERROR] des3_key_setup failed with Code %i\r\n",
__FILE__, __LINE__, DEBUG_FUNC, res);
free(key);
return -2;
}

View File

@ -540,8 +540,9 @@ static int twofish_setup_key(twofish_context_t *ctx, const uint8_t *key, uint8_t
/* Check key length. */
if (((keylen - 16) | 16) != 16) {
DEBUGF("[ERROR] invalid key-length!\r\n");
return -1;//GPG_ERR_INV_KEYLEN;
DEBUG("%s:%d in %s: [ERROR] invalid key-length!\r\n", RIOT_FILE_RELATIVE,
__LINE__, DEBUG_FUNC);
return -1;
}
@ -660,15 +661,16 @@ int twofish_encrypt(const cipher_context_t *context, const uint8_t *in, uint8_t
twofish_context_t *ctx = malloc(sizeof(twofish_context_t));
if (!ctx) {
DEBUGF("[ERROR] Could NOT malloc space for the twofish_context_t \
struct.\r\n");
DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the twofish_context_t \
struct.\r\n", RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
return -1;
}
res = twofish_setup_key(ctx, context->context, TWOFISH_KEY_SIZE);
if (res < 0) {
DEBUGF("[ERROR] twofish_setKey failed with Code %i\r\n", res);
DEBUG("%s:%d in %s: [ERROR] twofish_setKey failed with Code %i\r\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res);
free(ctx);
return -2;
}
@ -716,15 +718,16 @@ int twofish_decrypt(const cipher_context_t *context, const uint8_t *in, uint8_t
twofish_context_t *ctx = malloc(sizeof(twofish_context_t));
if (!ctx) {
DEBUGF("[ERROR] Could NOT malloc space for the twofish_context_t \
struct.\r\n");
DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the twofish_context_t \
struct.\r\n", RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
return -1;
}
res = twofish_setup_key(ctx, context->context, TWOFISH_KEY_SIZE);
if (res < 0) {
DEBUGF("[ERROR] twofish_setKey failed with Code %i\r\n", res);
DEBUG("%s:%d in %s: [ERROR] twofish_setKey failed with Code %i\r\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res);
free(ctx);
return -2;
}

View File

@ -194,7 +194,8 @@ void iib_fill_wr_addresses(kernel_pid_t if_pid, struct rfc5444_writer *wr)
default:
/* Should not happen */
DEBUGF("[WARNING] Unknown link tuple status\n");
DEBUG("%s:%d in %s: [WARNING] Unknown link tuple status\n",
__FILE__, __LINE__, DEBUG_FUNC);
break;
}
}
@ -260,8 +261,8 @@ void iib_process_metric_msg(iib_link_set_entry_t *ls_entry, uint64_t int_time)
/* NHDP_METRIC is not set properly */
(void)ls_entry;
(void)int_time;
DEBUGF("[WARNING] Unknown NHDP_METRIC setting\n");
#endif
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__,
__LINE__, DEBUG_FUNC); #endif
}
void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out, uint16_t seq_no)
@ -332,8 +333,8 @@ void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out
(void)ls_entry;
(void)metric_out;
(void)seq_no;
DEBUGF("[WARNING] Unknown NHDP_METRIC setting\n");
#endif
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__,
__LINE__, DEBUG_FUNC); #endif
}
void iib_process_metric_refresh(void)
@ -344,8 +345,8 @@ void iib_process_metric_refresh(void)
dat_metric_refresh();
#else
/* NHDP_METRIC is not set properly */
DEBUGF("[WARNING] Unknown NHDP_METRIC setting\n");
#endif
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__,
__LINE__, DEBUG_FUNC); #endif
}

View File

@ -37,11 +37,12 @@ void trickle_interval(trickle_t *trickle)
DEBUG("TRICKLE new Interval %" PRIu32 "\n", trickle->I);
if (trickle->I == 0) {
DEBUGF("[WARNING] Interval was 0\n");
DEBUG("%s:%d in %s: [WARNING] Interval was 0\n", __FILE__, __LINE__,
DEBUG_FUNC);
if (trickle->Imax == 0) {
DEBUGF("[WARNING] Imax == 0\n");
}
DEBUG("%s:%d in %s: [WARNING] Imax == 0\n", __FILE__, __LINE__,
DEBUG_FUNC); }
trickle->I = (trickle->Imin << trickle->Imax);
}