Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit dd58d3d2 authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

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: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 084fe9ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment