Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1304667rdb; Wed, 20 Sep 2023 05:48:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsVmWbRBKS5rBWYP610NbkHI8gkK3iXWpF6abI9A8/QmANnfN/6c+ci4jDlump/PuIMczr X-Received: by 2002:a05:6358:6f88:b0:132:d42f:8e19 with SMTP id s8-20020a0563586f8800b00132d42f8e19mr2013846rwn.31.1695214092718; Wed, 20 Sep 2023 05:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695214092; cv=none; d=google.com; s=arc-20160816; b=n0263v+mZMoEUeqpkwoQsYDQus27cOAkVc/1mGiHGvZavA5X2/UsGeuo0aPSifG2B+ nG+phDP2RQ87pdmhZU5A2pzWYTaUXd4tEXFG9vCumAmJ4kzaPUnSUBh70sZVmFoTzak3 3RZON0LQ9/eun90TVFPD38do/vMsZC2e/qWYLmfq8TWUBrHMB7KUTINmyHlQko29noVv NevCCzeGghnEaHAq2VutE2rpEco5MH5nIEF38y+X5MGrUSj8oAH7PDi8L+XUH9NXR8XI R1O5Hh8A4unRJl+iu9aYe9pbrSVNIgavnr957iggTjqDTTwIwTrPUks48M+1MbXefeNU Dk2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YvBmZehN7LRMHeiGjeZdDltqHjTudcDHu6fWY+1jUJQ=; fh=lrQnsgXnFWCuBpQ6rBMHPWs3lvhAVBADYNga6p1TX28=; b=eJ35nlTjKO6sJJtfd+zAqwJyRJ6dpfRluCG/FBQwQpo2gH6fY8Hc6inWo8iqNljnKU CuuGfgFSMtl4/WC3o7TVdKlwMQedhUbusMmFqQRywx+KQw+ljmbwtsSa16L1cWeNMn5w 6FL03rG0/jd7G/CITGfPgyHkY3dqipk+bZxmdC+d7e3Mc8W9eiKGC917XBSgB+fA3izJ jTcIyiD+9RfwspOKoFT01th2r6YkrycljZjH89QSvsPPl3c4aTXl7JTqMEODFA4fc2pH HZZn3qmRs+fZMJrf3LdMMNRx29KwSSbwxAHAzzFWn4b7gLgHO3/hEh+XCSUifYI2/yqM ukEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I3Pbc8dc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ca20-20020a056a02069400b0055be9526b7fsi12844781pgb.416.2023.09.20.05.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:48:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I3Pbc8dc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4445A80E5BB4; Wed, 20 Sep 2023 05:44:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236311AbjITMo2 (ORCPT + 99 others); Wed, 20 Sep 2023 08:44:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236307AbjITMoZ (ORCPT ); Wed, 20 Sep 2023 08:44:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22E9BA3 for ; Wed, 20 Sep 2023 05:44:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B56C6C433D9 for ; Wed, 20 Sep 2023 12:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695213858; bh=DNP01UwTuQl84B18wxyvg7e1mHU+Em/d03QG0jjIjZQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=I3Pbc8dc1/5G32DHXqsmBql8KwhiA4V3jzioXwi1uNekS2KnQ2hEVmmR3r2NeWKxw LtjOGrvn9n1PUzW2qD3SVC/bMuNt5l2EfhrTnVdAvbKM5CWKwKwj7e64z51e1LCL89 YqU+TAkQ2LrnysAUseWW7aCeNTmAtpF5MsyN+k/O2Z0mOkp3IVt6Dzar/3lwHUDvQq 7+oGILq6V2pQELpcF+snK/3kEJODhM9NA7PREVwXoESau2WmbOaxd+UlW07fbHswWn /wkL6J1Gu9CRGw/GRZEz88BJjk7DNNEL384R3YRUxXyMEz2aBmDms+a8nY3vqyqzeX /Slhhrb9hL7GA== Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50300cb4776so7363263e87.3 for ; Wed, 20 Sep 2023 05:44:18 -0700 (PDT) X-Gm-Message-State: AOJu0Yx9A+sMsogfZuLyAWwfSBtiJa0xGV38pXuM3PKIXfotx+UEKlil A2KpVc7deBQrHDBl2IFFltNft4zPgEB3s02Y9g== X-Received: by 2002:a19:ca52:0:b0:503:3862:5ecf with SMTP id h18-20020a19ca52000000b0050338625ecfmr1829927lfj.61.1695213856823; Wed, 20 Sep 2023 05:44:16 -0700 (PDT) MIME-Version: 1.0 References: <202309192013.vI4DKHmw-lkp@intel.com> In-Reply-To: From: Rob Herring Date: Wed, 20 Sep 2023 07:44:04 -0500 X-Gmail-Original-Message-ID: Message-ID: 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: Guenter Roeck Cc: kernel test robot , Geert Uytterhoeven , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Wim Van Sebroeck Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 05:44:28 -0700 (PDT) On Tue, Sep 19, 2023 at 6:14=E2=80=AFPM Guenter Roeck = wrote: > > On 9/19/23 11:37, Rob Herring wrote: > > On Tue, Sep 19, 2023 at 7:09=E2=80=AFAM kernel test robot wrote: > >> > >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux= .git master > >> head: 2cf0f715623872823a72e451243bbf555d10d032 > >> commit: f1a43aadb5a690e141a3b6700e2a40c1d4dbe088 watchdog: Enable COMP= ILE_TEST for more drivers > >> date: 5 weeks ago > >> config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/202= 30919/202309192013.vI4DKHmw-lkp@intel.com/config) > >> compiler: m68k-linux-gcc (GCC) 13.2.0 > >> reproduce (this is a W=3D1 build): (https://download.01.org/0day-ci/ar= chive/20230919/202309192013.vI4DKHmw-lkp@intel.com/reproduce) > >> > >> If you fix the issue in a separate patch/commit (i.e. not just a new v= ersion 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=3D] > >> 91 | __w =3D ((*(__force volatile u16 *) ((_addr & 0xFF= FF0000UL) + ((__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 'out= w' > >> 74 | #define zf_writew(port, data) { outb(port, INDEX); outw(d= ata, 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=3Dn, CONFIG_AMIGA_PCMCIA=3Dn, and > > CONFIG_ATARI_ROM_ISA=3Dn would have a fixed NULL value and could trigge= r > > 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=3D99578 > > 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). Rob