Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp980461pxb; Wed, 6 Apr 2022 05:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDbsDvIvyiUdRHKfFyWyB1ZOCQ1ztjoAbtUySAh8FnItRINEuzWK9WoBtoxakYEIEyQKIP X-Received: by 2002:a17:90b:3850:b0:1c6:572e:f39a with SMTP id nl16-20020a17090b385000b001c6572ef39amr9755653pjb.233.1649249868073; Wed, 06 Apr 2022 05:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249868; cv=none; d=google.com; s=arc-20160816; b=fcGJfK5j0FPVXnFyaOv21fD0FOtJeK+G11JuW9e/fQbWS3KmZp2CLJug/K/zmqcv8v iXLZmPZIxqnrypxiexEwSd4vOetBfZG6rT+nJzwXg3oeqN8mz6mKX9O7jio8O/pBtCi9 ZzFfgf6NZxU1wP5VpXF5ndP/lMbJWfhEb1bnuuEBqSnJjF2nmSay3CpPDldDJgjxMLf6 pRUC77REKtWKKil7TZTaum73UPnR8Oy1384MXnedZYz5LyE18LbDWZZ/gBCFc9u6Yg0U vEOWkS1iG7ujC0duTJqHJmgX/c4LqW++STd1qN5pPPZ5KeqiyYy5RDJYsrjcuf1Dsp/a 9HGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=vet1z1lcK7n77jd85VJIqtL0Pw5+IMwHmnMuVfE4gS4=; b=Efd8CeTVE7vTjQ0Wpgr9JzecdkR3qPphmrNqnh+Oq8OnACc06UwjptC6Led/4n59BG z/5GLv4x6v9qmPMAH9tmQ2rLjNFfkjTj5qm7Ze9iHZuMgK7Io96dLbosmw2kiMC5GCgp 3RCwQR519FmvC0WfvsP009zJF5xWX/kdmGLGMKPVdjq+51kab2TDqP72wY/5xYdGFzOW JFUPCm9m1oA9GB/4AoosC1ROQ3tksc4ocwbEosAiJHnRMLM6lFsUDQuiXpgDq5v86m7c dLggTMvaOM1LYgargIi2GgXvDfvdgRnMovJ75VuxpvZI6sZX+Yn2BFzjHnPUW6wTQPQI aqLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uIuEDxP6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r26-20020a63515a000000b003817672f2d4si15252328pgl.316.2022.04.06.05.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:57:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uIuEDxP6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 16CEE571D6C; Wed, 6 Apr 2022 03:07:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1456643AbiDFBXy (ORCPT + 99 others); Tue, 5 Apr 2022 21:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1456964AbiDEQCf (ORCPT ); Tue, 5 Apr 2022 12:02:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CAC8E7F75; Tue, 5 Apr 2022 08:25:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 859BBB81E30; Tue, 5 Apr 2022 15:25:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1782C385A0; Tue, 5 Apr 2022 15:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649172337; bh=+xFbJqvwMJbQSj9nFNnlG1Arjg38F6OzcmwY3dTsFQ4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=uIuEDxP6ZeCDhTVHagvUEbxwEJq2viGhA/Lc3oGsoongfmoEMblsuITW0rw1MIaza Xd8biZfxObEYo1U+FJpjsLVAtadGW4aMg7NTYPwedhQGeIyAQFZvKbRdxwPcpznhWl DLyxV7ipXnY9exHsnUktrYNcD/ZSyekx69EIZ1DT8fayxtwkcy+0XfFf8eyLOYrOKH iw+JK+P5f6vFct8RAkzV5ss9bLnhT8mGEqqHV3hkIlFTawW/z5sEIUllDIsoBjwQPz ol7+B7F1SPT9HffpPgncyq5M1GqVk+3NUjsaFlNjC5wSb9OsiUIMFmBlLTyaAPx8DG 2Scic8xo0aZnw== From: Kalle Valo To: Borislav Petkov Cc: LKML , Arend van Spriel , Franky Lin , Hante Meuleman , "David S. Miller" , Jakub Kicinski , brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH 06/11] brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant References: <20220405151517.29753-1-bp@alien8.de> <20220405151517.29753-7-bp@alien8.de> Date: Tue, 05 Apr 2022 18:25:30 +0300 In-Reply-To: <20220405151517.29753-7-bp@alien8.de> (Borislav Petkov's message of "Tue, 5 Apr 2022 17:15:12 +0200") Message-ID: <87y20jr1qt.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + linux-wireless Borislav Petkov writes: > From: Borislav Petkov > > Fix: > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function = =E2=80=98brcmf_sdio_drivestrengthinit=E2=80=99: > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3798:2: error: = case label does not reduce to an integer constant > case SDIOD_DRVSTR_KEY(BRCM_CC_43143_CHIP_ID, 17): > ^~~~ > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3809:2: error: = case label does not reduce to an integer constant > case SDIOD_DRVSTR_KEY(BRCM_CC_43362_CHIP_ID, 13): > ^~~~ > > See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory > details as to why it triggers with older gccs only. > > Signed-off-by: Borislav Petkov > Cc: Arend van Spriel > Cc: Franky Lin > Cc: Hante Meuleman > Cc: Kalle Valo > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: brcm80211-dev-list.pdl@broadcom.com > Cc: netdev@vger.kernel.org > --- > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/dr= ivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > index ba3c159111d3..d78ccc223709 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > @@ -557,7 +557,7 @@ enum brcmf_sdio_frmtype { > BRCMF_SDIO_FT_SUB, > }; >=20=20 > -#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu)) > +#define SDIOD_DRVSTR_KEY(chip, pmu) (((unsigned int)(chip) << 16) | = (pmu)) Via which tree is this going? I assume not the wireless tree, so: Acked-by: Kalle Valo --=20 https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes