Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1662682imm; Wed, 6 Jun 2018 21:18:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLGekf8QED3AKlCIXpJGtTpjBuohhhzoPNj+Xmg2EYAu9iVcKHl5fNrzK2W8l3LfJZF1g2q X-Received: by 2002:a65:4e8e:: with SMTP id b14-v6mr243071pgs.392.1528345088774; Wed, 06 Jun 2018 21:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528345088; cv=none; d=google.com; s=arc-20160816; b=j+ES3w9CPiBYqbmU70orYCnyU0F7MlUKcDRkP8ftrUK4idfdjHn46n554C9V2xh66q w7nMHT9CUp0WOrQXxH2Ui1KYhBp4oYkHHf5ScxST8dJY1xe8fh8AN3yQfJF+2nGwUZk1 zMEEJ+NvWpjVrBZ6Lci/9sWPlsoybFOik2VR/pGjYRlIGyiphNgXKcWxwAIArcbWxo+t EVrF92K7nhKDBml8Qc06XHVSgj4YOxZfiY7FsetFzhfEOb5PKuhlYT/Nz+vxXgOukfVB yIYm0stUX+rUj0ba3PMmVtRharMMLJtZ6TGwCCER+16bOZf64vKdgNvxkdt7tsf1TjUn Gh7A== 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=B30T/MR3oOIEVwdYJwa4azGY1N0gbhZXwu5qbrxKnNA=; b=Txfe9BfOaFQ+9sKeoEW1Jg3JIzhuLf2a7HM0gcOR5874CULiyTXILeOYZW85mmM9r6 TgrZ5/m0xJJcd94rvnOpn2MhhmN7QoM+qRuAuZVPT/K6trBh/4jfPUd8mQlx+bQUnnPn DSiwsSt0FBs+8P4S1nSzbMfISe8ONK6Z+1JZ1Y7K7wdeJHhjEWJTBn/OmaHDOoOUrQiw Yt3YB65IJyBAPQH+AxBV5gR19rskwz7FxMfi8vzixhPX45VXQZPe9cWvuzgn8c0Q9VlQ x/QQlMAMUyDjng33tBMrxKC0ULiup1EvBqaPEqkgv1SqF/o1asO2+VwHTxqFRUVgeTyt dilA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GgqIEDTs; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6-v6si30900979pgn.73.2018.06.06.21.17.53; Wed, 06 Jun 2018 21:18:08 -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=pass header.i=@linaro.org header.s=google header.b=GgqIEDTs; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751521AbeFGERY (ORCPT + 99 others); Thu, 7 Jun 2018 00:17:24 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:41452 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbeFGERX (ORCPT ); Thu, 7 Jun 2018 00:17:23 -0400 Received: by mail-pl0-f66.google.com with SMTP id az12-v6so5191649plb.8 for ; Wed, 06 Jun 2018 21:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=B30T/MR3oOIEVwdYJwa4azGY1N0gbhZXwu5qbrxKnNA=; b=GgqIEDTsLXciUpO5wdEIxmnYQXy3U5T5I0d+dWEBsymqaFC9o3T7qwSoLKMpxE15aO S7OqTK+q2S/fWEgkRYI1GLUdkWJlerBHEfCUHZHta7UpC1Eps67URp2BV0tm+EpXvzOn CjAsADKymcNCpgGbMOUc9wJ/TLloyq8gKG3HI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=B30T/MR3oOIEVwdYJwa4azGY1N0gbhZXwu5qbrxKnNA=; b=Ay1QkJUJGUhRFZ+9JRQz1S2DB7HD7GiTAHtDsdOsuICeSMeI69w7l8SRxaow0YPjcX J69nUTKxdU7dtsfypoB93nq5igPhHmkK9mKLH8wyL0hG4019AJ9KRp4hfgwUT6zMNbZI 64k7Cxjna1XlIIrFTv+t3YxmMixzPzp2hhBY1iGr77JFelOQzpqyUtmY7oHZggR5Zkd/ DHxjNFWVK2Qgu0ohVg/f+WvLcb6sCv92rT0KoLQClBLFbJXt0o9u5by17wEcxlk5AW9g TUq3vDDXNOI8Ul7aRhEezvnULoZmZ33YDSu82XP+FiLhQYtdZ3dbR0cBg3OMD0P4j7Nm FllA== X-Gm-Message-State: APt69E26NDPaX6RlTDTTK4EiwRRdBxwSziV1kyIJNtld/iYp3mqqXAci udp5WI/04gHrf24bVX4mEDBC/w== X-Received: by 2002:a17:902:650a:: with SMTP id b10-v6mr323796plk.45.1528345042356; Wed, 06 Jun 2018 21:17:22 -0700 (PDT) Received: from localhost ([122.172.63.23]) by smtp.gmail.com with ESMTPSA id u65-v6sm47016596pgb.36.2018.06.06.21.17.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 21:17:20 -0700 (PDT) Date: Thu, 7 Jun 2018 09:47:18 +0530 From: Viresh Kumar To: Steven Rostedt Cc: gregkh@linuxfoundation.org, alex.elder@linaro.org, Johan Hovold , 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: <20180607041718.qpqucjzlvcm5h3gn@vireshk-i7> References: <1528186420-6615-3-git-send-email-changbin.du@intel.com> <201806060501.btF3aJMZ%fengguang.wu@intel.com> <20180606095714.1d3c2def@vmware.local.home> <20180606142600.GN13775@localhost> <20180606142622.2338abf6@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606142622.2338abf6@vmware.local.home> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Greg/Alex, @Fegguang/build-bot: I do see mention of Greg and /me in your initial email's body saying TO: Viresh, CC: Greg, but I don't see any of us getting cc'd in your email. Bug ? On 06-06-18, 14:26, Steven Rostedt wrote: > On Wed, 6 Jun 2018 16:26:00 +0200 > Johan Hovold wrote: > > > 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. So why exactly are we generating a warning here ? Is it because it is possible that the first n bytes of src may not have the null terminating byte and the dest may not be null terminated eventually ? Maybe I should just use memcpy here then ? But AFAIR, I used strncpy() specifically because it also sets all the remaining bytes after the null terminating byte with the null terminating byte. And so it is pretty easy for me to check if the final string is null terminated by checking [max - 1] byte against '\0', which the code is doing right now. I am not sure what would the best way to get around this incorrect-warning. And I am wondering on why buildbot reported the warning only for two instances in that file, while I have done the same thing at 4 places. > Ah, yes I now see that. Thanks for pointing it out. But perhaps it > should also add the "- 1" to the strncpy() so that gcc doesn't think > it's a mistake. The src string is passed on from a firmware entity and we need to make sure the protocol (greybus) is implemented properly by the other end. For example, in the current case if the firmware sends "HELLOWORLD", its an error as it should have sent "HELLWORLD\0". But with what you are saying we will forcefully make dest as "HELLWORLD\0", which wouldn't be the right thing to do as we will miss the bug present in firmware. -- viresh