All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] atomisp: remove dead code
@ 2017-03-27 15:13 Alan Cox
  2017-03-27 15:13 ` [PATCH 2/5] atomisp: Remove another dead define Alan Cox
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alan Cox @ 2017-03-27 15:13 UTC (permalink / raw)
  To: greg, linux-media

HAS_SEC_ISP is never defined so we can scrub all the code that is within the
defines for it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../atomisp2/css2400/runtime/spctrl/src/spctrl.c   |    5 -
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  110 --------------------
 .../atomisp/pci/atomisp2/css2400/sh_css_firmware.c |   17 ---
 .../atomisp/pci/atomisp2/css2400/sh_css_firmware.h |    3 -
 .../atomisp/pci/atomisp2/css2400/sh_css_internal.h |    7 -
 .../media/atomisp/pci/atomisp2/css2400/sh_css_sp.c |   80 ---------------
 .../media/atomisp/pci/atomisp2/css2400/sh_css_sp.h |   14 ---
 7 files changed, 1 insertion(+), 235 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/spctrl/src/spctrl.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/spctrl/src/spctrl.c
index 0d2e47d..fc42c02 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/spctrl/src/spctrl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/spctrl/src/spctrl.c
@@ -185,11 +185,6 @@ ia_css_spctrl_sp_sw_state ia_css_spctrl_get_state(sp_ID_t sp_id)
 	(void)HIVE_ADDR_sp_sw_state; /* Suppres warnings in CRUN */
 	if (sp_id == SP0_ID)
 		state = sp_dmem_load_uint32(sp_id, (unsigned)sp_address_of(sp_sw_state));
-#if defined(HAS_SEC_SP)
-	else
-		state = sp_dmem_load_uint32(sp_id, (unsigned)sp1_address_of(sp_sw_state));
-#endif /* HAS_SEC_SP */
-
 	return state;
 }
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 3cbdcef..7e337e0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -103,9 +103,6 @@ static int thread_alive;
 
 /* Name of the sp program: should not be built-in */
 #define SP_PROG_NAME "sp"
-#if defined(HAS_SEC_SP)
-#define SP1_PROG_NAME "sp1"
-#endif /* HAS_SEC_SP */
 #if defined(HAS_BL)
 #define BL_PROG_NAME "bootloader"
 #endif
@@ -415,14 +412,6 @@ static void get_pipe_extra_pixel(struct ia_css_pipe *pipe,
 		unsigned int *extra_row, unsigned int *extra_column);
 #endif
 
-#if defined(HAS_SEC_SP)
-static enum ia_css_err
-sh_css_start_sp1(void);
-
-static enum ia_css_err
-sh_css_stop_sp1(void);
-#endif
-
 #ifdef ISP2401
 #ifdef USE_INPUT_SYSTEM_VERSION_2401
 static enum ia_css_err
@@ -1725,9 +1714,6 @@ ia_css_init(const struct ia_css_env *env,
 #if defined(HAS_BL)
 	ia_css_blctrl_cfg blctrl_cfg;
 #endif
-#if defined(HAS_SEC_SP)
-	ia_css_spctrl_cfg sp1ctrl_cfg;
-#endif /* HAS_SEC_SP */
 
 	void *(*malloc_func)(size_t size, bool zero_mem);
 	void (*free_func)(void *ptr);
@@ -1890,15 +1876,6 @@ ia_css_init(const struct ia_css_env *env,
 		IA_CSS_LEAVE_ERR(err);
 		return err;
 	}
-#if defined(HAS_SEC_SP)
-	if(!sh_css_setup_spctrl_config(&sh_css_sp1_fw,SP1_PROG_NAME,&sp1ctrl_cfg))
-		return IA_CSS_ERR_INTERNAL_ERROR;
-	err = ia_css_spctrl_load_fw(SP1_ID, &sp1ctrl_cfg);
-	if (err != IA_CSS_SUCCESS) {
-		IA_CSS_LEAVE_ERR(err);
-		return err;
-	}
-#endif /* HAS_SEC_SP */
 
 #if defined(HAS_BL)
 	if (!sh_css_setup_blctrl_config(&sh_css_bl_fw, BL_PROG_NAME, &blctrl_cfg))
@@ -1908,14 +1885,7 @@ ia_css_init(const struct ia_css_env *env,
 		IA_CSS_LEAVE_ERR(err);
 		return err;
 	}
-#if defined(HAS_SEC_SP)
-	err = ia_css_blctrl_add_target_fw_info(&sh_css_sp1_fw, IA_CSS_SP1,
-					 get_sp_code_addr(SP1_ID));
-	if (err != IA_CSS_SUCCESS) {
-		IA_CSS_LEAVE_ERR(err);
-		return err;
-	}
-#endif
+
 #ifdef ISP2401
 	err = ia_css_blctrl_add_target_fw_info(&sh_css_sp_fw, IA_CSS_SP0,
 					 get_sp_code_addr(SP0_ID));
@@ -2709,11 +2679,6 @@ ia_css_uninit(void)
 	}
 	ia_css_spctrl_unload_fw(SP0_ID);
 	sh_css_sp_set_sp_running(false);
-#if defined(HAS_SEC_SP)
-	ia_css_spctrl_unload_fw(SP1_ID);
-	sh_css_sp1_set_sp1_running(false);
-#endif /* HAS_SEC_SP */
-
 #if defined(HAS_BL)
 	ia_css_blctrl_unload_fw();
 #endif
@@ -10668,33 +10633,6 @@ ia_css_start_bl(void)
 
 #define SP_START_TIMEOUT_US 30000000
 
-#if defined(HAS_SEC_SP)
-
-static enum ia_css_err
-sh_css_start_sp1(void)
-{
-
-	unsigned long timeout;
-
-	IA_CSS_ENTER_PRIVATE("void");
-	sh_css_sp1_start();
-	/* waiting for the SP is completely started */
-	timeout = SP_START_TIMEOUT_US;
-	while((ia_css_spctrl_get_state(SP1_ID) != IA_CSS_SP_SW_INITIALIZED) && timeout) {
-		timeout--;
-		hrt_sleep();
-	}
-	if (timeout == 0) {
-		IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_ERR_INTERNAL_ERROR);
-		return IA_CSS_ERR_INTERNAL_ERROR;
-	}
-	sh_css_write_host2sp1_command(host2sp_cmd_ready);
-
-	IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_SUCCESS);
-	return IA_CSS_SUCCESS;
-}
-#endif
-
 enum ia_css_err
 ia_css_start_sp(void)
 {
@@ -10735,11 +10673,6 @@ ia_css_start_sp(void)
 	sh_css_setup_queues();
 	ia_css_bufq_dump_queue_info();
 
-#if defined(HAS_SEC_SP)
-	/* Start the SP1 Core */
-	err = sh_css_start_sp1();
-#endif /* HAS_SEC_SP */
-
 #ifdef ISP2401
 	if (ia_css_is_system_mode_suspend_or_resume() == false) { /* skip in suspend/resume flow */
 		ia_css_set_system_mode(IA_CSS_SYS_MODE_WORKING);
@@ -10756,42 +10689,6 @@ ia_css_start_sp(void)
  */
 #define SP_SHUTDOWN_TIMEOUT_US 200000
 
-#if defined(HAS_SEC_SP)
-
-static enum ia_css_err
-sh_css_stop_sp1(void)
-{
-	unsigned long timeout;
-
-	IA_CSS_ENTER_PRIVATE("void");
-
-	/* For now, stop whole SP1 */
-	sh_css_write_host2sp1_command(host2sp_cmd_terminate);
-	sh_css_sp1_set_sp1_running(false);
-
-	timeout = SP_SHUTDOWN_TIMEOUT_US;
-	while ((ia_css_spctrl_get_state(SP1_ID)!= IA_CSS_SP_SW_TERMINATED) && timeout) {
-		timeout--;
-		hrt_sleep();
-	}
-	if (timeout == 0) {
-		IA_CSS_WARNING("SP1 is not terminated");
-	} else {
-		timeout = SP_SHUTDOWN_TIMEOUT_US;
-		while (!ia_css_spctrl_is_idle(SP1_ID) && 0 != timeout) {
-			timeout--;
-			hrt_sleep();
-		}
-		if (0 == timeout) {
-			IA_CSS_WARNING("SP1 is not idle");
-		}
-	}
-
-	IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_SUCCESS);
-	return IA_CSS_SUCCESS;
-}
-#endif
-
 enum ia_css_err
 ia_css_stop_sp(void)
 {
@@ -10855,11 +10752,6 @@ ia_css_stop_sp(void)
 	}
 #endif
 
-#if defined(HAS_SEC_SP)
-	/* Stop SP1 Core */
-	sh_css_stop_sp1();
-#endif /* HAS_SEC_SP */
-
 	IA_CSS_LEAVE_ERR(err);
 	return err;
 }
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
index 2f227a8..95f72e5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
@@ -60,9 +60,6 @@ static const char *release_version = STR(irci_ecr-master_20150911_0724);
 static char FW_rel_ver_name[MAX_FW_REL_VER_NAME] = "---";
 
 struct ia_css_fw_info	  sh_css_sp_fw;
-#if defined(HAS_SEC_SP)
-struct ia_css_fw_info	  sh_css_sp1_fw;
-#endif /* HAS_SEC_SP */
 #if defined(HAS_BL)
 struct ia_css_fw_info     sh_css_bl_fw;
 #endif /* HAS_BL */
@@ -138,9 +135,6 @@ sh_css_load_blob_info(const char *fw, const struct ia_css_fw_info *bi, struct ia
 	bd->header = *bi;
 
 	if ((bi->type == ia_css_isp_firmware) || (bi->type == ia_css_sp_firmware)
-#if defined(HAS_SEC_SP)
-	|| (bi->type == ia_css_sp1_firmware)
-#endif /* HAS_SEC_SP */
 #if defined(HAS_BL)
 	|| (bi->type == ia_css_bootloader_firmware)
 #endif /* HAS_BL */
@@ -282,14 +276,6 @@ sh_css_load_firmware(const char *fw_data,
 			err = setup_binary(bi, fw_data, &sh_css_sp_fw, i);
 			if (err != IA_CSS_SUCCESS)
 				return err;
-#if defined(HAS_SEC_SP)
-		} else if (bi->type == ia_css_sp1_firmware) {
-			if (i != SP1_FIRMWARE)
-				return IA_CSS_ERR_INTERNAL_ERROR;
-			err = setup_binary(bi, fw_data, &sh_css_sp1_fw, i);
-			if (err != IA_CSS_SUCCESS)
-				return err;
-#endif /* HAS_SEC_SP */
 #if defined(HAS_BL)
 		} else if (bi->type == ia_css_bootloader_firmware) {
 			if (i != BOOTLOADER_FIRMWARE)
@@ -332,9 +318,6 @@ void sh_css_unload_firmware(void)
 	}
 
 	memset(&sh_css_sp_fw, 0, sizeof(sh_css_sp_fw));
-#if defined(HAS_SEC_SP)
-	memset(&sh_css_sp1_fw, 0, sizeof(sh_css_sp1_fw));
-#endif /* HAS_SEC_SP */
 	if (sh_css_blob_info) {
 		sh_css_free(sh_css_blob_info);
 		sh_css_blob_info = NULL;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.h
index 97bdf2e..588aabd 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.h
@@ -28,9 +28,6 @@ struct  sh_css_fw_bi_file_h {
 };
 
 extern struct ia_css_fw_info     sh_css_sp_fw;
-#if defined(HAS_SEC_SP)
-extern struct ia_css_fw_info     sh_css_sp1_fw;
-#endif /* HAS_SEC_SP */
 #if defined(HAS_BL)
 extern struct ia_css_fw_info     sh_css_bl_fw;
 #endif /* HAS_BL */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h
index 9a3fe2b..a108923 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h
@@ -152,11 +152,7 @@
 #define SIZE_OF_IA_CSS_PTR		sizeof(uint32_t)
 
 /* Number of SP's */
-#if defined(HAS_SEC_SP)
-#define NUM_OF_SPS 2
-#else
 #define NUM_OF_SPS 1
-#endif /* HAS_SEC_SP */
 
 #if defined(HAS_BL)
 #define NUM_OF_BLS 1
@@ -167,9 +163,6 @@
 /* Enum for order of Binaries */
 enum sh_css_order_binaries {
 	SP_FIRMWARE = 0,
-#if defined(HAS_SEC_SP)
-	SP1_FIRMWARE,
-#endif /* HAS_SEC_SP */
 #if defined(HAS_BL)
 	BOOTLOADER_FIRMWARE,
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c
index 00b2d16..ada64bf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c
@@ -78,9 +78,6 @@ static struct sh_css_sp_per_frame_data per_frame_data;
 /* For the moment there is only code that sets this bool to true */
 /* TODO: add code that sets this bool to false */
 static bool sp_running;
-#if defined(HAS_SEC_SP)
-static bool sp1_running;
-#endif /* HAS_SEC_SP */
 
 static enum ia_css_err
 set_output_frame_buffer(const struct ia_css_frame *frame,
@@ -152,11 +149,6 @@ store_sp_per_frame_data(const struct ia_css_fw_info *fw)
 	case ia_css_sp_firmware:
 		HIVE_ADDR_sp_per_frame_data = fw->info.sp.per_frame_data;
 		break;
-#if defined(HAS_SEC_SP)
-	case ia_css_sp1_firmware:
-		(void)fw;
-		break;
-#endif /* HAS_SEC_SP */
 	case ia_css_acc_firmware:
 		HIVE_ADDR_sp_per_frame_data = fw->info.acc.per_frame_data;
 		break;
@@ -1385,23 +1377,6 @@ sh_css_sp_uninit_pipeline(unsigned int pipe_num)
 	sh_css_sp_group.pipe[thread_id].num_stages = 0;
 }
 
-#if defined(HAS_SEC_SP)
-void
-sh_css_write_host2sp1_command(enum host2sp_commands host2sp_command)
-{
-	unsigned int HIVE_ADDR_host_sp1_com = sh_css_sp1_fw.info.sp1.host_sp_com;
-	unsigned int offset = (unsigned int)offsetof(struct host_sp_communication, host2sp_command)
-				/ sizeof(int);
-	(void)HIVE_ADDR_host_sp1_com; /* Suppres warnings in CRUN */
-
-	/* Previous command must be handled by SP1 (by design) */
-	if (host2sp_command == host2sp_cmd_terminate)
-		assert(load_sp1_array_uint(host_sp1_com, offset) == host2sp_cmd_ready);
-
-	store_sp1_array_uint(host_sp1_com, offset, host2sp_command);
-}
-#endif /* HAS_SEC_SP */
-
 bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command)
 {
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
@@ -1698,67 +1673,12 @@ sh_css_sp_set_sp_running(bool flag)
 	sp_running = flag;
 }
 
-#if defined(HAS_SEC_SP)
-void
-sh_css_sp1_set_sp1_running(bool flag)
-{
-	sp1_running = flag;
-}
-#endif /* HAS_SEC_SP */
-
 bool
 sh_css_sp_is_running(void)
 {
 	return sp_running;
 }
 
-#if defined(HAS_SEC_SP)
-void
-sh_css_sp1_start(void)
-{
-	const struct ia_css_fw_info *fw;
-	unsigned int HIVE_ADDR_sp_sw_state;
-	fw = &sh_css_sp1_fw;
-	HIVE_ADDR_sp_sw_state = fw->info.sp1.sw_state;
-
-	if (sp1_running)
-		return;
-
-	(void)HIVE_ADDR_sp_sw_state; /* Suppres warnings in CRUN */
-
-	/* no longer here, sp started immediately */
-	/*ia_css_debug_pipe_graph_dump_epilogue();*/
-
-	/*store_sp_group_data();
-	store_sp_per_frame_data(fw);*/
-	sp_dmem_store_uint32(SP1_ID,
-		(unsigned int)sp1_address_of(sp_sw_state),
-		(uint32_t)(IA_CSS_SP_SW_TERMINATED));
-
-	/* Note 1: The sp_start_isp function contains a wait till
-	 * the input network is configured by the SP.
-	 * Note 2: Not all SP binaries supports host2sp_commands.
-	 * In case a binary does support it, the host2sp_command
-	 * will have status cmd_ready after return of the function
-	 * sh_css_hrt_sp_start_isp. There is no race-condition here
-	 * because only after the process_frame command has been
-	 * received, the SP starts configuring the input network.
-	 */
-
-	/* we need to set sp_running before we call ia_css_mmu_invalidate_cache
-	 * as ia_css_mmu_invalidate_cache checks on sp_running to
-	 * avoid that it accesses dmem while the SP is not powered
-	 */
-	sp1_running = true;
-	/* ia_css_mmu_invalidate_cache(); */
-	/* Invalidate all MMU caches */
-	/* mmu_invalidate_cache_all(); */
-
-	ia_css_spctrl_start(SP1_ID);
-
-}
-#endif /* HAS_SEC_SP */
-
 void
 sh_css_sp_start_isp(void)
 {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h
index 5b73011..98444a3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h
@@ -79,11 +79,6 @@ sh_css_sp_uninit_pipeline(unsigned int pipe_num);
 
 bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command);
 
-#if defined(HAS_SEC_SP)
-void
-sh_css_write_host2sp1_command(enum host2sp_commands host2sp_command);
-#endif /* HAS_SEC_SP */
-
 enum host2sp_commands
 sh_css_read_host2sp_command(void);
 
@@ -147,19 +142,10 @@ sh_css_event_init_irq_mask(void);
 
 void
 sh_css_sp_start_isp(void);
-#if defined(HAS_SEC_SP)
-void
-sh_css_sp1_start(void);
-#endif /* HAS_SEC_SP */
 
 void
 sh_css_sp_set_sp_running(bool flag);
 
-#if defined(HAS_SEC_SP)
-void
-sh_css_sp1_set_sp1_running(bool flag);
-#endif /* HAS_SEC_SP */
-
 bool
 sh_css_sp_is_running(void);
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/5] atomisp: Remove another dead define
  2017-03-27 15:13 [PATCH 1/5] atomisp: remove dead code Alan Cox
@ 2017-03-27 15:13 ` Alan Cox
  2017-03-27 15:14 ` [PATCH 3/5] atomisp: kill another define Alan Cox
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2017-03-27 15:13 UTC (permalink / raw)
  To: greg, linux-media

HAS_TNR3 is never defined so we can remove it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/css2400/sh_css_sp.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c
index ada64bf..e6a3459 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c
@@ -841,10 +841,6 @@ configure_isp_from_args(
 	ia_css_ref_configure(binary, (const struct ia_css_frame **)args->delay_frames, pipeline->dvs_frame_delay);
 	ia_css_tnr_configure(binary, (const struct ia_css_frame **)args->tnr_frames);
 	ia_css_bayer_io_config(binary, args);
-#ifdef HAS_TNR3
-	/* Remove support for TNR2 once TNR3 fully integrated */
-	ia_css_tnr3_configure(binary, (const struct ia_css_frame **)args->tnr_frames);
-#endif
 	return err;
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/5] atomisp: kill another define
  2017-03-27 15:13 [PATCH 1/5] atomisp: remove dead code Alan Cox
  2017-03-27 15:13 ` [PATCH 2/5] atomisp: Remove another dead define Alan Cox
@ 2017-03-27 15:14 ` Alan Cox
  2017-03-27 15:14 ` [PATCH 4/5] drivers/staging/media: atomisp: Removing redundant information from dev_err Alan Cox
  2017-03-27 15:14 ` [PATCH 5/5] Staging: atomisp - octal permissions, style fix Alan Cox
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2017-03-27 15:14 UTC (permalink / raw)
  To: greg, linux-media

We don't need an ifdef for the sake of 8-12 bytes. Avoid the ifdef added by
fde469701c7efabebf885e785edf367bfb1a8f3f. Instead turn it into a single const
string array at a fixed location thereby saving even more memory.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c   |   21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index a362b49..1f07c7a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -1,7 +1,7 @@
 /*
  * Support for Medifield PNW Camera Imaging ISP subsystem.
  *
- * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
+ * Copyright (c) 2010-2017 Intel Corporation. All Rights Reserved.
  *
  * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
  *
@@ -45,12 +45,11 @@ struct hmm_pool	reserved_pool;
 static ia_css_ptr dummy_ptr;
 struct _hmm_mem_stat hmm_mem_stat;
 
-const char *hmm_bo_type_strings[HMM_BO_LAST] = {
-	"p", /* private */
-	"s", /* shared */
-	"u", /* user */
-	"i", /* ion */
-};
+/* p: private
+   s: shared
+   u: user
+   i: ion */
+static const char hmm_bo_type_string[] = "psui";
 
 static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
 			char *buf, struct list_head *bo_list, bool active)
@@ -75,8 +74,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
 		if ((active && (bo->status & HMM_BO_ALLOCED)) ||
 			(!active && !(bo->status & HMM_BO_ALLOCED))) {
 			ret = scnprintf(buf + index1, PAGE_SIZE - index1,
-				"%s %d\n",
-				hmm_bo_type_strings[bo->type], bo->pgnr);
+				"%c %d\n",
+				hmm_bo_type_string[bo->type], bo->pgnr);
 
 			total[bo->type] += bo->pgnr;
 			count[bo->type]++;
@@ -90,8 +89,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
 		if (count[i]) {
 			ret = scnprintf(buf + index1 + index2,
 				PAGE_SIZE - index1 - index2,
-				"%ld %s buffer objects: %ld KB\n",
-				count[i], hmm_bo_type_strings[i], total[i] * 4);
+				"%ld %c buffer objects: %ld KB\n",
+				count[i], hmm_bo_type_string[i], total[i] * 4);
 			if (ret > 0)
 				index2 += ret;
 		}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/5] drivers/staging/media: atomisp: Removing redundant information from dev_err
  2017-03-27 15:13 [PATCH 1/5] atomisp: remove dead code Alan Cox
  2017-03-27 15:13 ` [PATCH 2/5] atomisp: Remove another dead define Alan Cox
  2017-03-27 15:14 ` [PATCH 3/5] atomisp: kill another define Alan Cox
@ 2017-03-27 15:14 ` Alan Cox
  2017-03-27 15:14 ` [PATCH 5/5] Staging: atomisp - octal permissions, style fix Alan Cox
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2017-03-27 15:14 UTC (permalink / raw)
  To: greg, linux-media

From: Pushkar Jambhlekar <pushkar.iit@gmail.com>

Removing hardcoded function name as code is already using __func__

Signed-off-by: Pushkar Jambhlekar <pushkar.iit@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/hmm/hmm_bo.c        |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
index d1a609d2..a51a27b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
@@ -64,7 +64,7 @@ struct hmm_buffer_object *__bo_alloc(struct kmem_cache *bo_cache)
 
 	bo = kmem_cache_alloc(bo_cache, GFP_KERNEL);
 	if (!bo)
-		dev_err(atomisp_dev, "%s: __bo_alloc failed!\n", __func__);
+		dev_err(atomisp_dev, "%s: failed!\n", __func__);
 
 	return bo;
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 5/5] Staging: atomisp - octal permissions, style fix
  2017-03-27 15:13 [PATCH 1/5] atomisp: remove dead code Alan Cox
                   ` (2 preceding siblings ...)
  2017-03-27 15:14 ` [PATCH 4/5] drivers/staging/media: atomisp: Removing redundant information from dev_err Alan Cox
@ 2017-03-27 15:14 ` Alan Cox
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2017-03-27 15:14 UTC (permalink / raw)
  To: greg, linux-media

From: Derek Robson <robsonde@gmail.com>

Changed permissions to octal style
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_drvfs.c     |    9 +++------
 .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c   |    8 ++++----
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
index fcfe8d7..1ae2358 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
@@ -163,12 +163,9 @@ static ssize_t iunit_dbgopt_store(struct device_driver *drv, const char *buf,
 }
 
 static struct driver_attribute iunit_drvfs_attrs[] = {
-	__ATTR(dbglvl, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, iunit_dbglvl_show,
-		iunit_dbglvl_store),
-	__ATTR(dbgfun, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, iunit_dbgfun_show,
-		iunit_dbgfun_store),
-	__ATTR(dbgopt, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, iunit_dbgopt_show,
-		iunit_dbgopt_store),
+	__ATTR(dbglvl, 0644, iunit_dbglvl_show, iunit_dbglvl_store),
+	__ATTR(dbgfun, 0644, iunit_dbgfun_show, iunit_dbgfun_store),
+	__ATTR(dbgopt, 0644, iunit_dbgopt_show, iunit_dbgopt_store),
 };
 
 static int iunit_drvfs_create_files(struct pci_driver *drv)
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index 1f07c7a..151abf0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -160,10 +160,10 @@ static ssize_t dynamic_pool_show(struct device *dev,
 	return ret;
 };
 
-static DEVICE_ATTR(active_bo, S_IRUGO, active_bo_show, NULL);
-static DEVICE_ATTR(free_bo, S_IRUGO, free_bo_show, NULL);
-static DEVICE_ATTR(reserved_pool, S_IRUGO, reserved_pool_show, NULL);
-static DEVICE_ATTR(dynamic_pool, S_IRUGO, dynamic_pool_show, NULL);
+static DEVICE_ATTR(active_bo, 0444, active_bo_show, NULL);
+static DEVICE_ATTR(free_bo, 0444, free_bo_show, NULL);
+static DEVICE_ATTR(reserved_pool, 0444, reserved_pool_show, NULL);
+static DEVICE_ATTR(dynamic_pool, 0444, dynamic_pool_show, NULL);
 
 static struct attribute *sysfs_attrs_ctrl[] = {
 	&dev_attr_active_bo.attr,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-27 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 15:13 [PATCH 1/5] atomisp: remove dead code Alan Cox
2017-03-27 15:13 ` [PATCH 2/5] atomisp: Remove another dead define Alan Cox
2017-03-27 15:14 ` [PATCH 3/5] atomisp: kill another define Alan Cox
2017-03-27 15:14 ` [PATCH 4/5] drivers/staging/media: atomisp: Removing redundant information from dev_err Alan Cox
2017-03-27 15:14 ` [PATCH 5/5] Staging: atomisp - octal permissions, style fix Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.