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

Commit 6dbab77b authored by Swetha Chikkaboraiah's avatar Swetha Chikkaboraiah Committed by Gerrit - the friendly Code Review server
Browse files

kernel: Fix build errors with LLVM



This patch intends to fix compilation errors
while building kernel with LLVM toolchain.

Change-Id: I76c4f97d8a0efb44434d54fb07cae23b050d2003
Signed-off-by: default avatarSwetha Chikkaboraiah <schikk@codeaurora.org>
parent 5a6566f2
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, 2016-2017,
 * Copyright (c) 2013-2014, 2016-2017, 2020,
 *
 * The Linux Foundation. All rights reserved.
 *
@@ -177,13 +177,12 @@ static int clk_debug_mux_set_parent(struct clk_hw *hw, u8 index)

		regval |= (meas->parent[index].next_sel & meas->mask);

		if (meas->parent[index].en_mask == 0xFF)
			/* Skip en_mask */
			regval = regval;
		else if (meas->parent[index].en_mask)
		if (meas->parent[index].en_mask != 0xFF) {
			if (meas->parent[index].en_mask)
				regval |= meas->parent[index].en_mask;
			else
				regval |= meas->en_mask;
		}

		regmap_write(meas->regmap[dbg_cc], 0x0, regval);
	}
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016,2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, 2019-2020, 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
@@ -1844,7 +1844,7 @@ static int hfi_process_session_rel_buf_done(u32 device_id,
	cmd_done.size = sizeof(struct msm_vidc_cb_cmd_done);
	cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
	cmd_done.status = hfi_map_err_status(pkt->error_type);
	if (pkt->rg_buffer_info) {
	if (pkt->rg_buffer_info != NULL) {
		cmd_done.data.buffer_info.buffer_addr = *pkt->rg_buffer_info;
		cmd_done.size = sizeof(struct hal_buffer_info);
	} else {
+9 −8
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020, 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
@@ -1542,9 +1542,7 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst)
	return 0;
}

int msm_vidc_close(void *instance)
{
	void close_helper(struct kref *kref)
static void close_helper(struct kref *kref)
{
	struct msm_vidc_inst *inst = container_of(kref,
					struct msm_vidc_inst, kref);
@@ -1552,6 +1550,9 @@ int msm_vidc_close(void *instance)
	msm_vidc_destroy(inst);
}


int msm_vidc_close(void *instance)
{
	struct msm_vidc_inst *inst = instance;
	struct buffer_info *bi, *dummy;
	int rc = 0, i = 0;
+9 −8
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020, 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
@@ -712,9 +712,7 @@ static void handle_sys_init_done(enum hal_command_response cmd, void *data)
	return;
}

static void put_inst(struct msm_vidc_inst *inst)
{
	void put_inst_helper(struct kref *kref)
static void put_inst_helper(struct kref *kref)
{
	struct msm_vidc_inst *inst = container_of(kref,
					struct msm_vidc_inst, kref);
@@ -722,6 +720,9 @@ static void put_inst(struct msm_vidc_inst *inst)
	msm_vidc_destroy(inst);
}


static void put_inst(struct msm_vidc_inst *inst)
{
	if (!inst)
		return;

+13 −14
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, 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
@@ -54,13 +54,13 @@ fail_read:
	return 0;
}

static inline enum imem_type read_imem_type(struct platform_device *pdev)
{
	bool is_compatible(char *compat)
static bool is_compatible(char *compat)
{
	return !!of_find_compatible_node(NULL, NULL, compat);
}

static inline enum imem_type read_imem_type(struct platform_device *pdev)
{
	return is_compatible("qcom,msm-ocmem") ? IMEM_OCMEM :
		is_compatible("qcom,msm-vmem") ? IMEM_VMEM :
						IMEM_NONE;
@@ -518,20 +518,19 @@ error:
	return rc;
}

static int msm_vidc_load_freq_table(struct msm_vidc_platform_resources *res)
{
	int rc = 0;
	int num_elements = 0;
	struct platform_device *pdev = res->pdev;

	/* A comparator to compare loads (needed later on) */
	int cmp(const void *a, const void *b)
static int cmp(const void *a, const void *b)
{
	/* want to sort in reverse so flip the comparison */
	return ((struct load_freq_table *)b)->load -
		((struct load_freq_table *)a)->load;
}

static int msm_vidc_load_freq_table(struct msm_vidc_platform_resources *res)
{
	int rc = 0;
	int num_elements = 0;
	struct platform_device *pdev = res->pdev;

	if (!of_find_property(pdev->dev.of_node, "qcom,load-freq-tbl", NULL)) {
		/* qcom,load-freq-tbl is an optional property.  It likely won't
		 * be present on cores that we can't clock scale on. */
Loading