Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1157199rdb; Wed, 20 Sep 2023 00:51:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFd4FZa0dEfAzV9aSJCoX2dsEnyQr+yM8HGWOit+nVP69FBwHVSBDjvSlBYj1mFPolkQjeY X-Received: by 2002:a17:903:2351:b0:1c5:69fa:23e9 with SMTP id c17-20020a170903235100b001c569fa23e9mr1984316plh.58.1695196268872; Wed, 20 Sep 2023 00:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695196268; cv=none; d=google.com; s=arc-20160816; b=FEIuQtFONLm/jTwBp3IsVyM3THq5m1n3tODOCxbLdGTIyjRoG6eD6oxL/mIBZ42rJ2 QFB6+q1y2d/meIM+dBl+97TdIcjGo+9KM7+f+Cg7PT14WwISBHoHWSVlRIqQNgooV2ND 8saVG1MadkhN6EQWthiN9BoPP9IjhJkdr60SM6gQoOWv0E0iKPFMXDkr5b+9O+Sq45hY eK8qdJrOosxbr7KYl9GY60L+LoURe4viSg6h3rUiRZ3A9a4XYSPWFazvgNpN1tW9R3Ga 4h3hHxHpz4ejk5Q3akdV7V6cvedgmZGJWGAciWq3Z1YRAH04v3H8VfhW8qHGu24Wwb+T SE9g== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=+0wJC7iUqUi/VsmoECNjzdaGcwsX7nzVBUm4bndTmRU=; fh=kRV2dWV82Mu1cWNt86y4dospHrLCmLlCeRX1HisU0Hc=; b=udbceyVy1DF1lTuHOKAFrdGHra7DfQfttlxmKC/WhVHnskR8hMv/+Rlh4lKSetnbpC MkzVIFu8Ohs54eCdpjRm2RN8NuOC8sZEPDoTLqCh/bQVN38p45LJacybnfEGCcn10mQW eOjTDI+izE8W7GlxN+6TDbvdv0BgZ8dLROrLV20VzjfV1L3gwTFmAcIkDJXv4IOR8OyS 2Fyu1Hk1xCNS9oq+fSQ3Ee5M3e6FhLHx/eavM6kbpT51TGHd2+2Vz75RABnwBima5Ucn uTJ4oL+ZL3vPLb7dcGBj5STeAq9n+XfjSFG+n9crheuFeA0TTRqJtpyFwkgE5U2dPV8T wsxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eWOQDs4L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kq13-20020a170903284d00b001bf1973eafcsi10993803plb.571.2023.09.20.00.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 00:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eWOQDs4L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id B08EA81D2D42; Tue, 19 Sep 2023 16:14:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233061AbjISXOO (ORCPT + 99 others); Tue, 19 Sep 2023 19:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbjISXON (ORCPT ); Tue, 19 Sep 2023 19:14:13 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4089C83 for ; Tue, 19 Sep 2023 16:14:07 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-565e395e7a6so3666102a12.0 for ; Tue, 19 Sep 2023 16:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695165246; x=1695770046; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=+0wJC7iUqUi/VsmoECNjzdaGcwsX7nzVBUm4bndTmRU=; b=eWOQDs4LomUPB0FcB5muSb58t8C1pyTV0QDu8t9WcirlQKBh9rK7X0mNPcEX5+EOmM hm+RPIv4YKJmmpBgFSYmBPbCzVihl/OFIs65LRvXTv2bLdu3Slvj2RDxov5A+RLNAJAW 4JGAVe+K9d4dy4gP7YyFqgcjOei6Z5+Crz78QuRKtH8hYlPPSFIoRfT6bXqnsHiePS85 WDeAqio9dxrSUnrcrG/BVJmZdbRo7PZmYLUOsmGwPNw8EJjSwXeWXFAvtmX6UuhsVfHl yQrzNvXeK+y7UNYWhBTvPYthOo6S5GAtFzn1VrBLFLhH9y4b/znnot0AgTiUxmr8aPny 3ATQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695165246; x=1695770046; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+0wJC7iUqUi/VsmoECNjzdaGcwsX7nzVBUm4bndTmRU=; b=JNtHK3Ik+LwTZqQmlJ4npRIzfPE/Xjt5QoIdcuMRBwxtBNQvj4H6NXolLPsTdrW+q2 TPR4OjuDKj3VJ3lu1HJCTNyQKkVxHoWJG9BVcb+rsAQNfAxFqjHp2fLcXMhH4G60Xt1g O9Re5HnHvLfe0mSkB8gqBb6Yy5qBKrtXWzOstQyy68WLKkIWi3qduWjYaTeIvxGkOgIz UEi1iOOswhxAFCuYn0dSzLdBV1TNfmw4lddrtMav2opJdIEHtNAB7AxHFaHxgWjeCy2J PPajqjcbG5FZaYt+SE/iTFsfHfNmqjixATdT9f8Dy403229WZ/I1oWdw7+i3tt8p8Nka 1gpA== X-Gm-Message-State: AOJu0YzwO+75KAjtT1Dx8ZLb7ET1mnlMBUBedRpxLT9MZFXdFQCxPChC Pf5TnUphuU5/BryIg/Um4so= X-Received: by 2002:a05:6a21:8185:b0:14b:7d8b:cbaf with SMTP id pd5-20020a056a21818500b0014b7d8bcbafmr869151pzb.57.1695165246513; Tue, 19 Sep 2023 16:14:06 -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 y15-20020a17090a1f4f00b00276a0d96a2esm123641pjy.46.2023.09.19.16.14.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 16:14:05 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Tue, 19 Sep 2023 16:14:04 -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[]'} Content-Language: en-US To: Rob Herring , kernel test robot , Geert Uytterhoeven Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Wim Van Sebroeck References: <202309192013.vI4DKHmw-lkp@intel.com> 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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 16:14:12 -0700 (PDT) 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. I do wonder if enabling BUILD_TEST on such drivers is any better. Guenter