Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1843865pxk; Tue, 1 Sep 2020 09:05:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/ynqD16+fq7+rSgF07E0/fdebl535W7fnjVFF06E+fkMphlqr+hUXDTb2Crtm9Jh+hTmZ X-Received: by 2002:aa7:c596:: with SMTP id g22mr2369840edq.109.1598976346082; Tue, 01 Sep 2020 09:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598976346; cv=none; d=google.com; s=arc-20160816; b=VwIlgsLNDmFl8PBex/rJC1k+QGqB6dLrD1cypjyLpPctFIx0wuzNaifuKqSY3YTmuB ilUxf7EVYP900Yk25PXxZ2DkRX1nN+SE21S9oowOIkCBmA4Uh80aaPkR+g5GBV7Nj8XZ wZl6xjhwJMYIHxFiYis26xIBsYvZpJ+zSLFh5bUbyMw+CS+ZFrDwrCH7NG4zbu4WBGLM Y5R2VXQTXv/DNaRdwvPLFo6w5vaTIkEFiU/f6p4fIECM+W635IbjKMY77CAOlc7LuZQs reLjW+MfVToIdlQDjZlGjM6wCE5quDXZOdqsnsfAqOaEIexS/IXr5p91KK6G5AmVGE/B +Osg== 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=qZmZlG1OSNTuiAHH27knBwkcOln3CCat6z5vGbirdOY=; b=TKqC+/B5RENOqQEpAZGCFyCW/RnjIx3bS0ykGJDTSECLBlMW6wr/56fQ7hwQLN7e46 c3aSMrs3X2w0nRmnydIg3TkuAW8DJDoSXR8da2i5l3M+1q+iu5CTVdPPPuosUy5UtHly oA6SO3w0yHDICevVgWTzc3FI+8CaxNRh1wHLX6FvzBtbPtnPIW73RZTlBu58anXEwANG 7LmC9MFQx6QnoGxQK/yKVG9zVK4Ys/sHv2/qxJk+IQkoBhvoP0pIDYnwRIp175wqC/y4 vH7PfnXrpUxYmyCYtl7+kTqt/0+qnLt/bjZzikgZbAQ++pILItnCBWs5dG4dVDT2dXM/ KUmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1jIkHsMS; 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 e6si878770ejh.487.2020.09.01.09.05.22; Tue, 01 Sep 2020 09:05:46 -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=1jIkHsMS; 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 S1728348AbgIAQCl (ORCPT + 99 others); Tue, 1 Sep 2020 12:02:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:60304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbgIAQCe (ORCPT ); Tue, 1 Sep 2020 12:02:34 -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 0BF662078B; Tue, 1 Sep 2020 16:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598976154; bh=2+/pO2FWS81LBJUUa126UILD7S9Fn08gFTclDXknYgU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1jIkHsMSqW3UsOOAygtQ2L1XMBVEgDBQkJNtrcUMyHbql1/5KZbvBIeMfwCdPd22j gHLj0W03Aa+uljsP+wXGybKlYsXuFVDjSdH9nViohuQfc24zsQIqpNXZwF+J1tIOJR zkoXAO8guA2XTadgkg0c0CIPMf9tATVtDDglgFq0= Date: Tue, 1 Sep 2020 18:03:01 +0200 From: Greg KH To: Antoni Przybylik Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: gdm724x: gdm_tty: replaced macro with an inline function Message-ID: <20200901160301.GA1454403@kroah.com> References: <20200901154437.110056-1-antoni.przybylik@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901154437.110056-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 Tue, Sep 01, 2020 at 05:44:37PM +0200, Antoni Przybylik wrote: > This approach is more elegant and prevents some problems related to > macros such as operator precedence in expanded expression. > > Signed-off-by: Antoni Przybylik > --- > drivers/staging/gdm724x/gdm_tty.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c > index 6e813693a766..e789b7348dee 100644 > --- a/drivers/staging/gdm724x/gdm_tty.c > +++ b/drivers/staging/gdm724x/gdm_tty.c > @@ -27,8 +27,6 @@ > > #define MUX_TX_MAX_SIZE 2048 > > -#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]; > static DEFINE_MUTEX(gdm_table_lock); > @@ -36,6 +34,11 @@ static DEFINE_MUTEX(gdm_table_lock); > static const char *DRIVER_STRING[TTY_MAX_COUNT] = {"GCTATC", "GCTDM"}; > static char *DEVICE_STRING[TTY_MAX_COUNT] = {"GCT-ATC", "GCT-DM"}; > > +inline int gdm_tty_ready(gdm *gdm) Why is this a global function? And really, no need to make it inline, just make it a normal function and the compiler will inline it if needed. thanks, greg k-h