Received: by 10.223.176.5 with SMTP id f5csp3300889wra; Thu, 1 Feb 2018 14:16:26 -0800 (PST) X-Google-Smtp-Source: AH8x224YyIMw4cTxH/6t4odhByoGoFJVo7qB2QshUpH6vqYkWFA5Um+J5Mr8MrBWU+HvdwFvw+0B X-Received: by 2002:a17:902:8f87:: with SMTP id z7-v6mr3309894plo.242.1517523386108; Thu, 01 Feb 2018 14:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517523386; cv=none; d=google.com; s=arc-20160816; b=plc//3+pua7YYFAKV9Y0gLdOIa+ST6EdRECDzKBuwAZlHibHuxa0a0IbbcoL6HN9vC LW5K6Y+G7AQqDbx0Arj7ajNDeX9RFadXl4rw6TxeMZzxTw4d/F17WoOHve4SjWthCRnb Gsmm3svHf0XEWcMcgMO33ie5XZhbd2e/qfvCppSlGceNQTBQTOqr2Y6HMQza81v0jeaA RGuMRA5GKW5uZR8G+AqQA717qssu7XArB5nwhf1ynqYhHq7JnESmTaS0V8bWr5V7iZ6W TaEhgAUqykw9c9ttYuzehi0GntAU0WiZzaH/zTOzf2nktokCRAPq1qH6F7wg6ZONW52H shBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:date:from:dkim-signature :arc-authentication-results; bh=bg5vgmfZNhY7LOS3KuWjqr6BYqo0ormH5ZD2rgw8xwA=; b=EHIQiZ/yZItTHW696iLLe2Afpf24X485YwvQtBpcNBzFc9KPz+/WAt5D5Rt/wOG1ei 9fOv1MT+n9XJjbRE9NYLEl6Ep8M6J2Vk1tirV2U73+cKngrZk6uDEdHTDESwCMReh1LD UrqpUY/ao6K0gZLKQzKig1SO1TmvEmd/kJscPQpjDPSaR5iK3EolZUNVQoFaJlGsZnP6 sCE/MfiAQiLCKquuM8Op3AFxoPP13JHVrwXn0BcydDv/Gcu/mFM4qrhffu1MPtuTCyE4 nNgy79EQBPUQkwj8MH9oPA5OjKmSQYbJNeL6oDTAmAL8nsYz8qPgbnx7HWapNgPdz5X2 aEsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pTVNAUfy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3-v6si434094plb.329.2018.02.01.14.16.09; Thu, 01 Feb 2018 14:16:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pTVNAUfy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbeBAWN2 (ORCPT + 99 others); Thu, 1 Feb 2018 17:13:28 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37140 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbeBAWNX (ORCPT ); Thu, 1 Feb 2018 17:13:23 -0500 Received: by mail-wm0-f45.google.com with SMTP id v71so8663829wmv.2 for ; Thu, 01 Feb 2018 14:13:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=bg5vgmfZNhY7LOS3KuWjqr6BYqo0ormH5ZD2rgw8xwA=; b=pTVNAUfyOQ7GzX/3CycoGNFUbZz4ayjt+gApMJSLqwMkR7PPdfNSTAcRYXhiv99PAj w69BTAardiCE9GZkrVA/IDhfiZEm1ehiJ3wX017hJFceeHLogJWUftcBxtfhadVZzIOW 0lf7tsUXj6IUPSLfZ4bI/74ZsoDo03RZlxJeKpwwcpoITGkcOxMtctzlOL0U2bxjPOkn WRHtM7wov+xlNl7gyHUjmy+7v903m8v+9svddPAinRRpxkD0tjiueOTtO9mOC3txXD7P dzRlLCVFthlqXdZu4qTKUUmjFk3W6eGXNi9UDJwU8b1m1yZAwN4GmzJOGuIq30FQvQhO wlNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=bg5vgmfZNhY7LOS3KuWjqr6BYqo0ormH5ZD2rgw8xwA=; b=crXMvaW4h/MZPFHVU9kch0+zlh3fQ4k8SV5PjqGwPatNIOiE2aq3Vjys/qTECWWakF l9sgB4x18KURoCX1W2vS8P7gvv+4MQGF4bw3BZ4CEGjxuYrMOyCkKwuDN5ZU9pk13v5D bBleBYJ+BVzGJ2aPR5hwutsy2xyif3v22xnrqLdmGUPclXoQTd6dukZB+dZ7xu5UlhWh 7f03Y06CSUOspZnlqGNzFCvf8by742WvWXYZ0cD7n7Cp5D9pGVp2a8RI3GqoYIBLx3NO DQ/UY3t8+5LcZ1ga1/XzXibm6iBRFz6BHf5yukK2zh4w/pl9FliaUZzXzH0ogtyacX0x KQdg== X-Gm-Message-State: AKwxytf/XT0WV/TanWAVE9Cj3JRVKQL1WLx8a52RsOCIExJO0MdccUij WpdjBclH0MkY8yI0jV9gMhT7WjIZ X-Received: by 10.28.224.137 with SMTP id x131mr29696863wmg.60.1517523201539; Thu, 01 Feb 2018 14:13:21 -0800 (PST) Received: from hsp.bmw-carit.intra ([145.253.130.2]) by smtp.gmail.com with ESMTPSA id f8sm84320wmc.3.2018.02.01.14.13.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 14:13:20 -0800 (PST) From: Lukas Bulwahn X-Google-Original-From: Lukas Bulwahn Date: Thu, 1 Feb 2018 23:13:09 +0100 (CET) To: Greg KH cc: Ozan Alpay , Rodrigo Vivi , =?ISO-8859-15?Q?Ville_Syrj=E4l=E4?= , sil2review@lists.osadl.org, kernelnewbies@kernelnewbies.org, David Airlie , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , llvmlinux@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jani Nikula , lukas.bulwahn@gmail.com Subject: Re: clang warning: implicit conversion in intel_ddi.c:1481 In-Reply-To: <20180201180240.GA28042@kroah.com> Message-ID: References: <20180201180240.GA28042@kroah.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-376312225-1517523200=:29994" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-376312225-1517523200=:29994 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Hi Greg, On Thu, 1 Feb 2018, Greg KH wrote: > 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 > > 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. > > > > [...] > > > > 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? > We are interested in providing useful information on potential bugs or bug patterns that we get from static analysis tools, after we pre-assess them and manually select them to send to the review process of the patch submission. For me, the clang warnings were an easy starting point for a student to set up and look at, compared to much more sophisticated tools, such as coccinelle, sparse or new tools for the kernel development, such as CMBC or facebook's Infer. Once we really understand which tools are useful and which information can be quickly pre-assessed and sent out in a useful way without just creating more noise in the discussion, I would have contacted the 0-day infrastructure team or the kernelci.org team to continue the discussion how to include our first setup into a proper semi-automated service. Using the clang warnings, I wanted to explore how this would even potentially work. Considering clang, of course, currently, we cannot compile the whole kernel with all possible kernel configurations with clang, but I believe Nick Desaulniers, Matthias Kaehlcke and others are already working on that and are getting close to this goal. Hence, assuming they will be successful soon, I wanted to explore the next step of using static analysis tools around the clang/LLVM compiler. Actually, v4.15 builds almost "cleanly" with clang: For defconfig, there are only two clang compiler warnings and the one that we looked into deeper here is already resolved in linux-next, so chances are actually high that we might get to this "builds clean" soon-ish, at least for defconfig. Concerning clang warnings and how to progress towards that goal of building cleanly, my strategy is to identify when new clang compiler warnings are introduced and just point these warnings out as code smells during the review discussion before they are merged into the first maintainer tree. If we manually inspect these clang warnings to make sure that they are genuine code smells of some "imprecise implementation" before we send them to the mailing list, I would hope that they are of some value for the developer in the submission process and he/she could address the warning in a patch v2 while he/she is reacting to the other review comments from the human reviewers. At best, I always considered them as useful information during the review process, but I certainly DO NOT want to start patching the kernel due to clang warnings. The chances/risk that we just break more due to naively fixing warnings without proper understanding is much higher than the benefit of actually improving the situation. If I recall correctly, I think this is also one of the lessons learned from motivating newcomers to address warnings in previous kernel newbies activities. Greg, do you think it is worthwhile to invest some effort to move towards the goal "kernel builds cleanly with clang"? Would you agree that providing information during the patch review is a good way to move forward to this goal if we find a suitable manner to provide this feedback quickly and cleanly at this very early stage of development? If not, we will immediately stop to move in this direction and this is the first and last email that you have seen of this kind, and we will have to come up with better/other ideas around work on the Linux kernel. If so, we will continue in the direction sketched above, and I think I just have to point out and apologize for the two obvious things that we did wrong in this specific case here: - We noticed that there were further changes in linux-next, but we thought that our investigation on v4.15 was valuable nevertheless for the developers that had touched the source code that we looked at, although, there is nothing to be done if commits from linux-next are merged into Linus' tree soon. Taking your response, we have clearly been WRONG here, overestimating our contribution versus the noise ratio that we contribute to. - We looked at a clang warning, for which we could only provide the information on this clang warning at this very late stage, i.e., when the commit under investigation has already been merged and the kernel was released. So pointing out shortcoming of that kind seems to have no value, as you, Greg, would not backport commits to stable anyway. This has been both errors on my side as a mentor. After my student has started this week and has worked hard for a week learning a lot about Linux kernel development and all the tools around it, I did not want to discourage him and say that the goal set at the beginning of the week to identify and report a code smell on one commit on the mailing list has not been achieved as for the reasons above. Instead, we decided to send it out and were interested in the general reception of our work of this first week. I apologize for that and hope we can leave the specific reported issue now just rest in peace. This experiment shows that I still need to improve my understanding how to contribute properly to the kernel development. At least to me, the policy on clang warnings was not clear; and I have learned this now in this more indirect way. We only sent out this one email to see if clang warnings are of interest at all, and we are glad that you came back to us so quickly with feedback. Greg, if you can continue to be a sparing partner and point out when we are moving in the wrong direction, we will try our best to understand how we can contribute to turn results from bug finders and static analysis tools with the manual pre-assessment we can do into valuable contributions on the mailing list and the linux kernel development. We certainly do not intend to spam the mailing list with reports of findings nobody cares about. Best regards, Lukas --8323329-376312225-1517523200=:29994--