power: smb1398: Replace use of do_div() with plain division

do_div() operates on a 64-bit divisor and hence its use leads to the
following compilation error (error output edited for brevity):

  warning: comparison of distinct pointer types ('typeof ((iout_ua)) *'
  (aka 'int *') and 'uint64_t *' (aka 'unsigned long long *'))
  [-Wcompare-distinct-pointer-types]
          rc = smb1398_set_ichg_ma(chip, do_div(iout_ua, 1000));
                                         ^~~~~~~~~~~~~~~~~~~~~
  include/asm-generic/div64.h:226:28: note: expanded from macro 'do_div'
          (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
                 ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
  error: incompatible pointer types passing 'int *' to parameter of type
  'uint64_t *' (aka 'unsigned long long *')
  [-Werror,-Wincompatible-pointer-types]
          rc = smb1398_set_ichg_ma(chip, do_div(iout_ua, 1000));

Fix this by replacing do_div() with a simple division operation.

Change-Id: Ifb43b7cc68e0424bfbd7fa58dce449d6dd849cd6
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
This commit is contained in:
Guru Das Srinagesh 2021-01-20 18:22:25 -08:00
commit dd58d3d291

View file

@ -2284,7 +2284,7 @@ static int smb1398_pre_regulator_iout_vote_cb(struct votable *votable,
return -EINVAL;
iout_ua = min(iout_ua, MAX_IOUT_UA);
rc = smb1398_set_ichg_ma(chip, do_div(iout_ua, 1000));
rc = smb1398_set_ichg_ma(chip, (iout_ua / 1000));
if (rc < 0)
return rc;