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

Commit 836770b5 authored by Chandan Gera's avatar Chandan Gera
Browse files

msm: camera: Changes to accommodate 32-bit Arch



This driver is using uint64_t to store pointers. On 64 bit uint64_t
and pointer is of the same size, but on the 32 bit system pointers are
smaller. Casting uint64_t to pointer generates warning on 32 bit
platforms.
Fix this by storing pointers as uintptr_t.

Change-Id: I7a8b7d5d7211000a975e79ff1eecf49d455a1dc6
Signed-off-by: default avatarChandan Gera <cgera@codeaurora.org>
parent 866467cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -634,7 +634,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
		int32_t offset, rc = 0;
		struct cam_start_stop_dev_cmd config;

		rc = copy_from_user(&config, (void __user *)cmd->handle,
		rc = copy_from_user(&config, u64_to_user_ptr(cmd->handle),
					sizeof(config));
		if (rc < 0) {
			CAM_ERR(CAM_CSIPHY, "Failed copying from User");
@@ -758,7 +758,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
		struct cam_start_stop_dev_cmd config;
		int32_t offset;

		rc = copy_from_user(&config, (void __user *)cmd->handle,
		rc = copy_from_user(&config, u64_to_user_ptr(cmd->handle),
			sizeof(config));
		if (rc < 0) {
			CAM_ERR(CAM_CSIPHY, "Failed copying from User");
+3 −2
Original line number Diff line number Diff line
@@ -907,7 +907,7 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
	/* getting CSL Packet */
	ioctl_ctrl = (struct cam_control *)arg;

	if (copy_from_user((&config), (void __user *) ioctl_ctrl->handle,
	if (copy_from_user((&config), u64_to_user_ptr(ioctl_ctrl->handle),
		sizeof(config))) {
		CAM_ERR(CAM_FLASH, "Copy cmd handle from user failed");
		return -EFAULT;
@@ -928,7 +928,8 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
	}

	/* Add offset to the flash csl header */
	csl_packet = (struct cam_packet *)(generic_ptr + config.offset);
	csl_packet = (struct cam_packet *)(uintptr_t)(generic_ptr +
			config.offset);
	switch (csl_packet->header.op_code & 0xFFFFFF) {
	case CAM_FLASH_PACKET_OPCODE_INIT: {
		/* INIT packet*/