Hi Baruch, I love your patch! Perhaps something to improve: [auto build test WARNING on pwm/for-next] [also build test WARNING on robh/for-next v5.13-rc3 next-20210524] [cannot apply to agross-msm/qcom/for-next] [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/Baruch-Siach/pwm-driver-for-qualcomm-ipq6018-pwm-block/20210524-182306 base: https://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git for-next config: arc-allyesconfig (attached as .config) compiler: arceb-elf-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/fd963192953e74575c0bba469b6a1ef769db9d33 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Baruch-Siach/pwm-driver-for-qualcomm-ipq6018-pwm-block/20210524-182306 git checkout fd963192953e74575c0bba469b6a1ef769db9d33 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/pwm/pwm-ipq.c: In function 'ipq_pwm_apply': >> drivers/pwm/pwm-ipq.c:125:34: warning: integer overflow in expression of type 'long int' results in '-727379968' [-Woverflow] 125 | fin_ps = div64_u64(NSEC_PER_SEC * 1000, rate); | ^ vim +125 drivers/pwm/pwm-ipq.c 103 104 static int ipq_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, 105 const struct pwm_state *state) 106 { 107 struct ipq_pwm_chip *ipq_chip = to_ipq_pwm_chip(chip); 108 unsigned long freq; 109 int pre_div, close_pre_div, close_pwm_div; 110 int pwm_div; 111 long long diff; 112 unsigned long rate = clk_get_rate(ipq_chip->clk); 113 unsigned long min_diff = rate; 114 uint64_t fin_ps; 115 u64 period_ns, duty_ns; 116 117 if (state->period < MIN_PERIOD_NS) 118 return -ERANGE; 119 120 period_ns = min_t(u64, state->period, MAX_PERIOD_NS); 121 duty_ns = min_t(u64, state->duty_cycle, period_ns); 122 123 /* freq in Hz for period in nano second*/ 124 freq = NSEC_PER_SEC / period_ns; > 125 fin_ps = div64_u64(NSEC_PER_SEC * 1000, rate); 126 close_pre_div = MAX_PWM_CFG; 127 close_pwm_div = MAX_PWM_CFG; 128 129 for (pre_div = 0; pre_div <= MAX_PWM_CFG; pre_div++) { 130 pwm_div = DIV64_U64_ROUND_CLOSEST(period_ns * 1000, 131 fin_ps * (pre_div + 1)); 132 pwm_div--; 133 if (pwm_div < 0 || pwm_div > MAX_PWM_CFG) 134 continue; 135 136 diff = ((uint64_t)freq * (pre_div + 1) * (pwm_div + 1)) 137 - (uint64_t)rate; 138 139 if (diff < 0) /* period larger than requested */ 140 continue; 141 if (diff == 0) { /* bingo */ 142 close_pre_div = pre_div; 143 close_pwm_div = pwm_div; 144 break; 145 } 146 if (diff < min_diff) { 147 min_diff = diff; 148 close_pre_div = pre_div; 149 close_pwm_div = pwm_div; 150 } 151 } 152 153 /* config divider values for the closest possible frequency */ 154 config_div_and_duty(pwm, close_pre_div, close_pwm_div, 155 period_ns, duty_ns); 156 if (state->enabled) 157 ipq_pwm_enable(pwm); 158 else 159 ipq_pwm_disable(pwm); 160 161 return 0; 162 } 163 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org