Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp341391pxb; Thu, 5 Nov 2020 01:12:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzb3nljzRB7T+GNi4mmfolXMi6CTHyS/ZHN5WUky2WO2i/W+E9f1b6IgVGw8atawsCL+e4q X-Received: by 2002:a50:d88c:: with SMTP id p12mr1499174edj.352.1604567577057; Thu, 05 Nov 2020 01:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604567577; cv=none; d=google.com; s=arc-20160816; b=Jqte2Wi19qxJ6ovlfcK9WUflrdtO1zdqHDUZvjb8E/3tQV6cy2O1Ej1MCm1g661cZl Qox0k1N9kHVNZ0VkVfdBX0upN1vubt0935WZ1+/a5K4lhrD4imoiAOllPT5H3QWnKuIu jsb4B5lUf8cGRkHn5A1x+nucPaNzvLRmCjKL3K3dtCynujNUQ2iNmXEv2QBNKe/b9/AR HaI6WKVdyaTLYN+FJxGJtKY0LdjiFiaUf1cKp6Mcs9ZKTJ4uDo6+Pqs7ThcZ7h4eQ5EJ +5EroZh9eW7Fj9dDlJieCtug8p7cNSVGKtmucsRNu26OKBm8l3jBMWy8rCq0iERRnq1K 9Cmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=U3P/LH5Pt4KWyrbq4dAOJCrZy7eh9YgzflCM7hEMp1Y=; b=uvxYRnngBIOk5CZsJwetV+yRm4czDj33WzUcDtj5KrcURomHC7XJszQTLGeioTfu25 YeoMozQwWVmtJrDyS0rp7Ex/ImAe77VPP4pfCX0pN7ZQF36opK7BMYiGsrfvMqCV5ALO T1hp4KbiOPIMsF0UmWNbexFbLV8WSNraTNVOhJVvfBxG/iEcYoyv6am2otwknlVYnfqh ex7UR23CB0JwNV5Q9yXhu9vL+R0pFeBy4tx0vOhcvELFK6GoimBDtbQtDBgrsaIcoIuN OlpJNYTJ7fJ6gkf2zFz/s/Dx8xVRF5DGby84MgmBW0Vks5y/PsHg7WxOHz+HHiB50njc fihg== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si639691ejc.609.2020.11.05.01.12.33; Thu, 05 Nov 2020 01:12:57 -0800 (PST) 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730705AbgKEJKs (ORCPT + 99 others); Thu, 5 Nov 2020 04:10:48 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:33902 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730340AbgKEJKr (ORCPT ); Thu, 5 Nov 2020 04:10:47 -0500 Received: by mail-ed1-f68.google.com with SMTP id a15so751045edy.1 for ; Thu, 05 Nov 2020 01:10:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=U3P/LH5Pt4KWyrbq4dAOJCrZy7eh9YgzflCM7hEMp1Y=; b=AsXwAuHxratbkHWkvrNDVIsKffyIWukx79AReET8zjCd5YLiVPSLtugc+U3wEFMjoh 0M5lBPFWqMNvoeTGYfTl10nd+P055boaCJbc3Mvj02UZXx2+9OYBy9YESxXAkbp2u6mC e2W8zSMh5sJXRCcCk47qEqVQri3FyK7gukfcGAaCNIqx/L1x/tdGD1wwILD0g8GMOI07 QiNG3E8aPe/9WdC/YwQjpxbr1Cp5Cr+VDO58ONFnsDD/glQMkmfN4QlnoIaHuqSSLjW1 OEbJRxabHNV54JHwkq7rjn3cTUtskA3xEaszXs+djRAPx6nNdRpHbAT9sWyY2JopFRhI +GGQ== X-Gm-Message-State: AOAM533MiqfyH0E5U8rlvqQbpABkPXuR5FuJse2bhkBIXXdLKhwldBNI EDE1s2nTwy5wi6IYcZrV9Bw= X-Received: by 2002:aa7:c792:: with SMTP id n18mr1520597eds.209.1604567445267; Thu, 05 Nov 2020 01:10:45 -0800 (PST) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id rl1sm560714ejb.36.2020.11.05.01.10.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Nov 2020 01:10:44 -0800 (PST) Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused To: Lee Jones Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , paulkf@microgate.com References: <20201104193549.4026187-1-lee.jones@linaro.org> <20201104193549.4026187-28-lee.jones@linaro.org> <0a4043ee-dad5-7691-8c67-db73d3c12f52@kernel.org> <20201105084341.GZ4488@dell> From: Jiri Slaby Message-ID: Date: Thu, 5 Nov 2020 10:10:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <20201105084341.GZ4488@dell> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05. 11. 20, 9:43, Lee Jones wrote: > On Thu, 05 Nov 2020, Jiri Slaby wrote: > >> On 04. 11. 20, 20:35, Lee Jones wrote: >>> Fixes the following W=1 kernel build warning(s): >>> >>> drivers/tty/synclinkmp.c: In function ‘init_adapter’: >>> drivers/tty/synclinkmp.c:5167:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable] >>> >>> Cc: Greg Kroah-Hartman >>> Cc: Jiri Slaby >>> Cc: paulkf@microgate.com >>> Signed-off-by: Lee Jones >>> --- >>> drivers/tty/synclinkmp.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c >>> index 0ca738f61a35b..75f494bfdcbed 100644 >>> --- a/drivers/tty/synclinkmp.c >>> +++ b/drivers/tty/synclinkmp.c >>> @@ -5165,7 +5165,7 @@ static bool init_adapter(SLMP_INFO *info) >>> /* Set BIT30 of Local Control Reg 0x50 to reset SCA */ >>> volatile u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50); >>> - u32 readval; >>> + u32 __always_unused readval; >> >> Why not just remove readval completely as in other cases? > > Because I don't know what the result would be. > > Will the read still happen, or will the compiler optimise it away? The compiler will eliminate this dead store anyway. However given the MiscCtrl pointer is volatile, the read proper must remain. > My changes should not affect any of the instructions i.e. the register > read must still take place I understand. But the C specification helps here. >> And the loop can be turned into ndelay: >> >> /* >> * Force at least 170ns delay before clearing >> * reset bit. Each read from LCR takes at least >> * 30ns so 10 times for 300ns to be safe. >> */ >> for(i=0;i<10;i++) >> readval = *MiscCtrl; > > Again, since I can't test this, I do not want this patch to contain > any functional changes. AFAIC, the 10 register reads must still > happen after this patch is applied. OK, let the loop alone. I would bet a half a pig that noone is able to test this driver. But one has to write this for someone to raise and admit they are still using it. In fact, there are _4_ google replies to "Microgate Corporation" "SyncLink Multiport Adapter" "lspci". thanks, -- js suse labs