Hi Adam, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on clk/clk-next] [also build test WARNING on v5.11-rc2 next-20210104] [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] url: https://github.com/0day-ci/linux/commits/Adam-Ford/dt-bindings-clk-versaclock5-Add-load-capacitance-properties/20210107-014404 base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next config: x86_64-randconfig-m001-20210106 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot New smatch warnings: drivers/clk/clk-versaclock5.c:803 vc5_update_cap_load() warn: unsigned 'mapped_value' is never less than zero. Old smatch warnings: drivers/clk/clk-versaclock5.c:811 vc5_update_cap_load() warn: unsigned 'mapped_value' is never less than zero. vim +/mapped_value +803 drivers/clk/clk-versaclock5.c 761 762 static int vc5_map_cap_value(u32 femtofarads) 763 { 764 int mapped_value; 765 766 /* The datasheet explicitly states 9000 - 25000 */ 767 if ((femtofarads < 9000) || (femtofarads > 25000)) 768 return -EINVAL; 769 770 /* The lowest target we can hit is 9430, so exit if it's less */ 771 if (femtofarads < 9430) 772 return 0; 773 774 /* 775 * According to VersaClock 6E Programming Guide, there are 6 776 * bits which translate to 64 entries in XTAL registers 12 and 777 * 13. Because bits 0 and 1 increase the capacitance the 778 * same, some of the values can be repeated. Plugging this 779 * into a spreadsheet and generating a trendline, the output 780 * equation becomes x = (y-9098.29) / 216.44, where 'y' is 781 * the desired capacitance in femtofarads, and x is the value 782 * of XTAL[5:0]. 783 * To help with rounding, do fixed point math 784 */ 785 femtofarads *= 100; 786 mapped_value = (femtofarads - 909829) / 21644; 787 788 /* 789 * The datasheet states, the maximum capacitance is 25000, 790 * but the programmer guide shows a max value is 22832, 791 * so values higher values could overflow, so cap it. 792 */ 793 mapped_value = max(mapped_value/100, 0x3f); 794 795 return mapped_value; 796 } 797 static int vc5_update_cap_load(struct device_node *node, struct vc5_driver_data *vc5) 798 { 799 u32 value, mapped_value; 800 801 if (!of_property_read_u32(node, "idt,xtal1-load-femtofarads", &value)) { 802 mapped_value = vc5_map_cap_value(value); > 803 if (mapped_value < 0) 804 return mapped_value; 805 806 regmap_write(vc5->regmap, VC5_XTAL_X1_LOAD_CAP, (mapped_value << 2)); 807 } 808 809 if (!of_property_read_u32(node, "idt,xtal2-load-femtofarads", &value)) { 810 mapped_value = vc5_map_cap_value(value); 811 if (mapped_value < 0) 812 return mapped_value; 813 regmap_write(vc5->regmap, VC5_XTAL_X2_LOAD_CAP, (mapped_value << 2)); 814 } 815 816 return 0; 817 } 818 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org