Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp502051imm; Mon, 9 Jul 2018 05:54:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeTCCuLJDLs4/oVGbU/WVMyOO2DSUf/GIvs1Skx1w6K96NR6MLDy8tNkFmWQsnTq9korkl5 X-Received: by 2002:aa7:8298:: with SMTP id s24-v6mr21075839pfm.136.1531140893404; Mon, 09 Jul 2018 05:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531140893; cv=none; d=google.com; s=arc-20160816; b=hpWLJN1H6nVpauNeH9yHU7gWssxT9/P22+3t0Uw8mMj4rOd621sC/c/qN5beNYr3Kx H0r4Gk5+kGmCYdWaiLGznrDTACyp6qdMhGAaG0HfdoB9C0+GiAQ5hXGiiScF+qM2Opzb WJD7LIRlqydLtX8gMh8hAh8xHOEtp8HUntAaQ1R723DPmNvST7d/tmG5/8oo4caeh5Qg JJ6ikD3hLKMJExm6IJ2k7t0Vgqs+en3kN3jWdv7rOcXkVsgkk74LPplZ8RMwBBne3CEK XxkXW1E5+NRfu9rewRaVGs1X9YbSe5iWHzi5SKezd47IMDXEBsNYirO6FwZlukyO91gB d7iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=owlczyPcFLNrePYRAylupTU7gKMpXSCpjpryOOV8Izk=; b=U6mZqm3bck5Nenr2xlunHOZDZRn8HFzoUW8Oh5MWIGiQTp29Qf5z7Ff9eEb3BxHK/P zfEOG/balQxKDY1umZSp1SOgIHmYCzbwYPk2Vk1XmO+sNS8wEDTm/6x7iaYh8qhdmzFm 2gzvlRGJ6DAu8kKkTYphFpr9zcegREFGNKscy0QqZnRZUZTWmUf957VU4EzKi9+RSGuP UK2A1xKZ7hcQvZXdeAPjMVIP9Xm3CwtxcxD/hQSwYoy3/+8CYaU+eaRR0YVg03DGX6MZ comMeZ+e0ume7q3QM4HFkhHt3DMedBTLkFo5WCxaKGNLheNl0vhWYaxmm4IJFW456cBg xdlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FlV2kKtK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60-v6si14679531ple.65.2018.07.09.05.54.38; Mon, 09 Jul 2018 05:54:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FlV2kKtK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932687AbeGIMxu (ORCPT + 99 others); Mon, 9 Jul 2018 08:53:50 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46894 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932595AbeGIMxt (ORCPT ); Mon, 9 Jul 2018 08:53:49 -0400 Received: by mail-pl0-f67.google.com with SMTP id 30-v6so6003727pld.13 for ; Mon, 09 Jul 2018 05:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=owlczyPcFLNrePYRAylupTU7gKMpXSCpjpryOOV8Izk=; b=FlV2kKtKy0a70dOreU4nkDlZ5rkhZlCvYLjmaaGcGfy8i/K2SoxTORnHDKTRQqOyvS II30GvJoN5r3B5GzO9WUmAq9ae5/1PRRDabtXJmr4Q7wE0xjEphCxivpVSonOFglP/1X vhGVSOSVdNOFSf6fjsDVoxdIh0p1MBCmLQZlqhLI7etk5Tt7Q6sDuZLp7uULjmUlCTzH T10hGN3gqVeXkuxoln4HUfmn6x2YSWuqxPTcCG3KQ7tr8nSCtEl/ov5gYgEll1P9teq+ 2FF5U9aY2WgwfGv1EaLp7/rwDhZY8mIMIj49fKEhHgAIeme0zcfX2DDvf8XW0v3fnVhe 6Agg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=owlczyPcFLNrePYRAylupTU7gKMpXSCpjpryOOV8Izk=; b=NEyWQgQHunJxK2q3zkqDnkb0tdoLrkZqbLaEth+RcA2oUtLtIN87TGxR6VhFEOjZeJ TvnqEf3Oa/USqSYszKN9ZQwyBOt/qGJ7HxLwPxGgtQrGywI4jafru88pRr19GJJe5u9k b57WFHFtDT5VjeVkFSfrjIwuJ8PH7+PAFVR7TTT0SNt8kTx87aCGNmUXxa+Dfj/SFzRh HYiLWbvkPD625OcoG4ZdlzeHojMp1d1w4bPq18UBoCEAy3KH6jPwcIiuPq9UOkPd0OCS hc7k/srmdIS5T4T2JuUJiPRJRBCNPEun8q5eQsK9r3r4tl3D9nHSJnKQQpjqba4Jkb61 emnA== X-Gm-Message-State: APt69E3Vtc+GVhjkNHkGsoioG7tZYnpx1EJsifh6ZVaBVpkzhvUcQXqo Jcnq7IORzuuGQFL8O++8/Q0= X-Received: by 2002:a17:902:b81:: with SMTP id 1-v6mr20786628plr.164.1531140829239; Mon, 09 Jul 2018 05:53:49 -0700 (PDT) Received: from localhost ([14.139.180.40]) by smtp.gmail.com with ESMTPSA id j27-v6sm44371148pfe.48.2018.07.09.05.53.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 05:53:48 -0700 (PDT) From: Jaya Durga To: gregkh@linuxfoundation.org Cc: quytelda@tamalin.org, deanahn@gctsemi.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] Staging: gdm724x: gdm_tty.c:Fixed Macro argument reuse Date: Mon, 9 Jul 2018 18:06:32 +0530 Message-Id: <20180709123632.5682-1-rjdurga@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: root CHECK: Macro argument reuse 'gdm' - possible side-effects? convert GDM_TTY_READY to gdm_tty_ready static function to fix checkpath check Signed-off-by: Jaya Durga --- drivers/staging/gdm724x/gdm_tty.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index bf554f7c56ca..5de1940c1f79 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -27,7 +27,11 @@ #define MUX_TX_MAX_SIZE 2048 -#define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count) +static unsigned int gdm_tty_ready(struct gdm *gdm) +{ +return (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]; @@ -127,7 +131,7 @@ static int gdm_tty_recv_complete(void *data, { struct gdm *gdm = tty_dev->gdm[index]; - if (!GDM_TTY_READY(gdm)) { + if (!gdm_tty_ready(gdm)) { if (complete == RECV_PACKET_PROCESS_COMPLETE) gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev, gdm_tty_recv_complete); @@ -154,7 +158,7 @@ static void gdm_tty_send_complete(void *arg) { struct gdm *gdm = arg; - if (!GDM_TTY_READY(gdm)) + if (!gdm_tty_ready(gdm)) return; tty_port_tty_wakeup(&gdm->port); @@ -168,7 +172,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, int sent_len = 0; int sending_len = 0; - if (!GDM_TTY_READY(gdm)) + if (!gdm_tty_ready(gdm)) return -ENODEV; if (!len) @@ -195,7 +199,7 @@ static int gdm_tty_write_room(struct tty_struct *tty) { struct gdm *gdm = tty->driver_data; - if (!GDM_TTY_READY(gdm)) + if (!gdm_tty_ready(gdm)) return -ENODEV; return WRITE_SIZE;