Re: clang warning: implicit conversion in intel_ddi.c:1481
From: Ozgur
Date: Thu Feb 01 2018 - 14:36:08 EST
01.02.2018, 21:03, "Greg KH" <greg@xxxxxxxxx>:
> On Thu, Feb 01, 2018 at 06:33:30PM +0100, Ozan Alpay wrote:
>> ÂDear Rodrigo Vivi, Ville SyrjÃlÃ,
>>
>> ÂMy name is Ozan Alpay, and I am a student mentored by Lukas Bulwahn. We
Hi Ozan,
why did you send e-mail to kernel development e-mail list?
>> Âintend to use static analysis tools on the kernel source to identify,
>> Âanalyze and report issues. As a very first step, we are looking into
>> Âclang compiler warnings and will then move to more sophisticated tools.
>>
>> ÂWhen compiling Linux 4.15 with clang, we have discovered that your commit
>> Â2952cd6fb4cc ("drm/i915: Let's use more enum intel_dpll_id pll_id.")
>> Âintroduced the following warning:
>>
>> Âdrivers/gpu/drm/i915/intel_ddi.c:1481:30: warning: implicit conversion from enumeration type 'enum port' to different enumeration type 'enum intel_dpll_id' [-Wenum-conversion]
>> ÂÂÂÂÂÂÂÂÂenum intel_dpll_id pll_id = port;
>>
>> ÂTo reproduce it, you can compile Linux 4.15 with clang with this command:
>>
>> Âmake HOSTCC=clang-5.0 defconfig && make -j32 HOSTCC=clang-5.0 CC=clang-5.0
>>
>> ÂIf you don't have clang installed in your system, you can use this simple
>> Âdocker setup to compile the kernel with clang:
>>
>> Âwget https://raw.githubusercontent.com/bulwahn/linux-kernel-analysis/master/docker/kernel-clang/Dockerfile && \
>> Âdocker build -t kernel-clang . && \
>> Âdocker run -v <your kernel source directory>:/linux/ kernel-clang /bin/sh -c "cd linux && make CC=clang-5.0 clean && make HOSTCC=clang-5.0 defconfig && make -j32 HOSTCC=clang-5.0 CC=clang-5.0"
>>
>> ÂWhile we were doing our analysis on 4.15, we noticed that you already
>> Âresolved this warning on linux-next with your work in commit bb911536f07e
>> Â("drm/i915: Eliminate pll->state usage from bxt_calc_pll_link()"). So,
>> Âsince it is resolved on linux-next and we expect that this commit will be
>> Âmerged in the merge window for 4.16, there is probably nothing further to
>> Âdo.
>>
>> ÂLinux 4.15 is shipped with this clang warning, but we don't see the
>> Âcrucial need to provide a backport commit to the stable branch for 4.15.
>> ÂWe just wanted to inform you about our analysis of this clang warning.
>> ÂUltimately the final call if you would like to address this clang warning
>> Âin 4.15 is yours.
>
> Note, I have not taken "clang warning fixes" for stable kernel updates
> in the past, and I doubt I will in the future, unless the tree "builds
> clean" with clang. If it eventually gets there, then yes, I will do
> that.
>
> Note, if you are going to email this out to everyone who fixes a warning
> message, you might want to reconsider it. That's going to be a lot of
> work, and for people who have already fixed an issue, it's kind of
> pointless to just remind them of work they have done in the past, right?
>
> What is the goal of these types of emails?
>
> thanks,
>
> greg k-h
Ozgur