Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1922979imm; Thu, 7 Jun 2018 02:28:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJgy6+x2gaUXq7nwbGC7xTcNqp7ytQC8E4SDcW0YmFXf1LSOLjh5WVvqWxeuoyIiT6/dJe1 X-Received: by 2002:a65:47c8:: with SMTP id f8-v6mr947543pgs.430.1528363721624; Thu, 07 Jun 2018 02:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528363721; cv=none; d=google.com; s=arc-20160816; b=ThvQyb4rQAIDug6BMiNwQOlaRGhOctMeDkZByZJwejQpC5fTljI5GAQ4WglI8QyQGu oUFvVktWbI/MkZkK47tpLCeXp3I2Hco9zwgSezzdEvz7jv5TAjVfeEu6VEiVg+o0BoiT Gq5Xzo4i+/h76gaPAloEzOn1JjaIBbf5vIr/kAgFULj3c4o/fUjYKAHQjd5fl+xv0RXj lc7+58N34GUCDM7KBplJvZl/gaJcQr4eROS0DtO4VYclytBtHje1BpD2xOjR/NtA1+EL XfLKWqnPvAs/Zc11XCyRYehp1CJo8lF/h9Rw0kWw9QEm96oawb7X89YIl3nkN0hr5TBI 3XDQ== 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=1TpRIKE/7wxlbt7AoPHCf6M4St6zmDa2kXZGtSc/FWE=; b=y1dsPUjRN6zEOEq6bHdBU7DI16KwPhznZFnwPAUfkxU4hq92ubw0FZAzY806AvgVNy l1SCx+ktBKoQ0VkgNipajCBDA/vsx9pm64sIJ6cQo5ycfkmHYhM43WK6A2TYebp6b7Zg hZiHgWcSDwPYmjZlLpB2I7wcBslq4/7/y6qjsknoSNaoXtNu+lnDzZgjQzm3Mh1JPfFf 7pWoisE8rVpe5fR/UxhWWWKFO3yl9OA8rP/LqwnnVtc8YJvcMIOXmFQOOGWd5uf9Rd7+ hJvhOjeMpVJ7hF5D1pwzTIsvd0Y7yKboLgWV/MvI14H490FOi0fwNPDmFAfAjxLtgJLT BELQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IXTEo4OJ; 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 f35-v6si52163327plh.193.2018.06.07.02.28.27; Thu, 07 Jun 2018 02:28:41 -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=IXTEo4OJ; 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 S932802AbeFGJSf (ORCPT + 99 others); Thu, 7 Jun 2018 05:18:35 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:40736 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301AbeFGJSc (ORCPT ); Thu, 7 Jun 2018 05:18:32 -0400 Received: by mail-lf0-f67.google.com with SMTP id q11-v6so13530462lfc.7; Thu, 07 Jun 2018 02:18:31 -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=1TpRIKE/7wxlbt7AoPHCf6M4St6zmDa2kXZGtSc/FWE=; b=IXTEo4OJvtaTSVWVwCKMpSdj84yTv6DXzmYTGJD7tOas1Gv23MH6y7YNg8ZXcuzM+x BE2inub7wtd0QGpWumhgBOiM2OW/6oP1H0mPdHzdIJDDJKcAn+2xzisEEgEzVFGzBubO VaZzIu7cOjwqsQyWajCKmnS8p4ZSYscPSvm5Zs2b6NAj/PpfYsLszP/D+4dJuDVKbcBe iRbMG+/RtSfuRKLWb4N7XxTuW9utziQNsjvzOEnxEOo+Ud4Q6R9dVQq1WYzmV5GkY7Gp IsSwp5s+4EZl6CkTcb+4ZGeXZ3R6rJWWvxL/382EGNTGQl0wbSEli05WlNlnk993rFw/ 9vuw== 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=1TpRIKE/7wxlbt7AoPHCf6M4St6zmDa2kXZGtSc/FWE=; b=YRBIuesjmzRpzYTUIyU0IZbeHy8MVH8Ree/iWsKJGoSIUCq6hCyS388Qw0AjxfvfaP WZMOTM6gHFTI2t9aCxArLIaQbq2E5XWZzgq8ikO2d+fM9NwKYfbJYWlm2Yk4DKeoOuAL DEJclc1IE5ILZoYs6aMUc1ApmtcRTufPLMf4pFnvQnHyuagsng5roBcTa2sb7w2p1lmm 22Q7vuXNGDj4/WP/htxTYPkts3hM3e1eZJWwTYcnLZ9UbMyKy1Zf12p3CPekSkB2Eyzs wicS6OdUqHmdq9KKLUDi1OuXUk1nFprSP3L9iRBmRZ/pBvUp6UPt+YFeeazF8RXTrVMW +W1A== X-Gm-Message-State: APt69E2oRQfWFW185d097jTWL289aYgwLyQsxFuOJWd2g/xleuJrT29w SsqUfDCI3UV7D+8JN0ZChRI= X-Received: by 2002:a2e:2bcb:: with SMTP id r72-v6mr930855ljr.133.1528363110786; Thu, 07 Jun 2018 02:18:30 -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 o11-v6sm3617314lji.0.2018.06.07.02.18.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 02:18:29 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fQr3g-0000KQ-9w; Thu, 07 Jun 2018 11:18:16 +0200 Date: Thu, 7 Jun 2018 11:18:16 +0200 From: Johan Hovold To: Viresh Kumar Cc: Bernd Petrovitsch , "Du, Changbin" , Steven Rostedt , 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, 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: <20180607091816.GT13775@localhost> 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> <20180607041718.qpqucjzlvcm5h3gn@vireshk-i7> <20180607074628.kd3iyxevwj3ypzbr@intel.com> <20180607083856.ealw62v3wx43zeqz@vireshk-i7> <1303b1abf9f9229a8d3ccbb68a3e413266b360d7.camel@petrovitsch.priv.at> <20180607091025.m7dfix3e2xbwx4cs@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180607091025.m7dfix3e2xbwx4cs@vireshk-i7> 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 Thu, Jun 07, 2018 at 02:40:25PM +0530, Viresh Kumar wrote: > On 07-06-18, 11:03, Bernd Petrovitsch wrote: > > On Thu, 2018-06-07 at 14:08 +0530, Viresh Kumar wrote: > > > On 07-06-18, 15:46, Du, Changbin wrote: > > > > I think if the destination is not a null terminated string (If I understand your > > > > description below), memcpy can be used to get rid of such warning. The warning > > > > makes sense in general as explained in mannual. Thanks! > > > > > > The destination should be a null terminated string eventually, but we first need > > > to make sure src is a null terminated string. > > > > Is there strnlen() or memchr() in the kernel? > > Then check the source before copying it. > > It would be extra work, but memchr can be used to work around this I believe. > > @Johan ?? If you want to work around the warning and think you can do it in some non-contrived way, then go for it. Clearing the request buffer, checking for termination using strnlen, and then using memcpy might not be too bad. But after all, it is a false positive, so leaving things as they stand is fine too. Thanks, Johan