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

Commit 182ec0b2 authored by Andy Sun's avatar Andy Sun
Browse files

ais: refine some code style issues



1. function/variable static declare;
2. dereference of noderef expression;
3. cast removes address space of expression;
4. using plain integer as NULL pointer;

Change-Id: If11a29aca93380de68a323880d55597bf320470f
Signed-off-by: default avatarAndy Sun <bins@codeaurora.org>
parent f19eadaa
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ static long camera_v4l2_vidioc_private_ioctl(struct file *filep, void *fh,

		MSM_CAM_GET_IOCTL_ARG_PTR(&tmp, &k_ioctl->ioctl_ptr,
			sizeof(tmp));
		if (copy_from_user(&ptr, tmp,
		if (copy_from_user(&ptr, (void __user *)tmp,
			sizeof(struct msm_camera_return_buf))) {
			return -EFAULT;
		}
@@ -795,7 +795,7 @@ static long camera_handle_internal_compat_ioctl(struct file *file,
{
	long rc = 0;
	struct msm_camera_private_ioctl_arg k_ioctl;
	void __user *tmp_compat_ioctl_ptr = NULL;
	void *tmp_compat_ioctl_ptr = NULL;

	rc = msm_copy_camera_private_ioctl_args(arg,
		&k_ioctl, &tmp_compat_ioctl_ptr);
@@ -810,11 +810,13 @@ static long camera_handle_internal_compat_ioctl(struct file *file,
				k_ioctl.id, k_ioctl.size);
			return -EINVAL;
		}
		k_ioctl.ioctl_ptr = (__u64)tmp_compat_ioctl_ptr;
		if (!k_ioctl.ioctl_ptr) {

		if (tmp_compat_ioctl_ptr == NULL) {
			pr_debug("Invalid ptr for id %d", k_ioctl.id);
			return -EINVAL;
		}
		k_ioctl.ioctl_ptr = (__u64)(uintptr_t)tmp_compat_ioctl_ptr;

		rc = camera_v4l2_vidioc_private_ioctl(file, file->private_data,
			0, cmd, (void *)&k_ioctl);
		}
@@ -826,7 +828,7 @@ static long camera_handle_internal_compat_ioctl(struct file *file,
	return rc;
}

long camera_v4l2_compat_ioctl(struct file *file, unsigned int cmd,
static long camera_v4l2_compat_ioctl(struct file *file, unsigned int cmd,
	unsigned long arg)
{
	long ret = 0;
+2 −2
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ struct cam_ahb_client_data {

static struct cam_ahb_client_data data;

int get_vector_index(char *name)
static int get_vector_index(char *name)
{
	int i = 0, rc = -1;

@@ -213,7 +213,7 @@ err1:
}
EXPORT_SYMBOL(cam_ahb_clk_init);

int cam_consolidate_ahb_vote(enum cam_ahb_clk_client id,
static int cam_consolidate_ahb_vote(enum cam_ahb_clk_client id,
	enum cam_ahb_clk_vote vote)
{
	int i = 0;
+1 −1
Original line number Diff line number Diff line
@@ -466,7 +466,7 @@ static enum dma_data_direction cam_smmu_translate_dir(
	return DMA_NONE;
}

void cam_smmu_reset_iommu_table(enum cam_smmu_init_dir ops)
static void cam_smmu_reset_iommu_table(enum cam_smmu_init_dir ops)
{
	unsigned int i;
	int j = 0;
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ enum cam_smmu_map_dir {
	CAM_SMMU_MAP_INVALID
};

int cam_smmu_query_vaddr_in_range(int handle,
	unsigned long fault_addr, unsigned long *start_addr,
	unsigned long *end_addr, int *fd);

/**
 * @param identifier: Unique identifier to be used by clients which they
 *                    should get from device tree. CAM SMMU driver will
+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ struct msm_cam_bus_pscale_data {
	struct mutex lock;
};

struct msm_cam_bus_pscale_data g_cv[CAM_BUS_CLIENT_MAX];
static struct msm_cam_bus_pscale_data g_cv[CAM_BUS_CLIENT_MAX];

/* Get all clocks from DT */
static int msm_camera_get_clk_info_internal(struct device *dev,
@@ -771,7 +771,7 @@ void __iomem *msm_camera_get_reg_base(struct platform_device *pdev,
		char *device_name, int reserve_mem)
{
	struct resource *mem;
	void *base;
	void __iomem *base;

	if (!pdev || !device_name) {
		pr_err("Invalid params\n");
Loading