Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp308154imm; Mon, 9 Jul 2018 02:02:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpduXdbAlU/weKEhAwRkpVv9a7nQMtZZw7ZHqZab9W+x3wUbafyGnF57dUfT0wBTnuT/IhJV X-Received: by 2002:a62:32c4:: with SMTP id y187-v6mr20474491pfy.241.1531126973879; Mon, 09 Jul 2018 02:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531126973; cv=none; d=google.com; s=arc-20160816; b=VzpawR4J2MjYp87E5YO2rZya5EI2+4SP/BIzjw2Z1iiv54yzhPVLKRZ4d55kNLKhB9 RLlgs7xGXGBlF10WVHdhvztsiYMQhlpPUFAgbi3vWl8v1wHMIlBbI0Dkfi0IsgSltrPS S930ghf/W/4ZD1Z10jrD8tVMCRp+1dCyWK5yDbeySLQIYFCb51v0zXRrK508aPAZWuXh HJHX8Dl+sMjzKzX/OBx8yBvuzcRwYyEWwfgTAFSJrvlcQDoXL5vxi8ATPEjUHKxs18Fv hh+yQ0DjtOxjjxHtQuppErMZ3Ofuz9qna7NKBnyJFOcs7BCu7cUX1AlgfFLWrk/awJW2 Mx9g== 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=RvigYRG3J3iEcUNgk32LwqwVII13LMfAQxIwp8kGsTQ=; b=jLM2mEDYBfU3XwHkyOv8B2NUaXRYewqB6bN2Pfs6RRIk2hgo0dx9ePtPXY5Qfrjv8D KYvCSKnq9qhrtb9gOIBo1zlMH6cPCZXMNWILRdvYYrOFykb/ANAsCk5oLzdXQKwFSRtj QtQR+7odD5wdEPSuZiA4a8Jz1mMc2z5aIhml7IZf/s1l/NGCK55vio/7V22W/8o/Q2Nf 38HRFQpH+y21YAaxbgHC6uKyA6EtqrXEi4aNhS0/qls4uFPn5heZr6saMXFI6t5dzy5n jGeQvMP6+xPK4tb1zunX6FSLcakTYCyBIPpC+Y15nhlqDx5M7VeIazsu+0Lqo1GwfGiF CM0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FvRPjkeK; 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 q13-v6si13898821plr.220.2018.07.09.02.02.37; Mon, 09 Jul 2018 02:02: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=FvRPjkeK; 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 S932431AbeGIJBO (ORCPT + 99 others); Mon, 9 Jul 2018 05:01:14 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36334 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754077AbeGIJBN (ORCPT ); Mon, 9 Jul 2018 05:01:13 -0400 Received: by mail-pf0-f194.google.com with SMTP id u16-v6so13215291pfh.3 for ; Mon, 09 Jul 2018 02:01:13 -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=RvigYRG3J3iEcUNgk32LwqwVII13LMfAQxIwp8kGsTQ=; b=FvRPjkeKN9JeD2RmsOfoelmJYRmdfqJ+QVSoK7/NTW/ScXnHrplv9TKIHsNLT5IUqU xaRUN6QIj6A7LrrDp+ws+2NqYFct6YTLIrOaLEolB1bIwx26IIeGYDKtuTlIvvcgE7Y6 /Y6V93zry0zJtKGWMNIKr3wmosOyKinUF/WZckoz/t0Pnud/7Z9jYft2Ke/JuCVp3t5j 3RgFkojhUbdF32AqoMQHhCYHLeYeqYfU/CdlN27ttbn+USaTKm6chV9kW84+pwcXvNzv tXbNFm2qyJnMMgCCgqY6CQbG+R0ZNMnZZHKl9WOHS6GI3sqriYAKWwTD0QD5DBKzDVW/ 4cpg== 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=RvigYRG3J3iEcUNgk32LwqwVII13LMfAQxIwp8kGsTQ=; b=ZvDBsWRdZo7LcAR7CCop6BofdCc89Y6UkTWUxwMJI2d7OyLoBlX7zkCvLhIYaLILSd MrJlg0lf6NsKc0yQnQzWZkFeSM5ZpoMWTlLc3SgFtF0SkPjOHNhgxGV0XwDPBeE6+/iX ilUfikEhhD3Il8WOnQejYRHqIiT4cPWlo3DfXPxwWMztk43rzJaXA10XgmmRAdOae49H tvJ8SH0dJY5pOF2ZXfeV3m0OVo4N5o2knoMWLz1wkFwx+2i5qFiMlTFg9wlqJgVMlWJI NL+v1Fqlh/C/V8juSJ2PzFv/5Z4eFFtSEIiSzzAXxwqyBJGGgwQ9AmP+sQmHX3NQP08z BU+Q== X-Gm-Message-State: APt69E0Pk8lkyQXDlmZM5RDcdlr7SK8wAAMbVs1aS/ZfYjv2p6XUVLZ6 k75r7M1D7rYG7bgJfD+XEms= X-Received: by 2002:a62:b14:: with SMTP id t20-v6mr12401589pfi.36.1531126873097; Mon, 09 Jul 2018 02:01:13 -0700 (PDT) Received: from localhost ([14.139.180.40]) by smtp.gmail.com with ESMTPSA id r16-v6sm27557154pfe.173.2018.07.09.02.01.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 02:01:12 -0700 (PDT) From: Jaya Durga To: gregkh@linuxfoundation.org Cc: quytelda@tamalin.org, jonathankim@gctsemi.com, deanahn@gctsemi.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, root , Jaya Durga Subject: [PATCH] Staging: gdm724x: gdm_tty.c:Fixed Macro argument reuse Date: Mon, 9 Jul 2018 14:14:06 +0530 Message-Id: <20180709084406.6129-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;