Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp128795ybm; Tue, 26 May 2020 12:29:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2U3c9WiFOU2kHFhyM6QPQvKNhzspwg23sxNpYQI/ssvXoqYXqtafgbLcklZlMJ+UjhpHB X-Received: by 2002:a17:906:1b48:: with SMTP id p8mr2299118ejg.399.1590521363898; Tue, 26 May 2020 12:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590521363; cv=none; d=google.com; s=arc-20160816; b=iLYLrdJ5K63bzlBG7oYw20/6++UNG0Vb2NFngR5GUl9WlWwFNOoJcX/iXlNKZRs1Dl cTd+okTN1Vt8W3KL7PeEOmkpiWkyJ6BzM82dNyPdtbY6gPU5CKHnrUQbefYw5Zw1uTKb zdnOCWo80SRAn7UQPvVGnVNyXzTlKZIwrI6nfYXupKuFO6ylaUngsvIk7Gx2gUXTW7hH STtizgGW6Bi5eDF7NtAFEhNDLkUH40r33vqHtUC5csh63h/UZTbZ6PUQlB7E3DPlFEFJ i8NbkmgBE3W+8xtif8NEeji7s50eMD+/vWqWD/C7lwho5FxviElcCjT3+b52XfYlFEFd 0ZAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Lvuh8U4nNNbgLZLj8/owy+Z0tEAkzN3Ezxyls6x2HRU=; b=gdBPlIclq1tAwgfwZJuhRKH07oQrGKNKFZlsdpCFynKo8J4IH8qEPWc3rkD9BdrKPE G5gerDeaiW/sH222VjCvUOUeWUM+V2gV96ALPJR0UwJ28YkFMuBOmAd5xEUg4AgPhwNl g/NdXU6Lcbl2d90bZS/zzeT1Ap12jjht99jzlpddZGvLlE6xFMYWcMsq7htbX2htWT1R KdvTVtRTxgq+enTYAvjuIeZ+7z4MNtfSoAB5Li/ywDiqqCWZe+g1OBJCmiVHsp3q7/lo ptvp9piy7PyHu4VZPSqzEOiFltKHltk6IXjR9rjC/UigrvAFNPqVCisuaxdIhZnSYrXk tLgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M3k3A03a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si396298eju.78.2020.05.26.12.29.00; Tue, 26 May 2020 12:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M3k3A03a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391741AbgEZTIC (ORCPT + 99 others); Tue, 26 May 2020 15:08:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:36838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403778AbgEZTH5 (ORCPT ); Tue, 26 May 2020 15:07:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1485320776; Tue, 26 May 2020 19:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520076; bh=u2VeJ6WneGtXK1DRpVLdh0k3NgnIp1z1pi15bDGTiIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3k3A03aXKFo7/meVY8rJh3CXPh2WriqXSiW+cMvDRguCDl0c7lDuYL8zt/YaubMc xgfpDRmvu87mIJk4gxYqdJLVbjmWIzUbcsznGc3sQYyTiYE0s5QsiezHUlKAynuazI 0fxruFgd2teIMfEZ9UY6a0MSHTB3UGt5wKS33A4A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Takashi Iwai , Sasha Levin Subject: [PATCH 5.4 049/111] ALSA: hda: patch_realtek: fix empty macro usage in if block Date: Tue, 26 May 2020 20:53:07 +0200 Message-Id: <20200526183937.524385358@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183932.245016380@linuxfoundation.org> References: <20200526183932.245016380@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart [ Upstream commit 8a71821f12a010d7100f9cc1f7b218aff0313c4a ] GCC reports the following warning with W=1 sound/pci/hda/patch_realtek.c: In function ‘alc269_suspend’: sound/pci/hda/patch_realtek.c:3616:29: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] 3616 | alc5505_dsp_suspend(codec); | ^ sound/pci/hda/patch_realtek.c: In function ‘alc269_resume’: sound/pci/hda/patch_realtek.c:3651:28: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] 3651 | alc5505_dsp_resume(codec); | ^ This is a classic macro problem and can indeed lead to bad program flows. Fix by using the usual "do { } while (0)" pattern Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200111214736.3002-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/patch_realtek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 151099b8c394..a0e7d711cbb5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3719,8 +3719,8 @@ static void alc5505_dsp_init(struct hda_codec *codec) } #ifdef HALT_REALTEK_ALC5505 -#define alc5505_dsp_suspend(codec) /* NOP */ -#define alc5505_dsp_resume(codec) /* NOP */ +#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ +#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ #else #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) -- 2.25.1