Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1144009pxk; Mon, 31 Aug 2020 11:00:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUujz/t1gKm/sXAR5Qf96X4pD1s4z8VxmExLZ8Jsex31emQlLyFAsT6q6njw3vOKJi6Ngu X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr2136115eja.333.1598896819634; Mon, 31 Aug 2020 11:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598896819; cv=none; d=google.com; s=arc-20160816; b=UkW5TmFnVATK8oLiqe8VI1/IbJI1hf8dfM/t1apikZj87KWU1f2TIzqAxzwj4NnSg/ Pec214RnBeDIJfD/I8bx4nj214AIZKDHeO7Y0p2oFXzoG3QT0Qqiba/9JHKn0M4DIvU2 djBmJ2eCvSjHbcOl/e2BN9AH8Er/XOKRPR4j0SGJKA1wweN8wZ9tNFQyMx85qkRoTpdS fwejz8FVHqLMxQ8D++S4CPVL25QskYFIsHIc7d7vbMrnSsMnxJ//8ayz/H4gz78UrYE6 vW98Xp7/jYBnlGjWJb0bVXYfojBuY7cpiM1Fg4/7XoU7j1j1YdcvMIH/EadUPc3ANEHg 1Dyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=MOfLOFvIiRve50Jv1hytMATL01SgEFfRKZ5E5pdPK2E=; b=UAU1M+fQl8kffwhSQKAgAHL6pJRAo5OVTw1nUg/XrfqYR5E3DMquntUDIFlcbsvlNR HtEa55jF9Hhz9iAxAlHrBW44QWeSbU2R9yBPNipPIkK9tdi3DXXZY9e810rU5bH1Heu1 RC0dIVR6zoAbfzyxI0KN8l56/AAByUR0HrEwOH3K5Vh7UL5k5cTJh3EiDIbQR8fHbwhv hvHG3BRB9sb/vj3Ol86l02TlLgZKEZk7C8uCsVcu5eY/jKVpnlkQDrPXOjv+CgyuLUPP 7ULxei4fHwkoxSlySJDjVg86lZwnyDnviVjNLNgOllq7ySNSSZaN+q/0x1BRElPK16xy wcGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ed2/ahwD"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m64si5243194ede.91.2020.08.31.10.59.55; Mon, 31 Aug 2020 11:00:19 -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="ed2/ahwD"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728239AbgHaR4x (ORCPT + 99 others); Mon, 31 Aug 2020 13:56:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:51948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgHaR4w (ORCPT ); Mon, 31 Aug 2020 13:56:52 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 5C8042064B; Mon, 31 Aug 2020 17:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598896612; bh=ERddwSmbW2NDx5hhDfjr7bYktdj7MbTDA/T+l3ouxuA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ed2/ahwDFtWyuYHg7VAwF7L4DHDXj3ep2TYL4IqTyA/werP9qDfP9UPDItciQdFSJ TZtQ+DXRAo5LNwOxxzS6GKp2uY6rO2En7+lzNV9UIB4g+OoUwcC1WZMIaxYOP20FLi kxHHt/EEok389WReTP+xDrG4KEb+Fa6CAjJj9DP4= Date: Mon, 31 Aug 2020 19:56:59 +0200 From: Greg KH To: antoniprzybylik Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: gdm724x: fixed two macros by adding brackets Message-ID: <20200831175659.GA2556308@kroah.com> References: <20200831160332.8507-1-antoni.przybylik@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200831160332.8507-1-antoni.przybylik@wp.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2020 at 06:03:32PM +0200, antoniprzybylik wrote: > Added brackets to two macros. That says _what_ you did, but not _why_ you did it. Why did you do it? What does this fix? Does it make sense to do this? And why these two macros? Be specific please. > > Signed-off-by: Antoni Przybylik > --- > drivers/staging/gdm724x/gdm_tty.c | 3 +-- > drivers/staging/gdm724x/netlink_k.c | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c > index 6e813693a766..5cd94347bf78 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]; > @@ -323,4 +323,3 @@ void unregister_lte_tty_driver(void) > } > } > } > - You also deleted a line without saying so :( > diff --git a/drivers/staging/gdm724x/netlink_k.c b/drivers/staging/gdm724x/netlink_k.c > index 7902e52a699b..399b7b4b536f 100644 > --- a/drivers/staging/gdm724x/netlink_k.c > +++ b/drivers/staging/gdm724x/netlink_k.c > @@ -20,7 +20,7 @@ static DEFINE_MUTEX(netlink_mutex); > #define ND_NLMSG_DATA(nlh) ((void *)((char *)NLMSG_DATA(nlh) + \ > ND_IFINDEX_LEN)) > #define ND_NLMSG_S_LEN(len) (len + ND_IFINDEX_LEN) > -#define ND_NLMSG_R_LEN(nlh) (nlh->nlmsg_len - ND_IFINDEX_LEN) > +#define ND_NLMSG_R_LEN(nlh) ((nlh)->nlmsg_len - ND_IFINDEX_LEN) Does that really make sense to change? thanks, greg k-h