Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2896582ybi; Mon, 10 Jun 2019 00:08:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwOSjVgYgpf8q/6nswFdkRef9Q4rYeFM72UhNmZrLmRtJpb3TIFDCSYUdclf7VNzhM2hCS X-Received: by 2002:aa7:8d8c:: with SMTP id i12mr45526906pfr.200.1560150487297; Mon, 10 Jun 2019 00:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560150487; cv=none; d=google.com; s=arc-20160816; b=pvY/OjZwjllIhQlQHJ4IwV8x0vwzc+SDmRmZYdxg+1KJrPomdBZ607oaBN1VhNADAB 4RD4Gg5OeK9W68I5L1DVraQ5eG2AJ5lbrkdsKQbMoQnhlTTKnzZwE0OUapM8Y0M0v+L/ LJfg4v8lWC5agdFGchCB+MH5iEb6fBaSEuSFIoe3859oHMndCfUaODkWPmjLL7ZnwE8Q 76wlKyNzp/5NJTZ1RdlWjVchpHN9bJl3OMGzlD2bK//UefmisEvWCWh3FSFHI+M8+ltR gBExWlBQIehogjGrbwnsxMiQkjAZ39J5YzxQr8a8vVkEXk1UoqFsLOrcObaHzLj0cIw0 HcaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dmarc-filter:dkim-signature:dkim-signature; bh=HRbuweLdkzdk2E8ppsWhIHki4utvvfC++MZjsWM2qvM=; b=vbjRRU4AbsVW6Zzp/WlxYM50+kiOeWQBOEEhlvHaate4apioSr0CIkRHbVg1MZVa16 e6gXzj3x86UQQaNlvvQ+VfTZjPBZbCRk3WWh1DyDby9A75D0EyriofJJXjV8P2SJWw0U W1NrdpoCey8/dXOTNz3hTKM24dYfREv43ZQciGX/VfpQH7sL8uPQlexwG0xh5xD6W2st k3ApFCk4/2HweF7U2H/aLTGkLkiI9W4HmRRBpgjq5avAlIThMGxhQ893nosE8CSoa2EP cFFw0N4caQftnun+mI3BONLxJA3APktNTbTdceyHird1JrmbzD6CflSn8DKXWglJ+0Q4 fzVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=f1g8KDUr; dkim=pass header.i=@codeaurora.org header.s=default header.b=pGo1uPnv; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si9355856pgh.273.2019.06.10.00.07.51; Mon, 10 Jun 2019 00:08:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=f1g8KDUr; dkim=pass header.i=@codeaurora.org header.s=default header.b=pGo1uPnv; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387820AbfFJHGe (ORCPT + 99 others); Mon, 10 Jun 2019 03:06:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36480 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387614AbfFJHGe (ORCPT ); Mon, 10 Jun 2019 03:06:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0E03460734; Mon, 10 Jun 2019 07:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560150394; bh=zFMMXppuJQIvBzZR76Pbx9mhI24KZFTafp86Ids2NrM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=f1g8KDUrw2ppMMsA3drFFSbicyfKA9N/q957uhsUV7KgEDS4OSlQCQ+zDaKbqtaVX CjxBwa7Kqo2eguPTJIKjN34ZYVWkymyEYpxqRYs1RC6A+1Q0JgJ0VZXsZ0kFwXRy23 iPMzIj3scSwbJKNFsslOGjELPdWnX/UBvHm4wsOY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from x230.qca.qualcomm.com (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E7FCC60716; Mon, 10 Jun 2019 07:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560150393; bh=zFMMXppuJQIvBzZR76Pbx9mhI24KZFTafp86Ids2NrM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=pGo1uPnvbvz5cQhYrgzAFIs2fdoRbpbMqNZ6jr3s10o0a/eY/9SrykUdcQelHih4v iFF9pmI7Jmec0jL5E0/uWS/bH9X62QH+4CIV+0aPehGeCBknu16+2FttF4DUSnolRX iwp7QBsT05G+1e7EyPV8bIQWdEtNfpblMGzGw9Fs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E7FCC60716 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Christian Lamparter Cc: linux-wireless@vger.kernel.org Subject: Re: [PATCH] carl9170: fix enum compare splat References: <20190608144947.744-1-chunkeey@gmail.com> Date: Mon, 10 Jun 2019 10:06:30 +0300 In-Reply-To: <20190608144947.744-1-chunkeey@gmail.com> (Christian Lamparter's message of "Sat, 8 Jun 2019 16:49:45 +0200") Message-ID: <87pnnlncll.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Christian Lamparter writes: > This patch fixes a noisy warning triggered by -Wenum-compare > > |main.c:1390:31: warning: comparison between =E2=80=98enum nl80211_ac=E2= =80=99 > | and =E2=80=98enum ar9170_txq=E2=80=99 [-Wenum-compare] > | BUILD_BUG_ON(NL80211_NUM_ACS > __AR9170_NUM_TXQ); > | ^ > | [...] > > This is a little bit unfortunate, since the number of queues > (hence NL80211_NUM_ACS) is a constant based on the IEEE 802.11 > (much like IEEE80211_NUM_ACS) and __AR9170_NUM_TXQ is more or > less defined by the AR9170 hardware. Is the warning enabled by default? TBH I'm not seeing how useful this warning is for kernel development. > --- a/drivers/net/wireless/ath/carl9170/main.c > +++ b/drivers/net/wireless/ath/carl9170/main.c > @@ -1387,7 +1387,7 @@ static int carl9170_op_conf_tx(struct ieee80211_hw = *hw, > int ret; >=20=20 > BUILD_BUG_ON(ARRAY_SIZE(ar9170_qmap) !=3D __AR9170_NUM_TXQ); > - BUILD_BUG_ON(NL80211_NUM_ACS > __AR9170_NUM_TXQ); > + BUILD_BUG_ON((size_t)NL80211_NUM_ACS > (size_t)__AR9170_NUM_TXQ); IMHO this just makes the code worse. Does it make sense to workaround (stupid) compiler warnings like this? --=20 Kalle Valo