Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1801895pxb; Sun, 31 Oct 2021 00:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR4LI1RiOLrn6J3PAjVdosKT3JvjRSg7heuFTNHgwjYLLuD8kiOHy9ul9vZ2OV6fwaaaMH X-Received: by 2002:a05:6e02:1283:: with SMTP id y3mr14785165ilq.226.1635665486074; Sun, 31 Oct 2021 00:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635665486; cv=none; d=google.com; s=arc-20160816; b=LGdtwQtBSP3ry0Rboo1tStpTEJC5N6fwdq2xi1PUFeIU3Pa2nzp7ijUTVRzryDLADl BScFYfP8HPoaLPlBI26FJfAqwQ2sCFjpPLU2ElYZEz5wanhNLNU3D0bzVo+FslnIO0RJ GHJBepPKIvNTDZV4s1bRnR4AGTr9s3WJy/pm3f09A16hV+DMuTW8d8FuULxNJaNHG12t x3bL1scpHdEFTZ1ZQd9AWGgk4Kz/SHyQTjGKnXOUkbv759UYnQbypzA3SS98Hzqm6ARl flUQY4AiB6/kJT9dKN8gRUqk+cg+FN+VA9LlUjl3c1BTiLmRs/vGdnTEexJ2ekQX9L37 t0Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=7ckvcDMeC7GDOMMzohJOy6GujWaqizd0Yp409GD+ucs=; b=LsYZUZWLySDDgy01MlEqQptJxFCpP+nRD/yPFYp9Mzo9klMetDEMnsp0BkC3aO8XlI bufsROPJSDtALRHhm8xD5vp+4c9o6QlnArtaQh5tWE4QIWBqnZMavu9Eg9+al3hCm2sy 1oK6t6sItkW5LdyW6NjvvwRNmGdy7v+F9H7F24EHC03WY1o2/Ahe0eEe8+dscnbL/Rco ue/X08qOOXB3YQ/kXToDC42Ee1WqY6Y8gxqATUKaCit3KRIO2R3Ej8wxVUj6/Y+R9aBw cI7I5Kfgv20IpO30gg8r8FuxtYM2iKjueJHtWNQa4EdUlWq86s3j4SBFLsArd9Ia9Col kwAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=EHyZlfRu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si10776590jaf.24.2021.10.31.00.30.54; Sun, 31 Oct 2021 00:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=EHyZlfRu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbhJaHJW (ORCPT + 65 others); Sun, 31 Oct 2021 03:09:22 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:38816 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbhJaHJW (ORCPT ); Sun, 31 Oct 2021 03:09:22 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1635664011; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=7ckvcDMeC7GDOMMzohJOy6GujWaqizd0Yp409GD+ucs=; b=EHyZlfRuMOAiL6tJnstyHuyVuGFGx4dknM0P55ZiI6l9X53B7efFQnTBX7vXxiF4Yd4gnMMy Qi5OD+GIjBhjGJ95SuIcdmzTzmU/b5o+HwOKzOOzUKFoJs/4k0u4oPfoueZEsEsLycEgEuEb Xm3IPQLfYOkWeGFvJO1+YOuwZ8U= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 617e407bf6a3eeacf913aeb1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 31 Oct 2021 07:06:35 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 78977C4361A; Sun, 31 Oct 2021 07:06:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from tykki (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 69394C4338F; Sun, 31 Oct 2021 07:06:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 69394C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Kalle Valo To: Arnd Bergmann Cc: Johannes Berg , Arnd Bergmann , Luca Coelho , "David S. Miller" , Jakub Kicinski , Nathan Chancellor , Nick Desaulniers , Yaara Baruch , Matti Gottlieb , Emmanuel Grumbach , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] iwlwifi: pcie: fix constant-conversion warning References: <20211029154253.3824677-1-arnd@kernel.org> Date: Sun, 31 Oct 2021 09:06:28 +0200 In-Reply-To: <20211029154253.3824677-1-arnd@kernel.org> (Arnd Bergmann's message of "Fri, 29 Oct 2021 17:42:29 +0200") Message-ID: <87tugx3c7f.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Arnd Bergmann writes: > From: Arnd Bergmann > > clang points out a potential issue with integer overflow when > the iwl_dev_info_table[] array is empty: > > drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1344:42: error: implicit conversion from 'unsigned long' to 'int' changes value from 18446744073709551615 to -1 [-Werror,-Wconstant-conversion] > for (i = ARRAY_SIZE(iwl_dev_info_table) - 1; i >= 0; i--) { > ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ > > This is still harmless, as the loop correctly terminates, but adding > an (int) cast makes that clearer to the compiler. > > Fixes: 3f7320428fa4 ("iwlwifi: pcie: simplify iwl_pci_find_dev_info()") > Signed-off-by: Arnd Bergmann Luca, can I take this to wireless-drivers? Ack? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches