Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp917663pxb; Wed, 6 Apr 2022 04:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIXZQKkDDffSuxoPJg5eegpIuulLGPKy677ZVueDc7piOkdnzQ0iZ5bach3oAOVhco2vsM X-Received: by 2002:a17:90a:a4c:b0:1ca:a723:aa76 with SMTP id o70-20020a17090a0a4c00b001caa723aa76mr9306336pjo.101.1649243647719; Wed, 06 Apr 2022 04:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649243647; cv=none; d=google.com; s=arc-20160816; b=U4KBYf8U+MfbRtvMo4zgc3+mVzgyw46+a4wJIB6F+Us8MfmjmCPFCkdLeMIeEdSnAj /mF7lmpHYqWDRt7WjovnFildcH0wJlKfXyhHYPxprFYQFqe7Jrn6eaVZAd/mLsv02iPb GUSnUviJKsIArj1jjCE1U0ZYmYuz+yjrtDKmVMPF3mC07KZKDecGeH2Gybpa8WWfeYDY u7ilB4165z8dXYuaFG5JdF8SvSntLaYlArGPeUpCPfooJi4YYYSH6W/UWCOzssCfrvYW 4laSMB8exBUzGXNhJWP2Ukwj/3OQnhQXpohS7MoeabQUerAAXBeuAGM7sr5YE6CG1pDs J56A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ow4OlxjAImgDNnNTH/q+sIch3Ua5XV+4xbXR3FoPyjQ=; b=qpacJZZO2Gb/9M2O4d4Fpbvnp6v5V4gjhqiZLpP2AkR+PLgBKC6zdpfuDGy5wzxi/e U+G2SDwv/UZxCB+4zjch0A+Wdwit5oaCjJM5kZL2C2YKPNO1w4W9ruZXT/KO+49aQfNA wlUg5oSJQUgjvdl/7VGm422RWJkWiAGrD6OJIvMz25ZnWeYEVaYtFNAe2g73sVXCw4tv wDEW7K/+sRe2NnjzyM2+cyn6ZJt3K+s3NZSlpx12YZIPQ14Yey/8WkJ2Jq4+kf+x+s9F rBzTC85TPyXXXjW2EhF5wvizndh9PssFBtmSFSOzxYaK2X8GJst9x1C9R1XYMQdYK9v6 lD4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=G8n2Txu5; 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=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lr17-20020a17090b4b9100b001c6570bf8cbsi5166656pjb.7.2022.04.06.04.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:14:07 -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=@alien8.de header.s=dkim header.b=G8n2Txu5; 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=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7BD365D7485; Wed, 6 Apr 2022 02:39:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1588194AbiDFAOo (ORCPT + 99 others); Tue, 5 Apr 2022 20:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455492AbiDEQAG (ORCPT ); Tue, 5 Apr 2022 12:00:06 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C591C583AE; Tue, 5 Apr 2022 08:15:57 -0700 (PDT) Received: from zn.tnic (p2e55dff8.dip0.t-ipconnect.de [46.85.223.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DCB761EC04AD; Tue, 5 Apr 2022 17:15:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1649171751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ow4OlxjAImgDNnNTH/q+sIch3Ua5XV+4xbXR3FoPyjQ=; b=G8n2Txu5vg5V0JepJkZLLh3scF+Nm/ZtiIiDYuqreG+vbKcQX43Nu6LXsw1XOwuf2eVt/4 pRsVkC9e8S7FhoFAHn4VvuniHQHcMMOmOeXfdnJhfL3d3KfQwuCKx0HvJu1RNYhzIck+Fe GofSdcA887YBx+3hjFyDi3UbxFkwwuY= From: Borislav Petkov To: LKML Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S. Miller" , Jakub Kicinski , brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org Subject: [PATCH 06/11] brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant Date: Tue, 5 Apr 2022 17:15:12 +0200 Message-Id: <20220405151517.29753-7-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405151517.29753-1-bp@alien8.de> References: <20220405151517.29753-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Borislav Petkov Fix: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_drivestrengthinit’: 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/drivers/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, }; -#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu)) +#define SDIOD_DRVSTR_KEY(chip, pmu) (((unsigned int)(chip) << 16) | (pmu)) /* SDIO Pad drive strength to select value mappings */ struct sdiod_drive_str { -- 2.35.1