Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74fdd731 authored by Kyle Yan's avatar Kyle Yan
Browse files

drivers: Fix more compiler warnings



Fix uninitialized variable warnings that were not previously caught by
old compiler.

Change-Id: I5014a235da41d32a3a1ae234286270ec9af875fc
Signed-off-by: default avatarKyle Yan <kyan@codeaurora.org>
parent 60bc4fc9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -677,7 +677,8 @@ static int qpnp_flash_led_get_voltage_headroom(struct qpnp_flash_led *led)
#define VIN_FLASH_MIN_UV	3300000LL
static int qpnp_flash_led_calc_max_current(struct qpnp_flash_led *led)
{
	int ocv_uv, rbatt_uohm, ibat_now, voltage_hdrm_mv, rc;
	int ocv_uv, ibat_now, voltage_hdrm_mv, rc;
	int rbatt_uohm = 0;
	int64_t ibat_flash_ua, avail_flash_ua, avail_flash_power_fw;
	int64_t ibat_safe_ua, vin_flash_uv, vph_flash_uv, vph_flash_vdip;

+4 −4
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static void set_threshold(int offset, struct hang_detect *hang_dev,
		hang_dev->M1_threshold = threshold_val;
	else if (offset == hang_dev->M2_offset)
		hang_dev->M2_threshold = threshold_val;
	else if (offset == hang_dev->PCIO_offset)
	else
		hang_dev->PCIO_threshold = threshold_val;
}

@@ -86,7 +86,7 @@ static void get_threshold(int offset, struct hang_detect *hang_dev,
		*reg_value = hang_dev->M1_threshold;
	else if (offset == hang_dev->M2_offset)
		*reg_value = hang_dev->M2_threshold;
	else if (offset == hang_dev->PCIO_offset)
	else
		*reg_value = hang_dev->PCIO_threshold;
}

@@ -101,7 +101,7 @@ static void set_enable(int offset, struct hang_detect *hang_dev,
		hang_dev->M1_enable = enabled;
	else if (offset == hang_dev->M2_offset)
		hang_dev->M2_enable = enabled;
	else if (offset == hang_dev->PCIO_offset)
	else
		hang_dev->PCIO_enable = enabled;
}

@@ -116,7 +116,7 @@ static void get_enable(int offset, struct hang_detect *hang_dev,
		*reg_value = hang_dev->M1_enable;
	else if (offset == hang_dev->M2_offset)
		*reg_value = hang_dev->M2_enable;
	else if (offset == hang_dev->PCIO_offset)
	else
		*reg_value = hang_dev->PCIO_enable;
}

+1 −1
Original line number Diff line number Diff line
@@ -1220,7 +1220,7 @@ void run_posix_cpu_timers(struct task_struct *tsk)
void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
			   cputime_t *newval, cputime_t *oldval)
{
	unsigned long long now;
	unsigned long long now = 0;

	WARN_ON_ONCE(clock_idx == CPUCLOCK_SCHED);
	cpu_timer_sample_group(clock_idx, tsk, &now);
+11 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -588,8 +588,12 @@ EXPORT_SYMBOL(ipc_log_extract);
static void tsv_read_data(struct encode_context *ectxt,
			  void *data, uint32_t size)
{
	if (WARN_ON((ectxt->offset + size) > MAX_MSG_SIZE))
	if (WARN_ON((ectxt->offset + size) > MAX_MSG_SIZE)) {
		memcpy(data, (ectxt->buff + ectxt->offset),
			MAX_MSG_SIZE - ectxt->offset - 1);
		ectxt->offset += MAX_MSG_SIZE - ectxt->offset - 1;
		return;
	}
	memcpy(data, (ectxt->buff + ectxt->offset), size);
	ectxt->offset += size;
}
@@ -604,8 +608,12 @@ static void tsv_read_data(struct encode_context *ectxt,
static void tsv_read_header(struct encode_context *ectxt,
			    struct tsv_header *hdr)
{
	if (WARN_ON((ectxt->offset + sizeof(*hdr)) > MAX_MSG_SIZE))
	if (WARN_ON((ectxt->offset + sizeof(*hdr)) > MAX_MSG_SIZE)) {
		memcpy(hdr, (ectxt->buff + ectxt->offset),
			MAX_MSG_SIZE - ectxt->offset - 1);
		ectxt->offset += MAX_MSG_SIZE - ectxt->offset - 1;
		return;
	}
	memcpy(hdr, (ectxt->buff + ectxt->offset), sizeof(*hdr));
	ectxt->offset += sizeof(*hdr);
}
+1 −1
Original line number Diff line number Diff line
@@ -992,7 +992,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
	struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
	char *sun_path = sunaddr->sun_path;
	int err;
	unsigned int hash;
	unsigned int hash = 0;
	struct unix_address *addr;
	struct hlist_head *list;
	struct path path = { NULL, NULL };