Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp891412imm; Wed, 6 Jun 2018 07:28:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLVYRWnPPvEJM/p/2M2PW3nm48YwMmzdOgm49CczddTazxLkP3Mvji5t7u4WHeD5gI0mWY/ X-Received: by 2002:a62:121a:: with SMTP id a26-v6mr2716843pfj.104.1528295294691; Wed, 06 Jun 2018 07:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528295294; cv=none; d=google.com; s=arc-20160816; b=hd8HhMUmz1XWDOwnnQuFAjKusV0jEuucSb71WA5NWJAcreCnwE1XSGTHgxuZBerBim SRJA6734nZK5WEr+Bl5w4WN4pMoH3rKjAaUw8amfhamdavl/nUWROphjc9hU3fereqp/ +RmD6YGMECAdxCptnFkPdTFh2pJWPpBxDAgUxLRQkUfjrjr3ikKh73W/nTlVglayUpUF OzM4CotXIFPC7cRBApAxihrisDwrOqizDynKm1aV3Vs2G0j0raIdydFds9XW8SvPTo/S SnMUQGFyFtgi9If0F2ACuQXdVvaBH76oHWGAH5AAapaUAvRLzBW8Ym5K0TQAnzpv3bB/ KhQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=qeM5E3VsfcejD+jVgwkah6ieZ4tT3WLxvpei9aB57wI=; b=IXjEEtxQMEK1AsUO16XBqTeoFb43WfC3WUA4SaHKtYGb1RqmAnY3Z5xhmKIkAuBxGy wlbXy7kfpil5dMdgQOcDnx5NiHVbC49Q1vtRy9v2Q+b5tfaLlsT85rfiSoWwDlEYfzqq l1lunpphRW41JKysNM0qC0r2O3uc9D6gsWdUCtPMFZXQDr93/tYfjAO8wmiAbTeP4EiG AjdqXzL8my1r1nul8TiVpy4KBHzFAm/v1JU6nwi07tWvg0wmrj21BmrMiirZtg2UHtap prl3Swm58pm+DDtFA0upwivNOEb9HeAwyhwp3kMpoHJFBe0/MF7oZbQl3QXK3c6UdUUn Z/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=A5yL4Bic; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8-v6si51178591ple.469.2018.06.06.07.27.59; Wed, 06 Jun 2018 07:28:14 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=A5yL4Bic; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752234AbeFFO0V (ORCPT + 99 others); Wed, 6 Jun 2018 10:26:21 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:43650 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbeFFO0Q (ORCPT ); Wed, 6 Jun 2018 10:26:16 -0400 Received: by mail-lf0-f65.google.com with SMTP id n15-v6so9419999lfn.10; Wed, 06 Jun 2018 07:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qeM5E3VsfcejD+jVgwkah6ieZ4tT3WLxvpei9aB57wI=; b=A5yL4Bic4gN34lR9vR4dIJYlBvgmLBA713v8BrLf4N4ouTnf3V+FQqXFiqT9DYlEE7 mmb+UZLYTF4P5gbS8XD51bEHt3XODfxAyWttOOnyjtu8b7s8uUj8SuH6Y7X1fEMquc8F oaWKzLzrGenhLlWw0yLzwxYTozwdOHmROZHzMbuitRu0rqqGygO9w7Oj1qGa2/9tvm+l vZDb5KuWBckUNZ7eDakM0R9WbOZc722+BaLhUUkIjRzxmd4NfB23e/TKzpcUtFJidxCx ZP6tysBGjTDbJrS22de/Fnb8cVyy+yLiXVHru2VvC5vN+0Ox9fzlg6xnp1d69q99VgSS x+rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=qeM5E3VsfcejD+jVgwkah6ieZ4tT3WLxvpei9aB57wI=; b=AlMDWzGIwlhBPIihFxMOyr9uP618ay+R/zPSHHM3YKzGUFL1XdVVeZ+DL7z9Au/lH2 DMgslvJg0vPMh87dlXO+3vTOW56+oMMP1ibyyra2g6MAeA5RWbNHEwRuVqtV9bdAzISl klcAj/2Lf4YT3BZeax+l8joAcAVEC+4sIkpeeJkoOa8+Hq9zYlne+5EyBZm3jqbT4B3z ZkqKOxybZLpxf6cZ05X46/50Y5f/YXm1v0blxhHkQm7Ly1E4qFd6YoUJvmADd+qY7L9R fvjQy2D+OiB0v9OufYgSTd5j9hpEN0+tCQK0zFL6MW9Ft8BMq4Ydl9ZmexxXEOgFpeGv 36Aw== X-Gm-Message-State: APt69E2D1cf5LN+sreVaiI24hswS0oM/jjCr89/PVeALOhmxhLiH/g9Q 3Oj2erSLKam7WOIhwYgAa3U= X-Received: by 2002:a2e:1dd9:: with SMTP id w86-v6mr2249289lje.110.1528295174609; Wed, 06 Jun 2018 07:26:14 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id b141-v6sm1319927lfg.15.2018.06.06.07.26.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 07:26:13 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fQZNw-0007dE-UZ; Wed, 06 Jun 2018 16:26:01 +0200 Date: Wed, 6 Jun 2018 16:26:00 +0200 From: Johan Hovold To: Steven Rostedt , Viresh Kumar Cc: kbuild test robot , linux-arch@vger.kernel.org, michal.lkml@markovi.net, linux-kernel@vger.kernel.org, arnd@arndb.de, yamada.masahiro@socionext.com, lgirdwood@gmail.com, broonie@kernel.org, rdunlap@infradead.org, x86@kernel.org, linux@armlinux.org.uk, changbin.du@intel.com, linux-sparse@vger.kernel.org, mingo@redhat.com, kbuild-all@01.org, akpm@linux-foundation.org, changbin.du@gmail.com, tglx@linutronix.de, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 2/4] kernel hacking: new config NO_AUTO_INLINE to disable compiler auto-inline optimizations Message-ID: <20180606142600.GN13775@localhost> References: <1528186420-6615-3-git-send-email-changbin.du@intel.com> <201806060501.btF3aJMZ%fengguang.wu@intel.com> <20180606095714.1d3c2def@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606095714.1d3c2def@vmware.local.home> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 06, 2018 at 09:57:14AM -0400, Steven Rostedt wrote: > On Wed, 6 Jun 2018 05:21:55 +0800 > kbuild test robot wrote: > > > Hi Changbin, > > > > Thank you for the patch! Perhaps something to improve: > > > > [auto build test WARNING on linus/master] > > [also build test WARNING on v4.17 next-20180605] > > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > > > url: https://github.com/0day-ci/linux/commits/changbin-du-intel-com/kernel-hacking-GCC-optimization-for-better-debug-experience-Og/20180606-001415 > > config: ia64-allmodconfig (attached as .config) > > compiler: ia64-linux-gcc (GCC) 8.1.0 > > reproduce: > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # save the attached .config to linux build tree > > make.cross ARCH=ia64 > > > > All warnings (new ones prefixed by >>): > > > > drivers//staging/greybus/fw-management.c: In function 'fw_mgmt_load_and_validate_operation': > > >> drivers//staging/greybus/fw-management.c:153:2: warning: 'strncpy' specified bound 10 equals destination size [-Wstringop-truncation] > > strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_SIZE); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers//staging/greybus/fw-management.c: In function 'fw_mgmt_backend_fw_update_operation': > > drivers//staging/greybus/fw-management.c:304:2: warning: 'strncpy' specified bound 10 equals destination size [-Wstringop-truncation] > > strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_SIZE); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > -- > > drivers/auxdisplay/panel.c: In function 'panel_bind_key': > > >> drivers/auxdisplay/panel.c:1509:2: warning: 'strncpy' specified bound 12 equals destination size [-Wstringop-truncation] > > strncpy(key->u.kbd.press_str, press, sizeof(key->u.kbd.press_str)); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers/auxdisplay/panel.c:1510:2: warning: 'strncpy' specified bound 12 equals destination size [-Wstringop-truncation] > > strncpy(key->u.kbd.repeat_str, repeat, sizeof(key->u.kbd.repeat_str)); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Nice! This patch actually caused bugs in other areas of the code to be > caught by the build system. > > The patch is not wrong. The code that has these warnings are. Looks like the greybus code above is working as intended by checking for unterminated string after the strncpy, even if this does now triggers the truncation warning. drivers/auxdisplay/panel.c looks broken, though. > > vim +/strncpy +153 drivers//staging/greybus/fw-management.c > > > > 013e6653 Viresh Kumar 2016-05-14 138 > > 013e6653 Viresh Kumar 2016-05-14 139 static int fw_mgmt_load_and_validate_operation(struct fw_mgmt *fw_mgmt, > > 013e6653 Viresh Kumar 2016-05-14 140 u8 load_method, const char *tag) > > 013e6653 Viresh Kumar 2016-05-14 141 { > > 013e6653 Viresh Kumar 2016-05-14 142 struct gb_fw_mgmt_load_and_validate_fw_request request; > > 013e6653 Viresh Kumar 2016-05-14 143 int ret; > > 013e6653 Viresh Kumar 2016-05-14 144 > > 013e6653 Viresh Kumar 2016-05-14 145 if (load_method != GB_FW_LOAD_METHOD_UNIPRO && > > 013e6653 Viresh Kumar 2016-05-14 146 load_method != GB_FW_LOAD_METHOD_INTERNAL) { > > 013e6653 Viresh Kumar 2016-05-14 147 dev_err(fw_mgmt->parent, > > 013e6653 Viresh Kumar 2016-05-14 148 "invalid load-method (%d)\n", load_method); > > 013e6653 Viresh Kumar 2016-05-14 149 return -EINVAL; > > 013e6653 Viresh Kumar 2016-05-14 150 } > > 013e6653 Viresh Kumar 2016-05-14 151 > > 013e6653 Viresh Kumar 2016-05-14 152 request.load_method = load_method; > > b2abeaa1 Viresh Kumar 2016-08-11 @153 strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_SIZE); > > 013e6653 Viresh Kumar 2016-05-14 154 > > 013e6653 Viresh Kumar 2016-05-14 155 /* > > 013e6653 Viresh Kumar 2016-05-14 156 * The firmware-tag should be NULL terminated, otherwise throw error and > > 013e6653 Viresh Kumar 2016-05-14 157 * fail. > > 013e6653 Viresh Kumar 2016-05-14 158 */ > > b2abeaa1 Viresh Kumar 2016-08-11 159 if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') { > > 013e6653 Viresh Kumar 2016-05-14 160 dev_err(fw_mgmt->parent, "load-and-validate: firmware-tag is not NULL terminated\n"); > > 013e6653 Viresh Kumar 2016-05-14 161 return -EINVAL; > > 013e6653 Viresh Kumar 2016-05-14 162 } Viresh, do you want to work around the warning somehow? Thanks, Johan