Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1630270pxk; Tue, 1 Sep 2020 03:51:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSf2aaSV7hAGBGy7us5xk7gp1SYCVyW4ZyzYt7uLJ3iYWVY1wwGnYUTsK8TJ4VBYFPUbIM X-Received: by 2002:aa7:dd16:: with SMTP id i22mr37413edv.335.1598957483855; Tue, 01 Sep 2020 03:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598957483; cv=none; d=google.com; s=arc-20160816; b=UFShJ8khAOac/xEnHtob9rfZa23iVjMI70VuoaczJKCEGAvCoBCqMuhT4BR1xeRNz6 p12fW9W0yNzuG0k/Bwm+VEw4mbjIvf+FZehTaPvLwiSQ/135Gv7+y0rZ5eFHTbRdB0vv xIaTssCK2B294cf+setBm89euLp4ZsscGL5WrXA2qMmDtHo2HZbKCjE6wLwIu9kJWirj YcPos/YgjV4Xsuq2Y9vg7nnGnaRpoYAlwL3zJyAwA9wYNm50tmMM4Lseyczg+T8n+Yv/ TAeZR6NkY4IZqGcnyawuHWWw22Qf0soCw2R+RrE2xWPUNc6281RTXMfWgZasJWKex/qC WkPg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=hJLVzwJxQjp6xNbh/PRsnQBA0RhTN8F3VaKPJKZHWJI=; b=ZKbiWR3VtyMjWAmqZWdbPsqHJLaGSkvvlU9BU5j5zvXQjpSfQbNc4g4OPgudy7gxGa NnCIN0Dmby3lbn4OYuxeVzx3qBEjTzg31cFH66vEKnQZfcw7e7hE66v86BtANoFCsVU5 NjjMixrle3t7qp7UVD1TTOOb3nB49x3U/cjF5kioLVJPguUpQsdkDaPJsx2zyfjDOEhD jEJVIdDlvncyqV8JNHLcSSL93b2coO2mh0faBZ9R0m2m9RW3lp/ebr+SxbfZfz2EN5Cp 59eI74P2S0Zc/dcCgBaXGribhqE5UECGiHpk5HZTfC2bdFXWvK0lUzZ7V2Pd1ROXyDuY mqFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=pNzrpKUh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do6si499757ejc.360.2020.09.01.03.50.59; Tue, 01 Sep 2020 03:51: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 (test mode) header.i=@wp.pl header.s=1024a header.b=pNzrpKUh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726122AbgIAKuP (ORCPT + 99 others); Tue, 1 Sep 2020 06:50:15 -0400 Received: from mx4.wp.pl ([212.77.101.11]:10711 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbgIAKuM (ORCPT ); Tue, 1 Sep 2020 06:50:12 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Tue, 01 Sep 2020 06:50:11 EDT Received: (wp-smtpd smtp.wp.pl 1278 invoked from network); 1 Sep 2020 12:43:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1598957009; bh=hJLVzwJxQjp6xNbh/PRsnQBA0RhTN8F3VaKPJKZHWJI=; h=From:To:Cc:Subject; b=pNzrpKUhsmvR9HVI306H4velU08K/Awdo4R0V2b9N0uNo4zMx7vNIo3Z63N6YtNVm LKkSRFWKPw5O8YrQbHGQ66R7NZRwEN8s9IemxLcYigh117QRmvJz+yntJMuv5lRPVh a7hSoa9XGyCt2Vld84088H/ncwI37zUjlSR6K4xU= Received: from 188.146.234.2.nat.umts.dynamic.t-mobile.pl (HELO localhost) (antoni.przybylik@wp.pl@[188.146.234.2]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 1 Sep 2020 12:43:29 +0200 From: antoniprzybylik To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, antoniprzybylik Subject: [PATCH] staging: gdm724x: gdm_tty: corrected macro by adding brackets Date: Tue, 1 Sep 2020 12:43:11 +0200 Message-Id: <20200901104311.17270-1-antoni.przybylik@wp.pl> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-WP-DKIM-Status: good (id: wp.pl) X-WP-MailID: 489ef85a83f588acd1f26eadb7be658c X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000002 [0YFx] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Such macros are dangerous. Consider following example: #define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count) GDM_TTY_READY(a + b) This macro will be expanded in such a way: (a + b && a + b->tty_dev && a + b->port.count) And it will lead to errors. Signed-off-by: Antoni Przybylik --- drivers/staging/gdm724x/gdm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index 6e813693a766..eab5c75ee5b1 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -27,7 +27,7 @@ #define MUX_TX_MAX_SIZE 2048 -#define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count) +#define GDM_TTY_READY(gdm) ((gdm) && (gdm)->tty_dev && (gdm)->port.count) static struct tty_driver *gdm_driver[TTY_MAX_COUNT]; static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR]; -- 2.28.0