From: kernel test robot <lkp@intel.com>
To: Jack Yu <jack.yu@realtek.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Mark Brown <broonie@kernel.org>
Subject: [broonie-ci:file0IqEIN 13/14] sound/soc/codecs/rt1318.c:785:5: warning: no previous prototype for function 'rt1318_pll_calc'
Date: Thu, 20 Jun 2024 00:07:14 +0800 [thread overview]
Message-ID: <202406200032.k77XsxDK-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git file0IqEIN
head: 04c200922d911f7a33febc0e7991f3a2efd856ad
commit: 48ed4d2435aa749a8d59fd7543313d51d0800175 [13/14] ASoC: rt1318: Add RT1318 audio amplifier driver
config: x86_64-buildonly-randconfig-005-20240619 (https://download.01.org/0day-ci/archive/20240620/202406200032.k77XsxDK-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200032.k77XsxDK-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406200032.k77XsxDK-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> sound/soc/codecs/rt1318.c:785:5: warning: no previous prototype for function 'rt1318_pll_calc' [-Wmissing-prototypes]
785 | int rt1318_pll_calc(const unsigned int freq_in,
| ^
sound/soc/codecs/rt1318.c:785:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
785 | int rt1318_pll_calc(const unsigned int freq_in,
| ^
| static
sound/soc/codecs/rt1318.c:1340:3: error: field designator 'probe_new' does not refer to any field in type 'struct i2c_driver'
1340 | .probe_new = rt1318_i2c_probe,
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +/rt1318_pll_calc +785 sound/soc/codecs/rt1318.c
784
> 785 int rt1318_pll_calc(const unsigned int freq_in,
786 const unsigned int freq_out, struct rt1318_pll_code *pll_code)
787 {
788 int max_n = RT1318_PLL_N_MAX, max_m = RT1318_PLL_M_MAX;
789 int i, k, red, n_t, pll_out, in_t, out_t;
790 int n = 0, m = 0, m_t = 0;
791 int red_t = abs(freq_out - freq_in);
792 bool m_bypass = false, k_bypass = false;
793
794 if (RT1318_PLL_INP_MAX < freq_in || RT1318_PLL_INP_MIN > freq_in)
795 return -EINVAL;
796
797 for (i = 0; i < ARRAY_SIZE(pll_preset_table); i++) {
798 if (freq_in == pll_preset_table[i].pll_in &&
799 freq_out == pll_preset_table[i].pll_out) {
800 k = pll_preset_table[i].k;
801 m = pll_preset_table[i].m;
802 n = pll_preset_table[i].n;
803 m_bypass = pll_preset_table[i].m_bp;
804 k_bypass = pll_preset_table[i].k_bp;
805 goto code_find;
806 }
807 }
808
809 k = 100000000 / freq_out - 2;
810 if (k > RT1318_PLL_K_MAX)
811 k = RT1318_PLL_K_MAX;
812 if (k < 0) {
813 k = 0;
814 k_bypass = true;
815 }
816 for (n_t = 0; n_t <= max_n; n_t++) {
817 in_t = freq_in / (k_bypass ? 1 : (k + 2));
818 pll_out = freq_out / (n_t + 2);
819 if (in_t < 0)
820 continue;
821 if (in_t == pll_out) {
822 m_bypass = true;
823 n = n_t;
824 goto code_find;
825 }
826 red = abs(in_t - pll_out);
827 if (red < red_t) {
828 m_bypass = true;
829 n = n_t;
830 m = m_t;
831 if (red == 0)
832 goto code_find;
833 red_t = red;
834 }
835 for (m_t = 0; m_t <= max_m; m_t++) {
836 out_t = in_t / (m_t + 2);
837 red = abs(out_t - pll_out);
838 if (red < red_t) {
839 m_bypass = false;
840 n = n_t;
841 m = m_t;
842 if (red == 0)
843 goto code_find;
844 red_t = red;
845 }
846 }
847 }
848 pr_debug("Only get approximation about PLL\n");
849
850 code_find:
851
852 pll_code->m_bp = m_bypass;
853 pll_code->k_bp = k_bypass;
854 pll_code->m_code = m;
855 pll_code->n_code = n;
856 pll_code->k_code = k;
857 return 0;
858 }
859
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-06-19 16:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202406200032.k77XsxDK-lkp@intel.com \
--to=lkp@intel.com \
--cc=broonie@kernel.org \
--cc=jack.yu@realtek.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.