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

Commit 9cf96f15 authored by Jeremy Gebben's avatar Jeremy Gebben
Browse files

msm: kgsl: sysfs store and show should return ssize_t



Some of these functions were declared to return int,
which isn't correct.

Change-Id: I428ba09bc8f70109eea2b7193b79cd9461d7f50a
Signed-off-by: default avatarJeremy Gebben <jgebben@codeaurora.org>
parent 80280c54
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -2007,7 +2007,7 @@ int adreno_reset(struct kgsl_device *device)
 *
 *
 * This is a common routine to write to FT sysfs files.
 * This is a common routine to write to FT sysfs files.
 */
 */
static int _ft_sysfs_store(const char *buf, size_t count, unsigned int *ptr)
static ssize_t _ft_sysfs_store(const char *buf, size_t count, unsigned int *ptr)
{
{
	char temp[20];
	char temp[20];
	unsigned long val;
	unsigned long val;
@@ -2051,12 +2051,12 @@ struct adreno_device *_get_adreno_dev(struct device *dev)
 * KGSL_FT_SKIPFRAME -> BIT(3) Set to skip frame
 * KGSL_FT_SKIPFRAME -> BIT(3) Set to skip frame
 * by default set FT policy to KGSL_FT_DEFAULT_POLICY
 * by default set FT policy to KGSL_FT_DEFAULT_POLICY
 */
 */
static int _ft_policy_store(struct device *dev,
static ssize_t _ft_policy_store(struct device *dev,
				     struct device_attribute *attr,
				     struct device_attribute *attr,
				     const char *buf, size_t count)
				     const char *buf, size_t count)
{
{
	struct adreno_device *adreno_dev = _get_adreno_dev(dev);
	struct adreno_device *adreno_dev = _get_adreno_dev(dev);
	int ret;
	ssize_t ret;
	if (adreno_dev == NULL)
	if (adreno_dev == NULL)
		return 0;
		return 0;


@@ -2075,7 +2075,7 @@ static int _ft_policy_store(struct device *dev,
 *
 *
 * This is a routine to read current FT policy
 * This is a routine to read current FT policy
 */
 */
static int _ft_policy_show(struct device *dev,
static ssize_t _ft_policy_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -2102,7 +2102,7 @@ static int _ft_policy_show(struct device *dev,
 * KGSL_FT_PAGEFAULT_LOG_ONE_PER_INT -> BIT(3) Set to log only one
 * KGSL_FT_PAGEFAULT_LOG_ONE_PER_INT -> BIT(3) Set to log only one
 * pagefault per INT.
 * pagefault per INT.
 */
 */
static int _ft_pagefault_policy_store(struct device *dev,
static ssize_t _ft_pagefault_policy_store(struct device *dev,
				     struct device_attribute *attr,
				     struct device_attribute *attr,
				     const char *buf, size_t count)
				     const char *buf, size_t count)
{
{
@@ -2127,7 +2127,7 @@ static int _ft_pagefault_policy_store(struct device *dev,
 *
 *
 * This is a routine to read current FT pagefault policy
 * This is a routine to read current FT pagefault policy
 */
 */
static int _ft_pagefault_policy_show(struct device *dev,
static ssize_t _ft_pagefault_policy_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -2148,7 +2148,7 @@ static int _ft_pagefault_policy_show(struct device *dev,
 * 0x1 - Enable fast hang detection
 * 0x1 - Enable fast hang detection
 * 0x0 - Disable fast hang detection
 * 0x0 - Disable fast hang detection
 */
 */
static int _ft_fast_hang_detect_store(struct device *dev,
static ssize_t _ft_fast_hang_detect_store(struct device *dev,
				     struct device_attribute *attr,
				     struct device_attribute *attr,
				     const char *buf, size_t count)
				     const char *buf, size_t count)
{
{
@@ -2172,7 +2172,7 @@ static int _ft_fast_hang_detect_store(struct device *dev,
 * @attr: Device attribute
 * @attr: Device attribute
 * @buf: value read
 * @buf: value read
 */
 */
static int _ft_fast_hang_detect_show(struct device *dev,
static ssize_t _ft_fast_hang_detect_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -2194,7 +2194,7 @@ static int _ft_fast_hang_detect_show(struct device *dev,
 * 0x0 - Enable long IB detection
 * 0x0 - Enable long IB detection
 * 0x1 - Disable long IB detection
 * 0x1 - Disable long IB detection
 */
 */
static int _ft_long_ib_detect_store(struct device *dev,
static ssize_t _ft_long_ib_detect_store(struct device *dev,
				     struct device_attribute *attr,
				     struct device_attribute *attr,
				     const char *buf, size_t count)
				     const char *buf, size_t count)
{
{
@@ -2218,7 +2218,7 @@ static int _ft_long_ib_detect_store(struct device *dev,
 * @attr: Device attribute
 * @attr: Device attribute
 * @buf: value read
 * @buf: value read
 */
 */
static int _ft_long_ib_detect_show(struct device *dev,
static ssize_t _ft_long_ib_detect_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
+1 −1
Original line number Original line Diff line number Diff line
@@ -855,7 +855,7 @@ err:
	return status;
	return status;
}
}


static int profile_pipe_print(struct file *filep, char __user *ubuf,
static ssize_t profile_pipe_print(struct file *filep, char __user *ubuf,
		size_t max, loff_t *ppos)
		size_t max, loff_t *ppos)
{
{
	struct kgsl_device *device = (struct kgsl_device *) filep->private_data;
	struct kgsl_device *device = (struct kgsl_device *) filep->private_data;
+27 −27
Original line number Original line Diff line number Diff line
@@ -181,7 +181,7 @@ void kgsl_pwrctrl_pwrlevel_change(struct kgsl_device *device,


EXPORT_SYMBOL(kgsl_pwrctrl_pwrlevel_change);
EXPORT_SYMBOL(kgsl_pwrctrl_pwrlevel_change);


static int kgsl_pwrctrl_thermal_pwrlevel_store(struct device *dev,
static ssize_t kgsl_pwrctrl_thermal_pwrlevel_store(struct device *dev,
					 struct device_attribute *attr,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
					 const char *buf, size_t count)
{
{
@@ -222,7 +222,7 @@ static int kgsl_pwrctrl_thermal_pwrlevel_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_thermal_pwrlevel_show(struct device *dev,
static ssize_t kgsl_pwrctrl_thermal_pwrlevel_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -235,7 +235,7 @@ static int kgsl_pwrctrl_thermal_pwrlevel_show(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%d\n", pwr->thermal_pwrlevel);
	return snprintf(buf, PAGE_SIZE, "%d\n", pwr->thermal_pwrlevel);
}
}


static int kgsl_pwrctrl_max_pwrlevel_store(struct device *dev,
static ssize_t kgsl_pwrctrl_max_pwrlevel_store(struct device *dev,
					 struct device_attribute *attr,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
					 const char *buf, size_t count)
{
{
@@ -278,7 +278,7 @@ static int kgsl_pwrctrl_max_pwrlevel_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_max_pwrlevel_show(struct device *dev,
static ssize_t kgsl_pwrctrl_max_pwrlevel_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -291,7 +291,7 @@ static int kgsl_pwrctrl_max_pwrlevel_show(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%d\n", pwr->max_pwrlevel);
	return snprintf(buf, PAGE_SIZE, "%d\n", pwr->max_pwrlevel);
}
}


static int kgsl_pwrctrl_min_pwrlevel_store(struct device *dev,
static ssize_t kgsl_pwrctrl_min_pwrlevel_store(struct device *dev,
					 struct device_attribute *attr,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
					 const char *buf, size_t count)
{	struct kgsl_device *device = kgsl_device_from_dev(dev);
{	struct kgsl_device *device = kgsl_device_from_dev(dev);
@@ -335,7 +335,7 @@ static int kgsl_pwrctrl_min_pwrlevel_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_min_pwrlevel_show(struct device *dev,
static ssize_t kgsl_pwrctrl_min_pwrlevel_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -347,7 +347,7 @@ static int kgsl_pwrctrl_min_pwrlevel_show(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%d\n", pwr->min_pwrlevel);
	return snprintf(buf, PAGE_SIZE, "%d\n", pwr->min_pwrlevel);
}
}


static int kgsl_pwrctrl_num_pwrlevels_show(struct device *dev,
static ssize_t kgsl_pwrctrl_num_pwrlevels_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -374,7 +374,7 @@ static int _get_nearest_pwrlevel(struct kgsl_pwrctrl *pwr, unsigned int clock)
	return -ERANGE;
	return -ERANGE;
}
}


static int kgsl_pwrctrl_max_gpuclk_store(struct device *dev,
static ssize_t kgsl_pwrctrl_max_gpuclk_store(struct device *dev,
					 struct device_attribute *attr,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
					 const char *buf, size_t count)
{
{
@@ -412,7 +412,7 @@ done:
	return count;
	return count;
}
}


static int kgsl_pwrctrl_max_gpuclk_show(struct device *dev,
static ssize_t kgsl_pwrctrl_max_gpuclk_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -426,7 +426,7 @@ static int kgsl_pwrctrl_max_gpuclk_show(struct device *dev,
			pwr->pwrlevels[pwr->thermal_pwrlevel].gpu_freq);
			pwr->pwrlevels[pwr->thermal_pwrlevel].gpu_freq);
}
}


static int kgsl_pwrctrl_gpuclk_store(struct device *dev,
static ssize_t kgsl_pwrctrl_gpuclk_store(struct device *dev,
				     struct device_attribute *attr,
				     struct device_attribute *attr,
				     const char *buf, size_t count)
				     const char *buf, size_t count)
{
{
@@ -453,7 +453,7 @@ static int kgsl_pwrctrl_gpuclk_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_gpuclk_show(struct device *dev,
static ssize_t kgsl_pwrctrl_gpuclk_show(struct device *dev,
				    struct device_attribute *attr,
				    struct device_attribute *attr,
				    char *buf)
				    char *buf)
{
{
@@ -465,7 +465,7 @@ static int kgsl_pwrctrl_gpuclk_show(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%ld\n", kgsl_pwrctrl_active_freq(pwr));
	return snprintf(buf, PAGE_SIZE, "%ld\n", kgsl_pwrctrl_active_freq(pwr));
}
}


static int kgsl_pwrctrl_idle_timer_store(struct device *dev,
static ssize_t kgsl_pwrctrl_idle_timer_store(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					const char *buf, size_t count)
					const char *buf, size_t count)
{
{
@@ -497,7 +497,7 @@ static int kgsl_pwrctrl_idle_timer_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_idle_timer_show(struct device *dev,
static ssize_t kgsl_pwrctrl_idle_timer_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -510,7 +510,7 @@ static int kgsl_pwrctrl_idle_timer_show(struct device *dev,
		device->pwrctrl.interval_timeout * mul);
		device->pwrctrl.interval_timeout * mul);
}
}


static int kgsl_pwrctrl_pmqos_latency_store(struct device *dev,
static ssize_t kgsl_pwrctrl_pmqos_latency_store(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					const char *buf, size_t count)
					const char *buf, size_t count)
{
{
@@ -535,7 +535,7 @@ static int kgsl_pwrctrl_pmqos_latency_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_pmqos_latency_show(struct device *dev,
static ssize_t kgsl_pwrctrl_pmqos_latency_show(struct device *dev,
					   struct device_attribute *attr,
					   struct device_attribute *attr,
					   char *buf)
					   char *buf)
{
{
@@ -546,7 +546,7 @@ static int kgsl_pwrctrl_pmqos_latency_show(struct device *dev,
		device->pwrctrl.pm_qos_latency);
		device->pwrctrl.pm_qos_latency);
}
}


static int kgsl_pwrctrl_gpubusy_show(struct device *dev,
static ssize_t kgsl_pwrctrl_gpubusy_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -566,7 +566,7 @@ static int kgsl_pwrctrl_gpubusy_show(struct device *dev,
	return ret;
	return ret;
}
}


static int kgsl_pwrctrl_gputop_show(struct device *dev,
static ssize_t kgsl_pwrctrl_gputop_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -595,7 +595,7 @@ static int kgsl_pwrctrl_gputop_show(struct device *dev,
	return (unsigned int) (ptr - buf);
	return (unsigned int) (ptr - buf);
}
}


static int kgsl_pwrctrl_gpu_available_frequencies_show(
static ssize_t kgsl_pwrctrl_gpu_available_frequencies_show(
					struct device *dev,
					struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
@@ -614,7 +614,7 @@ static int kgsl_pwrctrl_gpu_available_frequencies_show(
	return num_chars;
	return num_chars;
}
}


static int kgsl_pwrctrl_reset_count_show(struct device *dev,
static ssize_t kgsl_pwrctrl_reset_count_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
@@ -645,7 +645,7 @@ static void __force_on(struct kgsl_device *device, int flag, int on)
	}
	}
}
}


static int __force_on_show(struct device *dev,
static ssize_t __force_on_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf, int flag)
					char *buf, int flag)
{
{
@@ -656,7 +656,7 @@ static int __force_on_show(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%d\n", i);
	return snprintf(buf, PAGE_SIZE, "%d\n", i);
}
}


static int __force_on_store(struct device *dev,
static ssize_t __force_on_store(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					const char *buf, size_t count,
					const char *buf, size_t count,
					int flag)
					int flag)
@@ -682,42 +682,42 @@ static int __force_on_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_pwrctrl_force_clk_on_show(struct device *dev,
static ssize_t kgsl_pwrctrl_force_clk_on_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
	return __force_on_show(dev, attr, buf, KGSL_PWRFLAGS_CLK_ON);
	return __force_on_show(dev, attr, buf, KGSL_PWRFLAGS_CLK_ON);
}
}


static int kgsl_pwrctrl_force_clk_on_store(struct device *dev,
static ssize_t kgsl_pwrctrl_force_clk_on_store(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					const char *buf, size_t count)
					const char *buf, size_t count)
{
{
	return __force_on_store(dev, attr, buf, count, KGSL_PWRFLAGS_CLK_ON);
	return __force_on_store(dev, attr, buf, count, KGSL_PWRFLAGS_CLK_ON);
}
}


static int kgsl_pwrctrl_force_bus_on_show(struct device *dev,
static ssize_t kgsl_pwrctrl_force_bus_on_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
	return __force_on_show(dev, attr, buf, KGSL_PWRFLAGS_AXI_ON);
	return __force_on_show(dev, attr, buf, KGSL_PWRFLAGS_AXI_ON);
}
}


static int kgsl_pwrctrl_force_bus_on_store(struct device *dev,
static ssize_t kgsl_pwrctrl_force_bus_on_store(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					const char *buf, size_t count)
					const char *buf, size_t count)
{
{
	return __force_on_store(dev, attr, buf, count, KGSL_PWRFLAGS_AXI_ON);
	return __force_on_store(dev, attr, buf, count, KGSL_PWRFLAGS_AXI_ON);
}
}


static int kgsl_pwrctrl_force_rail_on_show(struct device *dev,
static ssize_t kgsl_pwrctrl_force_rail_on_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{
	return __force_on_show(dev, attr, buf, KGSL_PWRFLAGS_POWER_ON);
	return __force_on_show(dev, attr, buf, KGSL_PWRFLAGS_POWER_ON);
}
}


static int kgsl_pwrctrl_force_rail_on_store(struct device *dev,
static ssize_t kgsl_pwrctrl_force_rail_on_store(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					const char *buf, size_t count)
					const char *buf, size_t count)
{
{
+4 −4
Original line number Original line Diff line number Diff line
@@ -211,7 +211,7 @@ kgsl_process_init_sysfs(struct kgsl_device *device,
	return ret;
	return ret;
}
}


static int kgsl_drv_memstat_show(struct device *dev,
static ssize_t kgsl_drv_memstat_show(struct device *dev,
				 struct device_attribute *attr,
				 struct device_attribute *attr,
				 char *buf)
				 char *buf)
{
{
@@ -237,7 +237,7 @@ static int kgsl_drv_memstat_show(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%u\n", val);
	return snprintf(buf, PAGE_SIZE, "%u\n", val);
}
}


static int kgsl_drv_histogram_show(struct device *dev,
static ssize_t kgsl_drv_histogram_show(struct device *dev,
				   struct device_attribute *attr,
				   struct device_attribute *attr,
				   char *buf)
				   char *buf)
{
{
@@ -252,7 +252,7 @@ static int kgsl_drv_histogram_show(struct device *dev,
	return len;
	return len;
}
}


static int kgsl_drv_full_cache_threshold_store(struct device *dev,
static ssize_t kgsl_drv_full_cache_threshold_store(struct device *dev,
					 struct device_attribute *attr,
					 struct device_attribute *attr,
					 const char *buf, size_t count)
					 const char *buf, size_t count)
{
{
@@ -267,7 +267,7 @@ static int kgsl_drv_full_cache_threshold_store(struct device *dev,
	return count;
	return count;
}
}


static int kgsl_drv_full_cache_threshold_show(struct device *dev,
static ssize_t kgsl_drv_full_cache_threshold_show(struct device *dev,
					struct device_attribute *attr,
					struct device_attribute *attr,
					char *buf)
					char *buf)
{
{