Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2282037pxa; Mon, 17 Aug 2020 06:03:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzalKbNTRdqav1MvL3sT087BjovDBxX30+TYYiWum+F2+wbEoIei9V26nARx2x0OHbYe9ae X-Received: by 2002:a17:906:aed0:: with SMTP id me16mr14814897ejb.288.1597669417634; Mon, 17 Aug 2020 06:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597669417; cv=none; d=google.com; s=arc-20160816; b=ghVgRZjxf5k6aglUVYCEC//Hexk5O1JYHV+St9V6gOjqDyaaqTpwnsHqO9jDBOeDR+ t38F6iNZT4vx59TkSWOvbY0W9Ob18fspfC0nvLrbbyE+PQEZCZBnPlujaABp4ADctQu1 porvU/mndsMfA6Ue6umQNyZiDtrvTHJ/PvGex6lr0LXKsvXOMW9/E2h8oA3oOSVJXxOC zuKIGTxx2lskag83Cap9aiWBrnDW9OViOsvKFCXDfLzaYZOWr/LP0AjzZThOR5L0PMUU ngQIp6E0lzIwbDlHf8oIrKfbJvvQhD65aMRfqTKkknwsDcUu+T3DjyqpdQEVwU5QWtK9 VBdg== 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; bh=EPNl9HJgep9wWTGfsP2AiKKlUSHnaYCKHEIDUjeMiqk=; b=meSlAEQy8AwO8nH1mZeVTtsoYermEYX5mFHzl8KAKE2fvIYjyo2I5XIX+9rRbHYzB8 O0twRkVLX3mFN3a4BIMPEvi25TRsyZ57J2aWjdEa1j111qcbco2/DNutOI6hceJ86AK3 dEDqFo/tBMyJ6gmYPpF2xcAeOjy0aondI0UnwY6hfryb3OWSQlbZ6LrdqQiJuKXul2KE DSDoVmkG25EVYxO3FO8G5T9o13457YyMX95v8V+jmSVv4GWDBdYsKkQ57WWKq97ntb+f B6mQv3dZ7Hoak5gqWSlt13s/J/GoBaMGTAs+/rqK9DH4mA7sJObUUzAviWxC8iXWKbpu IlHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Q5mAjvwJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si10075504ejp.151.2020.08.17.06.03.14; Mon, 17 Aug 2020 06:03:37 -0700 (PDT) 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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Q5mAjvwJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728536AbgHQNAY (ORCPT + 99 others); Mon, 17 Aug 2020 09:00:24 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:29505 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728510AbgHQNAV (ORCPT ); Mon, 17 Aug 2020 09:00:21 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597669220; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=EPNl9HJgep9wWTGfsP2AiKKlUSHnaYCKHEIDUjeMiqk=; b=Q5mAjvwJAbUc6+LTT2pAfaxykAtGxL2/izkokfFFcBmtsbqdrYduE7CNI/VUifCdGMGojggy rESGAG+dAyHaBE2lNvP7pZpKs8ZTIcZp1BmAy5FkfHKXQUSkF5MOBi0ORQizf1p9VERO2d/q BPObLb7rqb1M7rG5fEkTyTs3GwU= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 5f3a7f4aba4c2cd3671651bb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 17 Aug 2020 12:59:54 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 46AF5C4339C; Mon, 17 Aug 2020 12:59:53 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable 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) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3AAF0C433C6; Mon, 17 Aug 2020 12:59:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3AAF0C433C6 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=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Rasmus Villemoes Cc: Christian Lamparter , Lee Jones , davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, Christian Lamparter , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 08/30] net: wireless: ath: carl9170: Mark 'ar9170_qmap' as __maybe_unused References: <20200814113933.1903438-1-lee.jones@linaro.org> <20200814113933.1903438-9-lee.jones@linaro.org> <7ef231f2-e6d3-904f-dc3a-7ef82beda6ef@gmail.com> <9776eb47-6b83-a891-f057-dd34d14ea16e@rasmusvillemoes.dk> Date: Mon, 17 Aug 2020 15:59:47 +0300 In-Reply-To: <9776eb47-6b83-a891-f057-dd34d14ea16e@rasmusvillemoes.dk> (Rasmus Villemoes's message of "Mon, 17 Aug 2020 10:26:16 +0200") Message-ID: <87eeo5mnr0.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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rasmus Villemoes writes: > On 14/08/2020 17.14, Christian Lamparter wrote: >> On 2020-08-14 13:39, Lee Jones wrote: >>> 'ar9170_qmap' is used in some source files which include carl9170.h, >>> but not all of them.=C2=A0 Mark it as __maybe_unused to show that this = is >>> not only okay, it's expected. >>> >>> Fixes the following W=3D1 kernel build warning(s) >>=20 >> Is this W=3D1 really a "must" requirement? I find it strange having >> __maybe_unused in header files as this "suggests" that the >> definition is redundant. > > In this case it seems one could replace the table lookup with a > > static inline u8 ar9170_qmap(u8 idx) { return 3 - idx; } > > gcc doesn't warn about unused static inline functions (or one would have > a million warnings to deal with). Just my $0.02. Yeah, this is much better. And I think that static variables should not even be in the header files. Doesn't it mean that there's a local copy of the variable everytime the .h file is included? Sure, in this case the overhead is small (4 bytes per include) but still it's wrong. Having a static inline function would solve that problem as well the compiler warning. --=20 https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes