Remove trailing \n where they are not necessary

Adding a trailing \n to g_message, g_debug, g_warning and g_error is not
neccessary, as a newline will be added automatically by the logging
infrastructure.
This commit is contained in:
Benjamin Berg 2020-09-29 10:42:03 +02:00
parent 62edf93958
commit fab349f356
10 changed files with 43 additions and 43 deletions

View file

@ -57,7 +57,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
fp_device_close_finish (dev, res, &error); fp_device_close_finish (dev, res, &error);
if (error) if (error)
g_warning ("Failed closing device %s\n", error->message); g_warning ("Failed closing device %s", error->message);
g_main_loop_quit (enroll_data->loop); g_main_loop_quit (enroll_data->loop);
} }
@ -89,7 +89,7 @@ on_enroll_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
} }
else else
{ {
g_warning ("Enroll failed with error %s\n", error->message); g_warning ("Enroll failed with error %s", error->message);
} }
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed, fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed,

View file

@ -58,7 +58,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
fp_device_close_finish (dev, res, &error); fp_device_close_finish (dev, res, &error);
if (error) if (error)
g_warning ("Failed closing device %s\n", error->message); g_warning ("Failed closing device %s", error->message);
g_main_loop_quit (capture_data->loop); g_main_loop_quit (capture_data->loop);
} }

View file

@ -54,7 +54,7 @@ on_device_closed (FpDevice *dev,
fp_device_close_finish (dev, res, &error); fp_device_close_finish (dev, res, &error);
if (error) if (error)
g_warning ("Failed closing device %s\n", error->message); g_warning ("Failed closing device %s", error->message);
g_main_loop_quit (list_data->loop); g_main_loop_quit (list_data->loop);
} }
@ -86,7 +86,7 @@ delete_next_print (FpDevice *dev,
g_assert_nonnull (list_data->to_delete); g_assert_nonnull (list_data->to_delete);
print = list_data->to_delete->data; print = list_data->to_delete->data;
g_debug ("Deleting print %s\n", fp_print_get_description (print)); g_debug ("Deleting print %s", fp_print_get_description (print));
fp_device_delete_print (dev, print, NULL, fp_device_delete_print (dev, print, NULL,
(GAsyncReadyCallback) on_print_deleted, list_data); (GAsyncReadyCallback) on_print_deleted, list_data);
} }

View file

@ -57,7 +57,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
fp_device_close_finish (dev, res, &error); fp_device_close_finish (dev, res, &error);
if (error) if (error)
g_warning ("Failed closing device %s\n", error->message); g_warning ("Failed closing device %s", error->message);
g_main_loop_quit (verify_data->loop); g_main_loop_quit (verify_data->loop);
} }

View file

@ -197,12 +197,12 @@ process_strip_data (FpiSsm *ssm, FpImageDevice *dev,
if (data[0] != AES2550_EDATA_MAGIC) if (data[0] != AES2550_EDATA_MAGIC)
{ {
fp_dbg ("Bogus magic: %.2x\n", (int) (data[0])); fp_dbg ("Bogus magic: %.2x", (int) (data[0]));
return FALSE; return FALSE;
} }
len = data[1] * 256 + data[2]; len = data[1] * 256 + data[2];
if (len != (AES2550_STRIP_SIZE - 3)) if (len != (AES2550_STRIP_SIZE - 3))
fp_dbg ("Bogus frame len: %.4x\n", len); fp_dbg ("Bogus frame len: %.4x", len);
stripe = g_malloc0 (FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof (struct fpi_frame)); /* 4 bits per pixel */ stripe = g_malloc0 (FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof (struct fpi_frame)); /* 4 bits per pixel */
stripe->delta_x = (int8_t) data[6]; stripe->delta_x = (int8_t) data[6];
stripe->delta_y = -(int8_t) data[7]; stripe->delta_y = -(int8_t) data[7];

View file

@ -116,7 +116,7 @@ aesX660_read_calibrate_data_cb (FpiUsbTransfer *transfer,
/* Calibrate response was read correctly? */ /* Calibrate response was read correctly? */
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_CALIBRATE_RESPONSE) if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_CALIBRATE_RESPONSE)
{ {
fp_dbg ("Bogus calibrate response: %.2x\n", data[0]); fp_dbg ("Bogus calibrate response: %.2x", data[0]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus calibrate " "Bogus calibrate "
@ -155,14 +155,14 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
if (error) if (error)
{ {
fp_dbg ("Failed to read FD data\n"); fp_dbg ("Failed to read FD data");
fpi_ssm_mark_failed (transfer->ssm, error); fpi_ssm_mark_failed (transfer->ssm, error);
return; return;
} }
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_FINGER_DET_RESPONSE) if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_FINGER_DET_RESPONSE)
{ {
fp_dbg ("Bogus FD response: %.2x\n", data[0]); fp_dbg ("Bogus FD response: %.2x", data[0]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus FD response %.2x", "Bogus FD response %.2x",
@ -177,7 +177,7 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
} }
else else
{ {
fp_dbg ("Wait for finger returned %.2x as result\n", fp_dbg ("Wait for finger returned %.2x as result",
data[AESX660_FINGER_PRESENT_OFFSET]); data[AESX660_FINGER_PRESENT_OFFSET]);
fpi_ssm_jump_to_state (transfer->ssm, FINGER_DET_SEND_FD_CMD); fpi_ssm_jump_to_state (transfer->ssm, FINGER_DET_SEND_FD_CMD);
} }
@ -405,7 +405,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
g_byte_array_set_size (priv->stripe_packet, 0); g_byte_array_set_size (priv->stripe_packet, 0);
} }
fp_dbg ("finger %s\n", finger_missing ? "missing" : "present"); fp_dbg ("finger %s", finger_missing ? "missing" : "present");
if (finger_missing) if (finger_missing)
fpi_ssm_next_state (transfer->ssm); fpi_ssm_next_state (transfer->ssm);
@ -440,7 +440,7 @@ capture_run_state (FpiSsm *ssm, FpDevice *_dev)
break; break;
case CAPTURE_SET_IDLE: case CAPTURE_SET_IDLE:
fp_dbg ("Got %lu frames\n", priv->strips_len); fp_dbg ("Got %lu frames", priv->strips_len);
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd), aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
capture_set_idle_cmd_cb); capture_set_idle_cmd_cb);
break; break;
@ -513,19 +513,19 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
if (error) if (error)
{ {
fp_dbg ("read_id cmd failed\n"); fp_dbg ("read_id cmd failed");
fpi_ssm_mark_failed (transfer->ssm, error); fpi_ssm_mark_failed (transfer->ssm, error);
return; return;
} }
/* ID was read correctly */ /* ID was read correctly */
if (data[0] == 0x07) if (data[0] == 0x07)
{ {
fp_dbg ("Sensor device id: %.2x%2x, bcdDevice: %.2x.%.2x, init status: %.2x\n", fp_dbg ("Sensor device id: %.2x%2x, bcdDevice: %.2x.%.2x, init status: %.2x",
data[4], data[3], data[5], data[6], data[7]); data[4], data[3], data[5], data[6], data[7]);
} }
else else
{ {
fp_dbg ("Bogus read ID response: %.2x\n", data[AESX660_RESPONSE_TYPE_OFFSET]); fp_dbg ("Bogus read ID response: %.2x", data[AESX660_RESPONSE_TYPE_OFFSET]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus read ID response %.2x", "Bogus read ID response %.2x",
@ -553,7 +553,7 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
break; break;
default: default:
fp_dbg ("Failed to init device! init status: %.2x\n", data[7]); fp_dbg ("Failed to init device! init status: %.2x", data[7]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Failed to init device %.2x", "Failed to init device %.2x",
@ -570,11 +570,11 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
FpiDeviceAesX660Private *priv = fpi_device_aes_x660_get_instance_private (self); FpiDeviceAesX660Private *priv = fpi_device_aes_x660_get_instance_private (self);
unsigned char *data = transfer->buffer; unsigned char *data = transfer->buffer;
fp_dbg ("read_init_cb\n"); fp_dbg ("read_init_cb");
if (error) if (error)
{ {
fp_dbg ("read_init transfer status: %s, actual_len: %d\n", error->message, fp_dbg ("read_init transfer status: %s, actual_len: %d", error->message,
(gint) transfer->actual_length); (gint) transfer->actual_length);
fpi_ssm_mark_failed (transfer->ssm, error); fpi_ssm_mark_failed (transfer->ssm, error);
return; return;
@ -582,7 +582,7 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
/* ID was read correctly */ /* ID was read correctly */
if (data[0] != 0x42 || data[3] != 0x01) if (data[0] != 0x42 || data[3] != 0x01)
{ {
fp_dbg ("Bogus read init response: %.2x %.2x\n", data[0], fp_dbg ("Bogus read init response: %.2x %.2x", data[0],
data[3]); data[3]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
@ -614,13 +614,13 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
{ {
case ACTIVATE_SET_IDLE: case ACTIVATE_SET_IDLE:
priv->init_seq_idx = 0; priv->init_seq_idx = 0;
fp_dbg ("Activate: set idle\n"); fp_dbg ("Activate: set idle");
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd), aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
fpi_ssm_usb_transfer_cb); fpi_ssm_usb_transfer_cb);
break; break;
case ACTIVATE_SEND_READ_ID_CMD: case ACTIVATE_SEND_READ_ID_CMD:
fp_dbg ("Activate: read ID\n"); fp_dbg ("Activate: read ID");
aesX660_send_cmd (ssm, _dev, read_id_cmd, sizeof (read_id_cmd), aesX660_send_cmd (ssm, _dev, read_id_cmd, sizeof (read_id_cmd),
fpi_ssm_usb_transfer_cb); fpi_ssm_usb_transfer_cb);
break; break;
@ -630,7 +630,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
break; break;
case ACTIVATE_SEND_INIT_CMD: case ACTIVATE_SEND_INIT_CMD:
fp_dbg ("Activate: send init seq #%d cmd #%d\n", fp_dbg ("Activate: send init seq #%d cmd #%d",
priv->init_seq_idx, priv->init_seq_idx,
priv->init_cmd_idx); priv->init_cmd_idx);
aesX660_send_cmd (ssm, _dev, aesX660_send_cmd (ssm, _dev,
@ -640,7 +640,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
break; break;
case ACTIVATE_READ_INIT_RESPONSE: case ACTIVATE_READ_INIT_RESPONSE:
fp_dbg ("Activate: read init response\n"); fp_dbg ("Activate: read init response");
aesX660_read_response (ssm, _dev, TRUE, FALSE, INIT_LEN, activate_read_init_cb); aesX660_read_response (ssm, _dev, TRUE, FALSE, INIT_LEN, activate_read_init_cb);
break; break;

View file

@ -171,7 +171,7 @@ finger_present (unsigned char *img, size_t len, int sum_threshold)
if (img[i] < 160) if (img[i] < 160)
sum++; sum++;
fp_dbg ("finger_present: sum is %d\n", sum); fp_dbg ("finger_present: sum is %d", sum);
return sum < sum_threshold ? 0 : 1; return sum < sum_threshold ? 0 : 1;
} }
@ -184,7 +184,7 @@ finger_det_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
if (error) if (error)
{ {
fp_dbg ("data transfer status %s\n", error->message); fp_dbg ("data transfer status %s", error->message);
fpi_image_device_session_error (dev, error); fpi_image_device_session_error (dev, error);
return; return;
} }
@ -212,7 +212,7 @@ finger_det_cmd_cb (FpiUsbTransfer *t, FpDevice *device,
if (error) if (error)
{ {
fp_dbg ("req transfer status %s\n", error->message); fp_dbg ("req transfer status %s", error->message);
fpi_image_device_session_error (dev, error); fpi_image_device_session_error (dev, error);
return; return;
} }
@ -411,7 +411,7 @@ dev_init (FpImageDevice *dev)
break; break;
default: default:
fp_err ("Device variant %lu is not known\n", driver_data); fp_err ("Device variant %lu is not known", driver_data);
g_assert_not_reached (); g_assert_not_reached ();
fpi_image_device_open_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL)); fpi_image_device_open_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
return; return;

View file

@ -193,7 +193,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
if (self->deactivating) if (self->deactivating)
{ {
fp_dbg ("Deactivate requested\n"); fp_dbg ("Deactivate requested");
fpi_ssm_mark_completed (transfer->ssm); fpi_ssm_mark_completed (transfer->ssm);
return; return;
} }
@ -208,7 +208,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
if (fpi_ssm_get_cur_state (transfer->ssm) == CAPTURE_READ_DATA_TERM) if (fpi_ssm_get_cur_state (transfer->ssm) == CAPTURE_READ_DATA_TERM)
{ {
fp_dbg ("Terminating SSM\n"); fp_dbg ("Terminating SSM");
fpi_ssm_mark_completed (transfer->ssm); fpi_ssm_mark_completed (transfer->ssm);
return; return;
} }
@ -219,7 +219,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
response_size += 9; /* 7 bytes for header, 2 for CRC */ response_size += 9; /* 7 bytes for header, 2 for CRC */
if (response_size > transfer->actual_length) if (response_size > transfer->actual_length)
{ {
fp_dbg ("response_size is %lu, actual_length is %d\n", fp_dbg ("response_size is %lu, actual_length is %d",
response_size, (gint) transfer->actual_length); response_size, (gint) transfer->actual_length);
fp_dbg ("Waiting for rest of transfer"); fp_dbg ("Waiting for rest of transfer");
BUG_ON (self->response_rest); BUG_ON (self->response_rest);
@ -237,7 +237,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
{ {
/* No finger */ /* No finger */
case 0x28: case 0x28:
fp_dbg ("18th byte is %.2x\n", data[18]); fp_dbg ("18th byte is %.2x", data[18]);
switch (data[18]) switch (data[18])
{ {
case 0x0c: case 0x0c:
@ -254,7 +254,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
case 0x1e: case 0x1e:
/* short scan */ /* short scan */
fp_err ("short scan, aborting\n"); fp_err ("short scan, aborting");
fpi_image_device_retry_scan (dev, fpi_image_device_retry_scan (dev,
FP_DEVICE_RETRY_TOO_SHORT); FP_DEVICE_RETRY_TOO_SHORT);
fpi_image_device_report_finger_status (dev, fpi_image_device_report_finger_status (dev,
@ -265,7 +265,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
case 0x1d: case 0x1d:
/* too much horisontal movement */ /* too much horisontal movement */
fp_err ("too much horisontal movement, aborting\n"); fp_err ("too much horisontal movement, aborting");
fpi_image_device_retry_scan (dev, fpi_image_device_retry_scan (dev,
FP_DEVICE_RETRY_CENTER_FINGER); FP_DEVICE_RETRY_CENTER_FINGER);
fpi_image_device_report_finger_status (dev, fpi_image_device_report_finger_status (dev,
@ -276,7 +276,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
default: default:
/* some error happened, cancel scan */ /* some error happened, cancel scan */
fp_err ("something bad happened, stop scan\n"); fp_err ("something bad happened, stop scan");
fpi_image_device_retry_scan (dev, fpi_image_device_retry_scan (dev,
FP_DEVICE_RETRY); FP_DEVICE_RETRY);
fpi_image_device_report_finger_status (dev, fpi_image_device_report_finger_status (dev,
@ -307,7 +307,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
upektc_img_process_image_frame (self->image_bits + self->image_size, upektc_img_process_image_frame (self->image_bits + self->image_size,
data); data);
BUG_ON (self->image_size != IMAGE_SIZE); BUG_ON (self->image_size != IMAGE_SIZE);
fp_dbg ("Image size is %lu\n", fp_dbg ("Image size is %lu",
self->image_size); self->image_size);
img = fp_image_new (IMAGE_WIDTH, IMAGE_HEIGHT); img = fp_image_new (IMAGE_WIDTH, IMAGE_HEIGHT);
img->flags |= FPI_IMAGE_PARTIAL; img->flags |= FPI_IMAGE_PARTIAL;
@ -320,7 +320,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
break; break;
default: default:
fp_err ("Unknown response!\n"); fp_err ("Unknown response!");
fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL)); fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
break; break;
} }
@ -331,7 +331,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
break; break;
default: default:
fp_err ("Not handled response!\n"); fp_err ("Not handled response!");
fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL)); fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
} }
} }

View file

@ -723,7 +723,7 @@ imaging_run_state (FpiSsm *ssm, FpDevice *_dev)
num_lines); num_lines);
if (flags & BLOCKF_CHANGE_KEY) if (flags & BLOCKF_CHANGE_KEY)
{ {
fp_dbg ("changing encryption keys.\n"); fp_dbg ("changing encryption keys.");
img->block_info[self->img_block].flags &= ~BLOCKF_CHANGE_KEY; img->block_info[self->img_block].flags &= ~BLOCKF_CHANGE_KEY;
img->key_number++; img->key_number++;
self->img_enc_seed = rand (); self->img_enc_seed = rand ();

View file

@ -60,7 +60,7 @@ fpi_image_device_activate (FpImageDevice *self)
* starting the next operation. */ * starting the next operation. */
g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove); g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
fp_dbg ("Activating image device\n"); fp_dbg ("Activating image device");
cls->activate (self); cls->activate (self);
} }
@ -84,7 +84,7 @@ fpi_image_device_deactivate (FpImageDevice *self)
priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE; priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
g_object_notify (G_OBJECT (self), "fpi-image-device-state"); g_object_notify (G_OBJECT (self), "fpi-image-device-state");
fp_dbg ("Deactivating image device\n"); fp_dbg ("Deactivating image device");
cls->deactivate (self); cls->deactivate (self);
} }
@ -106,7 +106,7 @@ fp_image_device_change_state (FpImageDevice *self, FpiImageDeviceState state)
prev_state_str = g_enum_to_string (FPI_TYPE_IMAGE_DEVICE_STATE, priv->state); prev_state_str = g_enum_to_string (FPI_TYPE_IMAGE_DEVICE_STATE, priv->state);
state_str = g_enum_to_string (FPI_TYPE_IMAGE_DEVICE_STATE, state); state_str = g_enum_to_string (FPI_TYPE_IMAGE_DEVICE_STATE, state);
fp_dbg ("Image device internal state change from %s to %s\n", fp_dbg ("Image device internal state change from %s to %s",
prev_state_str, state_str); prev_state_str, state_str);
priv->state = state; priv->state = state;