Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp365878imm; Mon, 9 Jul 2018 03:18:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc2nckeVn2GX5E3kjfnGesjqVgrOvrBJImyaJqW0anyuypHjc7n0Z0nCPhAjujyFNw7HuZd X-Received: by 2002:a17:902:7202:: with SMTP id ba2-v6mr19590131plb.119.1531131536189; Mon, 09 Jul 2018 03:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531131536; cv=none; d=google.com; s=arc-20160816; b=kYifTwrYfmrgWE64DMUS2Jx5tvCFDGJLnhJjn5Tl1QTsWcaTNcNpPWZezm5Sf2DRD1 RCe5XFJPucfARigUy8btSrcIBEWgmXq/RWtR6PUz3MtBf1afIyVsRsBU66n7mfKmsUwy EHGj8c6a+bleQRwX+ELexaZEJRelgjQV8P0g87vmZDzqJQ1Xd+0/imHfU8dsuhpkhpkh qWQbJkYBuPwC+0MN7YmYB/UiqbprwiIDuV9T6LDjsoLsCs/TKdjahfrLKcBeEJGoogoI 7jiaxFATh4rwKNyeiazIWTuXAfFV92vDdg4rE0ZoZaK8NsVAjsClrDn0n0y05OtxIYuj DmkQ== 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=ftt+wmsHD5shxyvU7dl5gb2QO5VsGsH5aApg8xArd9JDdij6AZAwgeUtuafFC3IJ7w TLxxe4y+PL+gu0D8sqohxGHnISZKC0mx53a7ANk2fjdkXy6YOgfeUrVmalkFN/7e5i32 Yf3QwcBOg3jpTXc6RUe3mdKq8/L3AscvDqhQc7G89ifFpqzP6vaNVCkRFK+sy+hHppZ8 maTAJKWDsCq2+V+gPoyV1W3zpiwl1jlo3O8eV9MiN2KNAzsb3rYTHF7QEn0diC1qtyV0 FyLIjcj64xB6ZL+6yXXNIiMjF0L7Tbqkyciqxlng2fWRo19wgtoVibLIUI5gb4DxPteB Wd0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qOFmYlSg; 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 j30-v6si7884255pgm.26.2018.07.09.03.18.41; Mon, 09 Jul 2018 03:18:56 -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=qOFmYlSg; 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 S932466AbeGIKR1 (ORCPT + 99 others); Mon, 9 Jul 2018 06:17:27 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:36108 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754432AbeGIKR0 (ORCPT ); Mon, 9 Jul 2018 06:17:26 -0400 Received: by mail-io0-f193.google.com with SMTP id k3-v6so16557918iog.3 for ; Mon, 09 Jul 2018 03:17:25 -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=qOFmYlSglJOUi6cbJUUeABXGhCyNGvikIzTRGlkjiEW9GRyG0bjRp8d/aZZpoKOE9l U66DOgtbVbs+dRnaOc01x9GE+tBc/DVwtuY3Q68N7LUnN19s1yZULZFodkGP7hIjP4UM 92CAx5V6XXbSsmvaenSeoiIrI44ZWjEH+WWdWTULWCgZOqSXiTiaQCQJ4gPqcgsFjYbs sbZC+7CHaFeGdaWaSiSzykcH/dCTUvN7W8jnwcBtm66LGub9asdvyX54YXkCbaSZEleo uYWaI2utvVTxh03nJL71y9x3x2GgRctJQF//9Bg2Se+Y0dpkgaiDuoEEzPw2kkajqMwI WNDA== 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=e7ek7bmp4DtVIhQF/sxGjlvWTnmAV53LWNO4Bv/jVmmLl5PJi7M67PBlaorm9upEN+ 0iwCMAh/YV/xB9XhhS7WSVm2lea2hLZUhAmEONRzvLY1yDx+opaekkgXXULFiojdLdoG prBxBiSgclX1fcvnkPb21aivyNbwuKharJIf982ipvmMm7AiCNBXFq9CdxhkD5dxF/kO TVnIbA899SwPFbdw8l24r91nsmuNT42g9znOfxpf4sGk6OGxHSLRBLWXXFetVaA2xH96 f6CovFoG7UUmxZcn0xpvtgmbDujROFw7jFPTFtZqMxhKOphs6eGwwOT0geuXBZP6A/xf AjAA== X-Gm-Message-State: AOUpUlE7REImSTS9SAldjCaT5WIJMWW9hopY9V7iPqrTQXCdhvRshJM7 3O+fTMKud6ahcmqdS9SZTQw= X-Received: by 2002:a6b:6503:: with SMTP id z3-v6mr7926005iob.129.1531131445458; Mon, 09 Jul 2018 03:17:25 -0700 (PDT) Received: from localhost ([14.139.180.40]) by smtp.gmail.com with ESMTPSA id w141-v6sm1622568itb.31.2018.07.09.03.17.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 03:17:25 -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 Subject: [PATCH] Staging: gdm724x: gdm_tty.c:Fixed Macro argument reuse Date: Mon, 9 Jul 2018 15:30:20 +0530 Message-Id: <20180709100020.7399-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;