Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1493621rdb; Wed, 20 Sep 2023 10:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVnRLmylYAPAHWvDR9p+wjDjtll18Wiqy/UBMTZtnSHDqmf8xlgvzVe1DujVzccGUWNDdY X-Received: by 2002:a17:90a:f815:b0:26b:6a2f:7d90 with SMTP id ij21-20020a17090af81500b0026b6a2f7d90mr3403107pjb.23.1695231311908; Wed, 20 Sep 2023 10:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695231311; cv=none; d=google.com; s=arc-20160816; b=fi5GClq1kMqXbJRqr8NW3JveOzY9tZoUibRDvkLexwdA6H6mIerf8JJChSUB0A0q0A GiStQtnBToNnE5FwRE/ibNey8am/KHppD/kFmCptzZMtabWHrqbFDh4KqNJfKuYTeFna r1vqzxiV7StGSLUJg4ZtRF5aVuq+lucNyiEpODuGAG1+vLWiAmzNAGuHkl9zsrqTSJid DuzrKE3ePa4W7QTe98zZNQ0jL2JRX7B1QuZ0cZV9Kc0a4czLy9C9iJcQJ7HIbxBmsWNk 3VPCkKXGeXsHW4ME+nQX4TC22IvvBxhof176ZFL1RKFPfVFVM9H4sWdZmuV1/briAIRX TfAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=RLl4qoUlhpaHYAbyJIpQaEfJYSLzVtx1nfy54m+QJkY=; fh=6e0nt42ubJSlbXBBzUJ/dLsTP5EjL6UvcOc6vZ/9n7c=; b=AQD/+uW4gUK7WcHkVCWA6pRszQRV2pptg/VKPt+x3lto/N1IJeHNFjrNbSrEu2/iTX eWX0Fm2/Io6ayeivpL6/5xOpKU1OoqKz9NTJxDdz66Vkewh0zHBVJXHuEGdvvpvB2Wlx Ojr0Z0UDjpME9Xcnt63uCfapwqTAdgsLN+VcnlN3LsSHFOwTF2D8BvxWRikB0YrULGLa aQd/vpspZQjS4l0ShiMLxdgPQV32TcZWTFmrayiV7ri0Jdqm5xOhNK7clCF0bc+rZolB wgAsXnt9sjjUmPMUK/mn9sxYFL643MsTk3Elibk0HGLrhqzpXMohyFdNEa29UduMzevo fmvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GHMIy0Xy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id fh6-20020a17090b034600b0026806ed3fd8si1965825pjb.71.2023.09.20.10.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 10:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GHMIy0Xy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C840880BDE14; Wed, 20 Sep 2023 07:30:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234641AbjITOad (ORCPT + 99 others); Wed, 20 Sep 2023 10:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234577AbjITOac (ORCPT ); Wed, 20 Sep 2023 10:30:32 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2740D3 for ; Wed, 20 Sep 2023 07:30:25 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1c44c0f9138so35889725ad.2 for ; Wed, 20 Sep 2023 07:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695220225; x=1695825025; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=RLl4qoUlhpaHYAbyJIpQaEfJYSLzVtx1nfy54m+QJkY=; b=GHMIy0XyCQHBNzFbQEgwsBToArnILX0AbNjIz2XRE1ET1FcsAmXdMHiE4Ycx71lvjC 1QZy9kmoal7zWZnALXFU4FZzFmHT+/sMlz0rhRL823mwiK5yJtx+WJ+EmvJBd98w8bbs 63GlFaDOpyMaDJrDQymjLniQFxgK5eUpnYM0bPuzQ6pamDvw3UT2w+AxJ3eNWKLzHs0J dgA8JRXiVAJmEH6ip7oJGo+UwT0YZxhsBYEP/GGGRZ0iIbBkA/0zF7h7BQrIgvIuicNt 9TelqVS2UftYjNnGCgmYWYFBo5swqjBd9Qm6PE3rSdY427LZZK80heypSX2oWsMfpDCn Zgzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695220225; x=1695825025; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RLl4qoUlhpaHYAbyJIpQaEfJYSLzVtx1nfy54m+QJkY=; b=Zqh6/wz8LYvE3YiMCMu7uFZXH5cuueu4VPJRsT5eSt5FZ3083xaAWN5mI5V3SfT7Cs rtZgsfWZ0Hc/4qlXKFZr96Ca21Z1Chob63D2VPXaqJHU1igRnml2T7QGj+DGlAmC0dIt q06ED4YnmP7tJobGRv+rNmtuIxErl8Ja64pzWWoyHfAZHTCUjqt6PNyjzzgGO98vgjOu zGVx1ESorl1r75XClAD7208lh4B4G6fXT0unyWI1R3zKPybHUb53ALwThVZWCU0Aj3rw bxh3RcazU0t0457E/RaqIKF9YXqAyc5kv9XBFmp/gZICNcC7s+I8RSIRYWCitJN47CNO RUKw== X-Gm-Message-State: AOJu0YyHgKwjpfjFG5QnHaCCQKk/A8jNVTnZFYo3rVFdKYrDRz3MzKhZ qq5niVKb6lO9OHZr9H6F31BGmTgU2bM= X-Received: by 2002:a17:902:b58d:b0:1c3:ebfc:5198 with SMTP id a13-20020a170902b58d00b001c3ebfc5198mr2326654pls.11.1695220225195; Wed, 20 Sep 2023 07:30:25 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d7-20020a170902cec700b001b89891bfc4sm7950634plg.199.2023.09.20.07.30.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 07:30:24 -0700 (PDT) Sender: Guenter Roeck Message-ID: <194e2d22-9eff-ec6c-9bc9-13b62bda870a@roeck-us.net> Date: Wed, 20 Sep 2023 07:30:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: arch/m68k/include/asm/raw_io.h:91:13: warning: array subscript 0 is outside array bounds of 'volatile u16[0]' {aka 'volatile short unsigned int[]'} To: Rob Herring Cc: kernel test robot , Geert Uytterhoeven , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Wim Van Sebroeck References: <202309192013.vI4DKHmw-lkp@intel.com> Content-Language: en-US From: Guenter Roeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 20 Sep 2023 07:30:37 -0700 (PDT) On 9/20/23 05:44, Rob Herring wrote: > On Tue, Sep 19, 2023 at 6:14 PM Guenter Roeck wrote: >> >> On 9/19/23 11:37, Rob Herring wrote: >>> On Tue, Sep 19, 2023 at 7:09 AM kernel test robot wrote: >>>> >>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>>> head: 2cf0f715623872823a72e451243bbf555d10d032 >>>> commit: f1a43aadb5a690e141a3b6700e2a40c1d4dbe088 watchdog: Enable COMPILE_TEST for more drivers >>>> date: 5 weeks ago >>>> config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230919/202309192013.vI4DKHmw-lkp@intel.com/config) >>>> compiler: m68k-linux-gcc (GCC) 13.2.0 >>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230919/202309192013.vI4DKHmw-lkp@intel.com/reproduce) >>>> >>>> If you fix the issue in a separate patch/commit (i.e. not just a new version of >>>> the same patch/commit), kindly add following tags >>>> | Reported-by: kernel test robot >>>> | Closes: https://lore.kernel.org/oe-kbuild-all/202309192013.vI4DKHmw-lkp@intel.com/ >>>> >>>> All warnings (new ones prefixed by >>): >>>> >>>> In file included from arch/m68k/include/asm/io_mm.h:25, >>>> from arch/m68k/include/asm/io.h:8, >>>> from include/linux/io.h:13, >>>> from drivers/watchdog/machzwd.c:39: >>>> In function 'zf_set_timer', >>>> inlined from 'zf_timer_on' at drivers/watchdog/machzwd.c:218:2: >>>>>> arch/m68k/include/asm/raw_io.h:91:13: warning: array subscript 0 is outside array bounds of 'volatile u16[0]' {aka 'volatile short unsigned int[]'} [-Warray-bounds=] >>>> 91 | __w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v >> 8)<<1)))); \ >>>> | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> arch/m68k/include/asm/io_mm.h:228:20: note: in expansion of macro 'rom_out_le16' >>>> 228 | : rom_out_le16(isa_itw(port), (val))) >>>> | ^~~~~~~~~~~~ >>>> arch/m68k/include/asm/io_mm.h:356:42: note: in expansion of macro 'isa_rom_outw' >>>> 356 | #define outw(val, port) ((port) < 1024 ? isa_rom_outw((val), (port)) : out_le16((port), (val))) >>>> | ^~~~~~~~~~~~ >>>> drivers/watchdog/machzwd.c:74:53: note: in expansion of macro 'outw' >>>> 74 | #define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); } >>>> | ^~~~ >>>> drivers/watchdog/machzwd.c:173:17: note: in expansion of macro 'zf_writew' >>>> 173 | zf_writew(COUNTER_1, new); >>>> | ^~~~~~~~~ >>>> In function 'zf_timer_on': >>>> cc1: note: source object is likely at address zero >>> >>> This seems to be some newish check in gcc which looks for fixed >>> pointers below 4KB[1]. The linked issue says more was planned for >>> gcc-13, but I haven't found what that is. AFAICT, that shouldn't >>> happen with this config because isa_itw() should be variable and the >>> compiler shouldn't be able to determine the value of _addr. However, a >>> config with CONFIG_Q40=n, CONFIG_AMIGA_PCMCIA=n, and >>> CONFIG_ATARI_ROM_ISA=n would have a fixed NULL value and could trigger >>> the warning. This should also have warnings everywhere outw() (and >>> others) are used with a constant port value. >>> >>> Rob >>> >>> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 >> >> A long time ago, when someone submitted a "cleanup: patch for the machzwd >> watchdog driver, I approved it but added this comment. >> >> > If anyone is still using the HW supported by this driver, it would >> > be a prime target for conversion to use the watchdog subsystem. >> > This would reduce code size and improve driver stability. >> > _That_ would be useful. >> >> > The only reason for replacing 0 with NULL is to make a static checker >> > happy. This kind of change adds zero value to the code. Instead, it >> > takes time from those who have to review the patches and apply them. >> >> > If we ignore such patches, we'll get them again and again, taking >> > away even more time. If we don't ignore them, we encourage submitters >> > and get even more useless patches. If we try to discourage them, we >> > risk being accused of being unfriendly. This is a perfect lose-lose >> > situation for maintainers. > > Agreed. I keep getting one to fix "of of" in a comment. The fix is > always to drop an "of", but that's actually wrong because it's > supposed to be "OF". I keep pointing this out and *never* get the > right fix. I don't fix it myself because at this point, I find > continuing to get "fixes" entertaining. > >> I do wonder if enabling BUILD_TEST on such drivers is any better. > > I think that and trivial fixes on a specific driver are completely > different. If you want to test build one driver, that's not too hard. > Find its kconfig value, turn it on and build the right arch. For tree > wide stuff, it's a real pain to ensure you built everything. For > example, the only way to build many Cavium Octeon drivers is with the > Octeon defconfig which is just one of dozens configs for MIPS (which > is still a bigger mess than arm32 ever was). > Sure, but I still argue that this isn't worth it for drivers like this one. Are you going to submit a fix ? Because otherwise I'll submit a patch to drop COMPILE_TEST from MACHZ_WDT. Thanks, Guenter