[PATCH] drivers: clk: zynqmp: remove clock name dependency

kernel test robot lkp at intel.com
Wed Jan 3 17:41:12 PST 2024


Hi Naman,

kernel test robot noticed the following build warnings:

[auto build test WARNING on clk/clk-next]
[also build test WARNING on linus/master v6.7-rc8 next-20240103]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Naman-Trivedi-Manojbhai/drivers-clk-zynqmp-remove-clock-name-dependency/20240103-152152
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
patch link:    https://lore.kernel.org/r/20240103072017.1646007-1-naman.trivedimanojbhai%40amd.com
patch subject: [PATCH] drivers: clk: zynqmp: remove clock name dependency
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240104/202401040935.LLlZNxiu-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240104/202401040935.LLlZNxiu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401040935.LLlZNxiu-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/clk/zynqmp/clkc.c: In function 'zynqmp_get_parent_list':
>> drivers/clk/zynqmp/clkc.c:565:50: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     565 |                                         clk_name = __clk_get_name(clk_parent);
         |                                                  ^
   drivers/clk/zynqmp/clkc.c:583:50: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     583 |                                         clk_name = __clk_get_name(clk_parent);
         |                                                  ^


vim +/const +565 drivers/clk/zynqmp/clkc.c

   535	
   536	/**
   537	 * zynqmp_get_parent_list() - Create list of parents name
   538	 * @np:			Device node
   539	 * @clk_id:		Clock index
   540	 * @parent_list:	List of parent's name
   541	 * @num_parents:	Total number of parents
   542	 *
   543	 * Return: 0 on success else error+reason
   544	 */
   545	static int zynqmp_get_parent_list(struct device_node *np, u32 clk_id,
   546					  const char **parent_list, u32 *num_parents)
   547	{
   548		int i = 0, ret;
   549		u32 total_parents = clock[clk_id].num_parents;
   550		struct clock_topology *clk_nodes;
   551		struct clock_parent *parents;
   552		struct clk *clk_parent;
   553		char *clk_name;
   554	
   555		clk_nodes = clock[clk_id].node;
   556		parents = clock[clk_id].parent;
   557	
   558		for (i = 0; i < total_parents; i++) {
   559			if (!parents[i].flag) {
   560				ret = of_property_match_string(np, "clock-names",
   561							       parents[i].name);
   562				if (ret >= 0) {
   563					clk_parent = of_clk_get(np, ret);
   564					if (clk_parent) {
 > 565						clk_name = __clk_get_name(clk_parent);
   566						if (clk_name)
   567							strcpy(parents[i].name, clk_name);
   568						else
   569							return 1;
   570					} else {
   571						return 1;
   572					}
   573				}
   574				parent_list[i] = parents[i].name;
   575			} else if (parents[i].flag == PARENT_CLK_EXTERNAL) {
   576				ret = of_property_match_string(np, "clock-names",
   577							       parents[i].name);
   578				if (ret < 0) {
   579					strcpy(parents[i].name, "dummy_name");
   580				} else {
   581					clk_parent = of_clk_get(np, ret);
   582					if (clk_parent) {
   583						clk_name = __clk_get_name(clk_parent);
   584						if (clk_name)
   585							strcpy(parents[i].name, clk_name);
   586						else
   587							return 1;
   588					} else {
   589						return 1;
   590					}
   591				}
   592				parent_list[i] = parents[i].name;
   593			} else {
   594				strcat(parents[i].name,
   595				       clk_type_postfix[clk_nodes[parents[i].flag - 1].
   596				       type]);
   597				parent_list[i] = parents[i].name;
   598			}
   599		}
   600	
   601		*num_parents = total_parents;
   602		return 0;
   603	}
   604	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



More information about the linux-arm-kernel mailing list