Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp920318pxb; Wed, 6 Apr 2022 04:19:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3mUQ3GMc4yJ1v0lb7R3RcIBxRi8ubPtaSbSbQJr70n4xUWvoHPa3b+oUr3J5XETXHcps+ X-Received: by 2002:a17:902:8684:b0:154:af35:82ce with SMTP id g4-20020a170902868400b00154af3582cemr8147028plo.137.1649243946002; Wed, 06 Apr 2022 04:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649243945; cv=none; d=google.com; s=arc-20160816; b=LWEJJJE0sglJqY/0uo8rhrPaJYevpRHMHAP6P0fbT6nx0fLLKkUOoOsDi5eLUPOhdp FPNZt+TwJPDEt4UEdsHX3CSf7WKYKbigc+nq737sdkRGnhGdjnE0Ch1J2TzR22QAPWLF BEC64Ch7CS26ibuJmyj1u+RVz2YZa7XnEnhq65ZGlDgB12i+sTXprfZGUfEYQlUDnhv7 ++v3WnWEtj61BT+mlnsLQ2WbRugtWK6fZ3t9w6eJig7CbcU0cLTYDVouGW5AKjQMO/95 vsVv23mUkL+TDoN9Y+EDmdyvWlYEE4izoVmnn3Z5EGd0+ugKamueZBVV/e6Cc7XYajDG ialw== 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:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature; bh=o1T9kHw4YkgzAzeHJb8LqxvUd4Kx7c2662b3fqCcBDI=; b=d0sxuDvuJFigkeEjdWSXvfU/0FVRD94VRw5wVz64QcGjsisAoaucCwFkmxUDeBM3j1 2UUgyGyzpiofZj3GlS+tiHmnRCi+t/cfo2i8gPMrDHGhKkw3SecKsAhZkH/yX1ZqMPv/ aX90boDNONRMPHlE8l9N+HLiDC6Fa1LwA6c/BIS8YTSUm0ko91GS11gIY8e4E6+/okyO wqK8yrzOthG67uvv8p5xzVrMH26+JqWaOwy8FxAI2z4qkApLuIONxW+koDwVNm+zur/w I35Ys0GFZgEOsHh+A997gHzucYPDOo4yWo5/RAjzdBtKZfLbTlfTVTpKh1Nza7dclnKd 4Kig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HJrwxsR6; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e8-20020a656488000000b003816043efbbsi15608890pgv.432.2022.04.06.04.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:19:05 -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=@suse.de header.s=susede2_rsa header.b=HJrwxsR6; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 617C75E40F9; Wed, 6 Apr 2022 02:42:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1840566AbiDFBLA (ORCPT + 99 others); Tue, 5 Apr 2022 21:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457200AbiDEQCz (ORCPT ); Tue, 5 Apr 2022 12:02:55 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3832F3A8 for ; Tue, 5 Apr 2022 08:32:50 -0700 (PDT) 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 Cc: LKML , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org 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 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 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