Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp697700ybt; Fri, 26 Jun 2020 09:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf1Azq2p6IDxw2siMsEm/YS+Hb8DVy3dwN3S5C3t1sLknqrn4+OwCRwjRydoWk7HqWhIr1 X-Received: by 2002:a17:906:87c8:: with SMTP id zb8mr3194717ejb.35.1593188525128; Fri, 26 Jun 2020 09:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593188525; cv=none; d=google.com; s=arc-20160816; b=A7lNK0UQqWvvGDXG8cTWKNfRC5YltPdkzhwyL7jhxAcyRabUNylLpemYK9kAfxIj1Q Co9YpDuABybVxgKJBBQdf8OK8fhXEwVAKAQmOmf1xyxxjhNA9GT2+9x52bNb7ni+F9qK aUtBheI/3P7wOEyE3ad7rmgerDVvcgojB7LLaPefWdezqp2lm/lFofHNwOX9HZKz/2MK ezaSqAKUi9A0YYiIW8oMGzD9o86TwjTK4zQCvXBb1TWXYCO2A0FljKaXcYnHU8Vz0atb pdOWbVl/B58rL5S/O73ZKB0oUYmkLqj6MmTPXXfUm2VeFPkAtzIqiR/Kaz9ubDa6W4Rq D0MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=GIg4/HGk9YtMa2Ox+jlKhf/C4m41shJsqLJmG6ai7gg=; b=kCYBMaCBOZi0cClNmyQ9RqKCppbkEbmGymv4/SlwESd/gRSbIBA7IYodfYKIRuntOG fp9TZ0l3KR9/FHH24uN9bRIdTvuwLZbdgYUzZxAlJb5Rp2nmFYhluDOI+DFVuyRzCu+I 1vaLr2DQFR4WbcK5gQL6eTe6BqGsbc51nQEjeufyDz22aukzGC3GuIm0lxrcBiTWDYd+ G9pGQHuD97LzzWN/5JQZEv25+NZnprZh4P4ldF7aDIvwqE3rFDHTd8AkpB6wpyfOuARs Y2+1uUxNvBKtjpFkwuWIef2R4yGpM9fp1VvZxAku/Rs2Sqxf38KLrIC6l+bFqpB4YRbi qh+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si17859943edj.100.2020.06.26.09.21.41; Fri, 26 Jun 2020 09:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729268AbgFZOhe convert rfc822-to-8bit (ORCPT + 99 others); Fri, 26 Jun 2020 10:37:34 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56689 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbgFZOhe (ORCPT ); Fri, 26 Jun 2020 10:37:34 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1M6pck-1jkzjP0nYU-008KIM for ; Fri, 26 Jun 2020 16:37:33 +0200 Received: by mail-qt1-f180.google.com with SMTP id u17so7626753qtq.1 for ; Fri, 26 Jun 2020 07:37:33 -0700 (PDT) X-Gm-Message-State: AOAM5338gU+9p6ZQY8SifH07OT+E9qsh6LPvnzgaHxaLNruN70LEp5gy Hdrc6qjQSqpLPC6JfaXcpgjlc3jwVlS4xUei04Y= X-Received: by 2002:ac8:33d7:: with SMTP id d23mr3106382qtb.204.1593182252119; Fri, 26 Jun 2020 07:37:32 -0700 (PDT) MIME-Version: 1.0 References: <20200626130525.389469-1-lee.jones@linaro.org> <20200626130525.389469-5-lee.jones@linaro.org> In-Reply-To: <20200626130525.389469-5-lee.jones@linaro.org> From: Arnd Bergmann Date: Fri, 26 Jun 2020 16:37:16 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/10] misc: lkdtm: bugs: At least try to use popuated variable To: Lee Jones Cc: gregkh , Linux ARM , "linux-kernel@vger.kernel.org" , Kees Cook Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:PFi/Ny6C736jO1oUmx+QmhrSiqR7/Pd7UTtfTVz9PjZGTuaBVAg YNoub8uFNBkXpjtFQijQTs4ydb2L5hbQnRttNTKdthQNx/JO9lo+X1V+Yy8aqzMQpgsMotR N5rrTsgUahahVzGrzE+UxOSA7pOcPnf6D+YXuT8sxR9aBINDWYCXStt8FxVsS3RHJrhRhBy xhdd1JDNGQ4xDgTEPzQ4A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:otGEgxTyiWM=:UReDEzGAqFaRBQd2NgEuHM CkWsKyObxsmVxuaTGiLQcJH8I0nryNaWRGREBxnAfXvLIXs6D26rRS1u0RTP6F0zH8wdDL7n8 j03qvoy6pEDXspnANtKmRUFTKfOCN+aLJNHoikVQSLrRZMKRH5gT+SqfFVpEYfiJOOgzgrdGV AZHp9aWj3M1N2JKNE9HaW5jrvlbxDPRN2Qlxb+JBjKpCpymJ1FoeHYOZwXiPhFP0PpWh+GIPH OqQkd+ErinGOdaOe5vXBYzZQzhDwuIrKcNHXLJ5TwgNXA1P3zG3Q3A3dGoTgO152HuI5PJ0+e w2XBg6/ngrMtStX/28M+S0LJCPjBxX62se9YzlPRTYXp+TG2UymIqJ56g9oxTkKwoh7Boemqd JFE80yEgorcHoKKmMaNuNn9YCyclgP5YiGfZKuLeq4cvjYfGA14AoNlPl60Hux+uuaHhXsF62 XE6WCBCCJkT8oaoGr6HrgZNWyL22T/nVVZ3+cWLCs9W8BxelWH9uk8OqRtB82dj1uGQ5ivyaT 2sYVpk9mFCxlOfAhDhGddWBQ7lehs+9ndTtIagiG7JRD02N3tuQtag+N1CS/yBdRWghyeeUJO Ahq5uq1e1RFg5FgpR5u6c0k8naAT5VrBFs27rOfO0D3yPB1crcwnJHE+JezItzThW9yR2D2uZ hGe2zt5HWPv2K8YyHtuuWyNux07VKKfnskXLJZ4U7uxroCmYIxlrczEk/baGtSVbeAaxtsMA5 00BgillhvQOiKqP5J/k81cSGMaiSUKxRoACj4lWwyjUHQnpVCdwTNCPBKe2RpnlLv2vBsiaKG jIs9Zi6xDfxlI48YqDQT39dLAxT2AV/rSM7r0iX+VS+sHXoimU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 3:05 PM Lee Jones wrote: > > The result may not be intereresting, but not using a set variable > is bad form and causes W=1 kernel builds to complain. > > Fixes the following W=1 warning(s): > > drivers/misc/lkdtm/bugs.c: In function ‘lkdtm_STACK_GUARD_PAGE_LEADING’: > drivers/misc/lkdtm/bugs.c:331:25: warning: variable ‘byte’ set but not used [-Wunused-but-set-variable] > 331 | volatile unsigned char byte; > | ^~~~ > drivers/misc/lkdtm/bugs.c: In function ‘lkdtm_STACK_GUARD_PAGE_TRAILING’: > drivers/misc/lkdtm/bugs.c:345:25: warning: variable ‘byte’ set but not used [-Wunused-but-set-variable] > 345 | volatile unsigned char byte; > | ^~~~ > > Cc: Kees Cook > Signed-off-by: Lee Jones I think a clearer way to address this would be to add a cast to void than to actually use the variable. Looking at the implementation, it also seems odd to use a 'const char *' as the source and a 'volatile char' as the destination, I would have expected the opposite (marking the source volatile to force the access), though I suppose the effect is the same. Arnd