Commit bf5d0300 authored by Varsha Rao's avatar Varsha Rao Committed by Greg Kroah-Hartman
Browse files

staging: media: atomisp: Remove useless cast.



Explicit type casting of variable, with same type as that of variable,
is not required. The following coccinelle script is used to remove it.

@@
type T;
T *ptr;
T p;
@@
(
- (T *)(&p)
+ &p
|
- (T *)ptr
+ ptr
|
- (T *)(ptr)
+ ptr
|
- (T)(p)
+ p
)

This patch also removes unnecessary parentheses.

Signed-off-by: default avatarVarsha Rao <rvarsha016@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4fa0370
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
	if (ret)
		return ret;

	buf->crop_horizontal_start = ((u16)reg_val_h << 8) | (u16)reg_val;
	buf->crop_horizontal_start = (reg_val_h << 8) | reg_val;

	ret =  gc2235_read_reg(client, GC2235_8BIT,
					GC2235_V_CROP_START_H, &reg_val_h);
@@ -287,7 +287,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
	if (ret)
		return ret;

	buf->crop_vertical_start = ((u16)reg_val_h << 8) | (u16)reg_val;
	buf->crop_vertical_start = (reg_val_h << 8) | reg_val;

	ret = gc2235_read_reg(client, GC2235_8BIT,
					GC2235_H_OUTSIZE_H, &reg_val_h);
@@ -295,7 +295,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
					GC2235_H_OUTSIZE_L, &reg_val);
	if (ret)
		return ret;
	buf->output_width = ((u16)reg_val_h << 8) | (u16)reg_val;
	buf->output_width = (reg_val_h << 8) | reg_val;

	ret = gc2235_read_reg(client, GC2235_8BIT,
					GC2235_V_OUTSIZE_H, &reg_val_h);
@@ -303,7 +303,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
					GC2235_V_OUTSIZE_L, &reg_val);
	if (ret)
		return ret;
	buf->output_height = ((u16)reg_val_h << 8) | (u16)reg_val;
	buf->output_height = (reg_val_h << 8) | reg_val;

	buf->crop_horizontal_end = buf->crop_horizontal_start +
						buf->output_width - 1;
@@ -317,7 +317,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
	if (ret)
		return ret;

	dummy = ((u16)reg_val_h << 8) | (u16)reg_val;
	dummy = (reg_val_h << 8) | reg_val;

	ret = gc2235_read_reg(client, GC2235_8BIT,
					GC2235_SH_DELAY_H, &reg_val_h);
@@ -702,9 +702,9 @@ static int distance(struct gc2235_resolution *res, u32 w, u32 h)
	h_ratio = (res->height << 13) / h;
	if (h_ratio == 0)
		return -1;
	match   = abs(((w_ratio << 13) / h_ratio) - ((int)8192));
	match   = abs(((w_ratio << 13) / h_ratio) - 8192);

	if ((w_ratio < (int)8192) || (h_ratio < (int)8192)  ||
	if ((w_ratio < 8192) || (h_ratio < 8192)  ||
		(match > LARGEST_ALLOWED_RATIO_MISMATCH))
		return -1;

@@ -873,7 +873,7 @@ static int gc2235_detect(struct i2c_client *client)
	}
	ret = gc2235_read_reg(client, GC2235_8BIT,
					GC2235_SENSOR_ID_L, &low);
	id = ((((u16) high) << 8) | (u16) low);
	id = ((high << 8) | low);

	if (id != GC2235_ID) {
		dev_err(&client->dev, "sensor ID error, 0x%x\n", id);
+2 −2
Original line number Diff line number Diff line
@@ -618,9 +618,9 @@ static int distance(struct mt9m114_res_struct const *res, u32 w, u32 h)
	h_ratio = (res->height << 13) / h;
	if (h_ratio == 0)
		return -1;
	match   = abs(((w_ratio << 13) / h_ratio) - ((int)8192));
	match   = abs(((w_ratio << 13) / h_ratio) - 8192);

	if ((w_ratio < (int)8192) || (h_ratio < (int)8192)  ||
	if ((w_ratio < 8192) || (h_ratio < 8192)  ||
		(match > LARGEST_ALLOWED_RATIO_MISMATCH))
		return -1;

+3 −3
Original line number Diff line number Diff line
@@ -807,9 +807,9 @@ static int distance(struct ov2722_resolution *res, u32 w, u32 h)
	h_ratio = (res->height << 13) / h;
	if (h_ratio == 0)
		return -1;
	match   = abs(((w_ratio << 13) / h_ratio) - ((int)8192));
	match   = abs(((w_ratio << 13) / h_ratio) - 8192);

	if ((w_ratio < (int)8192) || (h_ratio < (int)8192)  ||
	if ((w_ratio < 8192) || (h_ratio < 8192)  ||
		(match > LARGEST_ALLOWED_RATIO_MISMATCH))
		return -1;

@@ -998,7 +998,7 @@ static int ov2722_detect(struct i2c_client *client)
	}
	ret = ov2722_read_reg(client, OV2722_8BIT,
					OV2722_SC_CMMN_CHIP_ID_L, &low);
	id = ((((u16) high) << 8) | (u16) low);
	id = (high << 8) | low;

	if ((id != OV2722_ID) && (id != OV2720_ID)) {
		dev_err(&client->dev, "sensor ID error\n");
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ bool ia_css_isys_dma_channel_rmgr_acquire(
		for (i = ISYS2401_DMA_CHANNEL_0; i < N_ISYS2401_DMA_CHANNEL; i++) {
			if (bitop_getbit(cur_rsrc->active_table, i) == 0) {
				bitop_setbit(cur_rsrc->active_table, i);
				*channel = (isys2401_dma_channel)i;
				*channel = i;
				cur_rsrc->num_active++;
				retval = true;
				break;
+4 −4
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ sh_css_load_blob_info(const char *fw, const struct ia_css_fw_info *bi, struct ia
	/* Special case: only one binary in fw */
	if (bi == NULL) bi = (const struct ia_css_fw_info *)fw;

	name = (const char *)fw + bi->blob.prog_name_offset;
	name = fw + bi->blob.prog_name_offset;
	blob = (const unsigned char *)fw + bi->blob.offset;

	/* sanity check */
@@ -201,7 +201,7 @@ sh_css_check_firmware_version(const char *fw_data)
	struct sh_css_fw_bi_file_h *file_header;

	firmware_header = (struct firmware_header *)fw_data;
	file_header = (struct sh_css_fw_bi_file_h *)&firmware_header->file_header;
	file_header = &firmware_header->file_header;

	if (strcmp(file_header->version, release_version) != 0) {
		return false;
@@ -221,8 +221,8 @@ sh_css_load_firmware(const char *fw_data,
	bool valid_firmware = false;

	firmware_header = (struct firmware_header *)fw_data;
	file_header = (struct sh_css_fw_bi_file_h *)&firmware_header->file_header;
	binaries = (struct ia_css_fw_info *)&firmware_header->binary_header;
	file_header = &firmware_header->file_header;
	binaries = &firmware_header->binary_header;
	strncpy(FW_rel_ver_name, file_header->version, min(sizeof(FW_rel_ver_name), sizeof(file_header->version)) - 1);
	valid_firmware = sh_css_check_firmware_version(fw_data);
	if (!valid_firmware) {
Loading