Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14026543pxu; Mon, 4 Jan 2021 10:49:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyasLqaggnHtaXypgFPGFTmP3dgdExXGrxWR1RYFoOh3u99uFab8mw4nyblJHDIKZAx/pXI X-Received: by 2002:a17:906:8151:: with SMTP id z17mr68657146ejw.48.1609786159781; Mon, 04 Jan 2021 10:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609786159; cv=none; d=google.com; s=arc-20160816; b=b+3XCthnaO0e1WQ5KnkbIwCu6jVdez59C21UeCM3f7TskZcFKJ1cIAAZaDVSl6XOg3 L/rZXMPwMWgzfLQWl1pWo24sfUxf+FwNxFrEbqk7Nxwyf9D321UgH9lnpOESh8ZQB88w cRxjSwFFJ6gg4NYMC1zneRBNDGUonaU2VmLGvmM1VJI7QhiJE9MZAccDlCo7LtYsT9QL 6CCR+fbv249Jyhyge+J8Od+dMP7LsM9R+StobPG3jwebrC+tY6MZ2BgfaRZIznBOOsMs WGjOYAxVMH71wRtv3KZbxIygPG/P7R31WjqZ1KjaSfKnXvbhcvQWc0hIBtKbHBg7Qqwr pO7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YmvW4Q6DWWO7XERZwXDi7sTEzjHDHI29ZxH9utRkJCM=; b=oaRZdKCvu49FJDxoqODaSH0N5cVC+Em9IBvyDdafv4zQnDOb9hMjt2Ao/sXcWqkutS 2W+r7nm+Xu+D9r3TlnFk1jnYhvGDQjeRMBWsS6e3ct2ovGCrJSb1T5Kb+3TP0hIEMS4/ KhoyHXQkvRHll5FvZk7Tmq880RZXZMbVeSP2P2+hahjQ5Idy0WRxf2phqtQaUnMqlLpr pWV6puhiqRajUBN1+vESN1H6ZTik3IdwqeLtRaGxf6EZSyLRgpdhmii16bnuAd9+ubtX bjXUhXzOu5mpgb8xziav91MgFj+OOoMd788u2g70vRYrO79k8RNNdhgKPoiiaqAScc66 TpuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EBM/hk2n"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si32572102edj.73.2021.01.04.10.48.56; Mon, 04 Jan 2021 10:49:19 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EBM/hk2n"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbhADSsN (ORCPT + 99 others); Mon, 4 Jan 2021 13:48:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbhADSsM (ORCPT ); Mon, 4 Jan 2021 13:48:12 -0500 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3528C061574 for ; Mon, 4 Jan 2021 10:47:31 -0800 (PST) Received: by mail-qt1-x82d.google.com with SMTP id u21so19149221qtw.11 for ; Mon, 04 Jan 2021 10:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YmvW4Q6DWWO7XERZwXDi7sTEzjHDHI29ZxH9utRkJCM=; b=EBM/hk2nhQ4J48ezLfFfCkm5dKQxYyzGCrogV5kL9CaYw0D6dAwRhptWoY/kRgoom0 XkG4QOHsneGYnb/mbXdiTggPEN8IVM1huhhH3Vo2H6pQZtqoVsz9+GV3PDKajqXoqXN6 EXNjwlknsRTx4YjbZNoNyV+/SbAdX1ecQayTlmJjUT5LJqPQ01FEt/lhrTKD02iZHG8w /OClIEmkI8RLOZallh8ae5/vqEpAXjFEK/2sW1aCee9hK/a0NIsljaocpiYLN1eBwH5k kBsvEd3HSkXj32Pp7B5Zjkd1p/x5Y9OEiBvCuL6rOv7tQ0MhQSJIY+Ili39RZ+AP1eqy ylAA== 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:in-reply-to; bh=YmvW4Q6DWWO7XERZwXDi7sTEzjHDHI29ZxH9utRkJCM=; b=oX+lFz+YSiPruBeGked3nZvmbZRfTGFOMnRf9JrO4nvxiR34cKmgxLQk/zx/+qxvxi vOVmelRD8MMCL2McrAre72jVacP/MZM9cM521nCtt6OsXCHPkURjv4k4V8pvH085cI7E LoTHOgZIe5zuDOGPrD6eanpwyntVrk+V8fE7z4DpfiI4qQgWZXkLHOIm7lc9RpD6+8cg TqlgQqjjAoP+RFm66w1+JvJyRzl1d/q0qWC73rTRC6jxKTX2C6NDCo7QjNYD2fMbnDDR SYbUvwKWSCnHnBD/rIfSc3q+7Ma+ziLwCxTML2junGdsljhYmoIaRp0FqZHuARzlIgKx wrXw== X-Gm-Message-State: AOAM532TtI1HUWASyEb0/qyWi0ojjK55AFYvEgLtINAgZTZRh2r0na/9 YP8Og5YjHtKVBWlHnl4M18Tc8G6VUfA= X-Received: by 2002:aed:2cc5:: with SMTP id g63mr71971517qtd.327.1609786050961; Mon, 04 Jan 2021 10:47:30 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id q3sm37748990qkb.73.2021.01.04.10.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 10:47:30 -0800 (PST) Date: Mon, 4 Jan 2021 11:47:28 -0700 From: Nathan Chancellor To: kernel test robot Cc: Mordechay Goodstein , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, Luca Coelho Subject: Re: drivers/net/wireless/intel/iwlwifi/queue/tx.c:310:18: warning: result of comparison of constant 262140 with expression of type 'u16' (aka 'unsigned short') is always false Message-ID: <20210104184728.GB243045@ubuntu-m3-large-x86> References: <202101030910.Lehj6xQW-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202101030910.Lehj6xQW-lkp@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 03, 2021 at 09:51:17AM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 3516bd729358a2a9b090c1905bd2a3fa926e24c6 > commit: 0cd1ad2d7fd41e0de4969fd1dd0aa846c99830d1 iwlwifi: move all bus-independent TX functions to common code > date: 3 months ago > config: powerpc-randconfig-r001-20210103 (attached as .config) > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 20670ba44066df0aae536822b7f7834ee3198c0d) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install powerpc cross compiling tool for clang build > # apt-get install binutils-powerpc-linux-gnu > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0cd1ad2d7fd41e0de4969fd1dd0aa846c99830d1 > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > git fetch --no-tags linus master > git checkout 0cd1ad2d7fd41e0de4969fd1dd0aa846c99830d1 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > >> drivers/net/wireless/intel/iwlwifi/queue/tx.c:310:18: warning: result of comparison of constant 262140 with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare] > if (WARN_ON(len > PAGE_SIZE - sizeof(void *))) { > ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/asm-generic/bug.h:188:25: note: expanded from macro 'WARN_ON' > int __ret_warn_on = !!(condition); \ > ^~~~~~~~~ > include/linux/compiler.h:56:47: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > ^~~~ > >> drivers/net/wireless/intel/iwlwifi/queue/tx.c:310:18: warning: result of comparison of constant 262140 with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare] > if (WARN_ON(len > PAGE_SIZE - sizeof(void *))) { > ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/asm-generic/bug.h:188:25: note: expanded from macro 'WARN_ON' > int __ret_warn_on = !!(condition); \ > ^~~~~~~~~ > include/linux/compiler.h:56:47: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > ~~~~~~~~~~~~~~~~~^~~~~ > include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' > (cond) ? \ > ^~~~ > 2 warnings generated. This warning happens due to PAGE_SIZE being 256K, which is larger than u16. $ rg "PPC_256K_PAGES|PPC_PAGE_SHIFT" .config CONFIG_PPC_256K_PAGES=y CONFIG_PPC_PAGE_SHIFT=18 On most configurations, which will use 64K or less, this check is valid. I am not sure how it should be dealt with, aside from increasing len to u32. Cheers, Nathan