Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61144C433F5 for ; Tue, 5 Apr 2022 15:33:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E99CC173C; Tue, 5 Apr 2022 17:32:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E99CC173C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1649172828; bh=dEC+V/OyDk+FwNNsbexnYPxE6UkgnGWi9hDvx8Kx64s=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=b3ikNJ5p47xhSomVR8bJ44ETgAmcRbQRH8XO/3N8dUYE/dBV2aSiv6bfLzqEUR3PV FqugQ3lBxqSeCtWHteLRgWnGiWsnLLenjyFnx+24R89L7n19V+ESjmHOf/K10NWkkt 9xDpmjiQlCl8FD2CDFd+jsTJG48cfUMN1lGiXRj8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 797EAF8014B; Tue, 5 Apr 2022 17:32:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D5D1DF8016A; Tue, 5 Apr 2022 17:32:55 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AA753F8012C for ; Tue, 5 Apr 2022 17:32:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AA753F8012C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="HJrwxsR6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NKx+vh5j" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 015831F37D; Tue, 5 Apr 2022 15:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649172769; h=from:from:reply-to: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=o1T9kHw4YkgzAzeHJb8LqxvUd4Kx7c2662b3fqCcBDI=; b=HJrwxsR6IrepVQxZuwAYKA5i47gop3GBVCxUmmL/En11Ginj0aIAx2mipjasfKc0OcWG+q 5MQUPN1Iq1/0eHJ81qeeEw7Rwae9RhuCmFp2XbSVSs28Y76L8UjIF0Pr1XTm7tzikjpbUj wigD95WPiLM6HiTx/3zDSRkeVGOh15E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649172769; h=from:from:reply-to: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=o1T9kHw4YkgzAzeHJb8LqxvUd4Kx7c2662b3fqCcBDI=; b=NKx+vh5j2MgY3SkmqQoj7qVrFVUZsnMrY4IRPYwtRSEajM4wEJ82VbxDDRa6Fq6Kd1a2JY 59YLb8kPdL4mLkCQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id E3E12A3B82; Tue, 5 Apr 2022 15:32:48 +0000 (UTC) Date: Tue, 05 Apr 2022 17:32:48 +0200 Message-ID: From: Takashi Iwai To: Borislav Petkov Subject: Re: [PATCH 02/11] ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant In-Reply-To: <20220405151517.29753-3-bp@alien8.de> References: <20220405151517.29753-1-bp@alien8.de> <20220405151517.29753-3-bp@alien8.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, Takashi Iwai , LKML X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 05 Apr 2022 17:15:08 +0200, Borislav Petkov wrote: > > From: Borislav Petkov > > Fix: > > sound/usb/midi.c: In function ‘snd_usbmidi_out_endpoint_create’: > sound/usb/midi.c:1389:2: error: case label does not reduce to an integer constant > case USB_ID(0xfc08, 0x0101): /* Unknown vendor Cable */ > ^~~~ > > 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: Jaroslav Kysela > Cc: Takashi Iwai > Cc: alsa-devel@alsa-project.org > --- > sound/usb/usbaudio.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h > index 167834133b9b..2b3dd55e8ee0 100644 > --- a/sound/usb/usbaudio.h > +++ b/sound/usb/usbaudio.h > @@ -8,7 +8,7 @@ > */ > > /* handling of USB vendor/product ID pairs as 32-bit numbers */ > -#define USB_ID(vendor, product) (((vendor) << 16) | (product)) > +#define USB_ID(vendor, product) ((((unsigned int)vendor) << 16) | (product)) Parentheses are needed around vendor (as usual for a macro). Could you resubmit with it? Thanks. Takashi