Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp717790ybt; Fri, 26 Jun 2020 09:51:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5MIjKpgmoydPfIgAfcOjt+aww8/4rCB3pIsw+Gz2Ykp5Tjc1WaiBjq0BH9OsjiK2Ehery X-Received: by 2002:a05:6402:22f0:: with SMTP id dn16mr4307874edb.83.1593190295610; Fri, 26 Jun 2020 09:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593190295; cv=none; d=google.com; s=arc-20160816; b=VXR+vSVzYZAB5R+08Q2wb+YV39kex81WzhniRV9vWImsskNVFouKPcPTJMkPG9wfSt FrMh8q3nuHVHm2LT49AJu/dmn3vZGoASfDX6vErN/6mB2sOaW9zyyy/l/hgYeZa1r8Y8 q85eki4wRSE0C6aA4tPRnoIKki2uKbeSCaDaxgUfjOMbQoyX/QfNMVuH+ogJ8QmQoi7z Co7dHbuNUO4iRHgLaKzLHYLI14kNvzaAbrbtNbL2Hcqt9OL5/dQgLSLFmGu1EWvKC93T TyfYIMYcZ/XF1YygJKNwgNFzU3rtu+VWusZrneNoszsjOkQOQuugzuZsTJlj9mjEaNv9 QmQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SGbBcZmi7JWYkcmSuZuMkDkOvcG69EpOPP88SAzNvdw=; b=NCHJG/f/a1llwKKEXfykOkwzA6OeFqSZHmb3qeN8Dklyd5LFIo7bDsyRTu6pGBycXx tBGA5vvQaleJ9tqFGgHQWwYAGsjzYUH/qw4DttZtUfT8SyQilh6Qrtx2vyPrWmS/os9I X8p4s15ccEh4m2h+WzyppSqEyqX0jTmrvAnRmmeMZ27hXZY/skyT/aK7wS+FUWJu/bLu Z570xZ/JjHjyMylSmD/3StZnWMp5OxrKxkn+r+zZWm+MhrB+/fzakyUOTfNiQeos1qBl Nccp0NwO2F283vlgIR2EaSMbxeGbX836XEmH+xqE6cHZHohS8bSERbEefTf7QHt9jWzg ZKpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OV2MEBsV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si10643859edb.399.2020.06.26.09.51.13; Fri, 26 Jun 2020 09:51:35 -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; dkim=pass header.i=@chromium.org header.s=google header.b=OV2MEBsV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726630AbgFZP0e (ORCPT + 99 others); Fri, 26 Jun 2020 11:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbgFZP0d (ORCPT ); Fri, 26 Jun 2020 11:26:33 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 732BEC03E979 for ; Fri, 26 Jun 2020 08:26:33 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id l63so5072928pge.12 for ; Fri, 26 Jun 2020 08:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=SGbBcZmi7JWYkcmSuZuMkDkOvcG69EpOPP88SAzNvdw=; b=OV2MEBsVbbgFRgkfsg3gKcIyAxzhOi9e+yhzWHyd2zWOkn+XiOwkOJNz/2sSZiG2kh W3cMGtcu+UuLnsjvQFu1OYF2TJKX8Ziw751JowQOGuMZM8+sq8293ctqbMzYo9oiPBpd GQ7RVsECGWGMaD7YzKmvcbZr6A5ALg98qHxhQ= 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:content-transfer-encoding :in-reply-to; bh=SGbBcZmi7JWYkcmSuZuMkDkOvcG69EpOPP88SAzNvdw=; b=d1+ttXqrqK4VRlcylDCei2F54U/1ncBIj+6KLT/gsSZ+tRgN45NMcF3/2jSZEYNgPa xsdHb6pjoCf+JPUu6IxkpLKmCwKIHtHP2QIvhfj+y4PJIelSCsbZgovvIqd5ZC38RcAw JUHH3pPxzdL2hiOLkWfQXBBkKWXBItJO0Je3mjJDvxeoAteVpPy3JBcaRNKR0LegBuhI FGrw6JPt9zmIbmeaVCym/w8AcxBAge2zYeKS+nvvQXNTcJfJQ7tHxfa15ngp9jAB5zZB k3HPDtZeImrv5wLCs8vhnc0IUvrJt/Kfoq6UAW2XEovKqncpycTmsendZKaoLZEJDrtt 8T6A== X-Gm-Message-State: AOAM532gtLl2VVwpcfPianIhbXSU/Cfhvdz2MrJwvZj5hQNyKedI/zjQ kWZk5V6a61ofLpTZ3v1hqrh3jw== X-Received: by 2002:a63:5013:: with SMTP id e19mr3254551pgb.68.1593185193063; Fri, 26 Jun 2020 08:26:33 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h17sm21791916pgv.41.2020.06.26.08.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 08:26:32 -0700 (PDT) Date: Fri, 26 Jun 2020 08:26:31 -0700 From: Kees Cook To: Lee Jones Cc: arnd@arndb.de, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/10] misc: lkdtm: bugs: At least try to use popuated variable Message-ID: <202006260825.F530851198@keescook> References: <20200626130525.389469-1-lee.jones@linaro.org> <20200626130525.389469-5-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200626130525.389469-5-lee.jones@linaro.org> 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 02:05:19PM +0100, 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 Ah yeah, this looks like a reasonable way to deal with it. Thanks! Acked-by: Kees Cook -- Kees Cook