Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6524799imm; Wed, 27 Jun 2018 08:59:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJduLMT7+KDBo42EzPpcpmMfR1ihhJ8G2IOFZZXpVG9pznJtqlUEwDkVZTIizwMZpl9+YCH X-Received: by 2002:a63:9543:: with SMTP id t3-v6mr5597801pgn.77.1530115169063; Wed, 27 Jun 2018 08:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530115169; cv=none; d=google.com; s=arc-20160816; b=u5ClSs+76yM6I0cgXHyRf8jHqvauKbN9Rmwj8oXCixkhgx+I9l+Z+dHJETcYyZg8pQ AZSDFkYQq45GNtIDpNj1GuX/WpxMZZXMu+3lvSnzcaDPNhI1i/ctCaGjiEQFRHLP9h6h duzVsDLp9m94lO0udR7Me8cnMKNf1fR2i4/tMCYHNqPCPLQCJXI3FpGrkBKei44fClE4 DI7P2ylEYb2HXX+9lX4Gbs/lFlQsuW/cRwRSFLfUeXGEECjAxszspKUlAEZcuE0sBguO xvX7eO3QqWUEGwnTUkRd5wKcIM5uPGfyFINThaYvbmgVjjqH3D4txhAett7eYWtn33Dn rrMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:user-agent:cc:to :references:in-reply-to:from:subject:content-transfer-encoding :mime-version:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=ynbGvFXdPjfgxzkbYXv1VQ4KLOHaMTBsoPDNAPU9e+s=; b=snzKjTDi5iyz7B4R25Z0O+HprM4NXCHqE57NhBGNu9z5Knmd4GYcbftaspENGSGwv1 3CR3ac1nqhqyvGro3O2AbkwLcp/whGUG/p2h/kjuXdtil2SrDB4r4hnf34cjFvPuS6c2 5/GUaAAy1bU/MkttzIoQq0oig6AkQG5UGcalDBIK2FN4gHV6N7/M13n3jZIMTJ2jUMGh zzvpsavzRKuBuaunbfV4XA5g9eBKiUr3YD9++csTrie1VM0yyLjrg7xSgReOzMtlQ+T9 x+ikT/xfvjroSQF6kVh0R+4Ra8suOkpCJt5cUMf3bPaZMdeSAxsZ7WP+BYt6Qz/TpGyc yl8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=fwFlNYhu; dkim=pass header.i=@codeaurora.org header.s=default header.b=XKNANbZZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 n123-v6si1945853pfn.9.2018.06.27.08.59.14; Wed, 27 Jun 2018 08:59:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=fwFlNYhu; dkim=pass header.i=@codeaurora.org header.s=default header.b=XKNANbZZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965630AbeF0P5J (ORCPT + 99 others); Wed, 27 Jun 2018 11:57:09 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45060 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbeF0P5H (ORCPT ); Wed, 27 Jun 2018 11:57:07 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 176F660714; Wed, 27 Jun 2018 15:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530115027; bh=oMJwxi6PKV5GiWdhT0ML92/lIKg+OcSF1ciJ/p5y9p4=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=fwFlNYhu5zE2okUTLuiDgl6qLqHynAbsxlXH5JAVaUilQUFjRph4eibbJt1rPKQe/ ZKQ1kHCJ5L6DJg+c+2RBne+4A36i2anikfJ7V79klm5pEagTjcLwsIoDKwGssreAJJ 3g/Z4fpvlvUQOkhfcg8jb/eCaVixWPJiXVUHNL/Y= 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=-0.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,MISSING_DATE,MISSING_MID,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-52.elisa-laajakaista.fi [88.114.240.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9F201601EA; Wed, 27 Jun 2018 15:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530115026; bh=oMJwxi6PKV5GiWdhT0ML92/lIKg+OcSF1ciJ/p5y9p4=; h=Subject:From:In-Reply-To:References:To:Cc:From; b=XKNANbZZR5+V3eMI6iLQrnDuzJRVi1GIN/w4WfAHd4KV3Go9qn6OmIjBAGXgY2nMf VMYRIa/F8cyxz9xB67cfS4iWumqr+y5C9Y5JW2fM4vqroWgRKwjmGpe+mTqDsjDTm9 qi3JkQvRxVHhQp/V3kCc1TX9XrXZn3BKNZbpwJiE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9F201601EA 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 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: brcmsmac: fix wrap around in conversion from constant to s16 From: Kalle Valo In-Reply-To: <20180617103407.27819-1-stefan@agner.ch> References: <20180617103407.27819-1-stefan@agner.ch> To: Stefan Agner Cc: Stefan Agner , Tobias Regnery , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , "David S. Miller" , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20180627155707.176F660714@smtp.codeaurora.org> Date: Wed, 27 Jun 2018 15:57:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stefan Agner wrote: > The last value in the log_table wraps around to a negative value > since s16 has a value range of -32768 to 32767. This is not what > the table intends to represent. Use the closest positive value > 32767. > > This fixes a warning seen with clang: > drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c:216:2: warning: > implicit conversion from 'int' to 's16' (aka 'short') changes > value from 32768 > to -32768 [-Wconstant-conversion] > 32768 > ^~~~~ > 1 warning generated. > > Fixes: 4c0bfeaae9f9 ("brcmsmac: fix array out-of-bounds access in qm_log10") > Cc: Tobias Regnery > Signed-off-by: Stefan Agner Patch applied to wireless-drivers-next.git, thanks. c9a61469fc97 brcmsmac: fix wrap around in conversion from constant to s16 -- https://patchwork.kernel.org/patch/10468755/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches