Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp769695pxy; Wed, 28 Apr 2021 13:55:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRRxCIIzjv1xR8xA37XYMFnKtmwamojnXYjLX4FN7jGZ6mVWXEa4ERmt4bndJUleRuFob7 X-Received: by 2002:aa7:c7c5:: with SMTP id o5mr13891931eds.31.1619643342183; Wed, 28 Apr 2021 13:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643342; cv=none; d=google.com; s=arc-20160816; b=axkfVe1XmHHh2ick3VbYfhO4dS9G3Wd+QsN8qBlcX5T2U8CyA5iEinLLEqgv/5ezQl 9CdY9JnAGa+/2n4BLe6ouo42pPW84ip7o3llRBhQi6DLfBwTF7JfdKwv0cUO9oUq9bl9 x8+h7dN+eTXSgeZEdCpgo0oIk4FG1JyEcI9Rt9qdytDXdJOfXk3tvMlyVMwCj7ldMEVZ tY9H120ZPJFTqhHsbJJWMXVe7GiEanKZQC2KTxjqQz/twmgvQxuW290Mrm08GplzzEhV vaAsyNZGUzfeIecTkIUZb/B/4gUWz81PeE+IV/1i1Aq2ETBGgRUAV7hhazCuReFkoe96 3YPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=5M8EnYURBjzX8y0h+Dz4U0bf8pObQR33VCrys3oNTlE=; b=KeY9tmOA2XdW4c7Mjf00J0c4A3f/nOt5dX5DlUwgX8aITuybj00tc+c96nPN3Vwc/z JwoSoE34CCvVHVtVL/bZ1xdwKkpVq5iyc08/1eRabFHJpGyVg3aAf2r/xYoBqZtKq/nB DocyRcC/mGcR+s1eXdphW8pTBeg3VtZk2FYF9SK6e76dHwDWDvVzTiosNHNvz50Q3bAt kh9rXV9Rn6JVLo1h1gsPM307N5/6QU2OEpiNyXbv5BwsiutWVujaKpa0O9SpqFzS9YvL b5ZWpOGHqF2RATZaP0fOgumuqGMXGUeU15pYpWn1AKBOgwozD5n5y6TImYWX6YUxTiq5 cMtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d0XPd+jY; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt1si835043edb.12.2021.04.28.13.55.16; Wed, 28 Apr 2021 13:55:42 -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=@gmail.com header.s=20161025 header.b=d0XPd+jY; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbhD1Tj6 (ORCPT + 99 others); Wed, 28 Apr 2021 15:39:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241927AbhD1Tjv (ORCPT ); Wed, 28 Apr 2021 15:39:51 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0985C0613ED; Wed, 28 Apr 2021 12:39:05 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id p17so5455008pjz.3; Wed, 28 Apr 2021 12:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=5M8EnYURBjzX8y0h+Dz4U0bf8pObQR33VCrys3oNTlE=; b=d0XPd+jYEgmFF3VoLFl6T1C2ZDiJ5qv6Dun4f3p0GrKheIcSwMuHxv6cMKpiJunMCg 1Wy45ZzKygnRNbfChf6/sUS73LXKyafp0ud4/nWIKTddlTGoswxh30qtaoKeyadhVzxU rcP5X+2+zLVLsoApHXwuCh7z6+tdU1YXZTu7Gwd0WE7PRi9RzarDhd8yH4V9f/QYlb6i Kk9qI0udU/g9rPRP9K/wIsk0tGlvfkja04Vb85VkylCZi8nS/epH2ugQOfgwuLuq9Xg4 BjOQA8srcwz1Z1G6jAqGUw46j8sIck3XT3DizGrWxikHBwhlgwCafRDQuRJ6oYHAdx9Y EcIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=5M8EnYURBjzX8y0h+Dz4U0bf8pObQR33VCrys3oNTlE=; b=NHaRSWZZuvI0RcRuT7BB0kBsg50ESCNQRLrVmvRVjaOWRb57LtwiZrugHu8ZGdBhgB cgTes/tLYf4oI1XTKN1ZDlEsCOmZsGh8iuBTitdgCFVjcOd3qI7RcRcskcjqyJXic6Rv QZKY9cOGxvIWO2+3Wg7iLmWCUVit0PLobVQbpFTtjFp1OUzoYoeYCMoXTEY7OX35zHdd qDUGz2CwTQAuspPVRRiBDjztqBSriXxI+THbFcNPHbQFZZoVLjZyW91hzyhXyVAymkv0 GcU+p1p8Boj2CtRnybPxMmzEE2Np08CHas16pgzSYXILX17VFrx2hXjLE993Fe3qufHI bHqg== X-Gm-Message-State: AOAM532bacb0YeCYvkBSZHhK3kYSWkRalhb+rUb+PQewYaR3LZtyFGXG SU5BwizhAAJQk3Hv95wBLtymthpGIKCiaqf2 X-Received: by 2002:a17:902:ff09:b029:ed:3b29:ff43 with SMTP id f9-20020a170902ff09b02900ed3b29ff43mr15444309plj.14.1619638745292; Wed, 28 Apr 2021 12:39:05 -0700 (PDT) Received: from localhost ([122.172.37.94]) by smtp.gmail.com with ESMTPSA id e1sm450177pgl.25.2021.04.28.12.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 12:39:04 -0700 (PDT) Date: Thu, 29 Apr 2021 01:09:01 +0530 From: Anupama K Patil To: Jaroslav Kysela , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, B K Karthik Subject: [PATCH v2] drivers: pnp: proc.c: Removed unnecessary variables Message-ID: <20210428193901.rqs64di4g2svpaeg@ubuntu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wpqdbbx7thmklwzk" Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --wpqdbbx7thmklwzk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable de, e are two variables of the type 'struct proc_dir_entry' which can be removed to save memory. This also fixes a coding style issue reported by checkpatch where we are suggested to make assignment outside the if statement. Reviewed-by: Jaroslav Kysela Signed-off-by: Anupama K Patil --- v2: Added Reviewed-by: tag drivers/pnp/isapnp/proc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index 785a796430fa..1ae458c02656 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c @@ -57,21 +57,20 @@ static const struct proc_ops isapnp_proc_bus_proc_ops = =3D { static int isapnp_proc_attach_device(struct pnp_dev *dev) { struct pnp_card *bus =3D dev->card; - struct proc_dir_entry *de, *e; char name[16]; =20 - if (!(de =3D bus->procdir)) { + if (!bus->procdir) { sprintf(name, "%02x", bus->number); - de =3D bus->procdir =3D proc_mkdir(name, isapnp_proc_bus_dir); - if (!de) + bus->procdir =3D proc_mkdir(name, isapnp_proc_bus_dir); + if (!bus->procdir) return -ENOMEM; } sprintf(name, "%02x", dev->number); - e =3D dev->procent =3D proc_create_data(name, S_IFREG | S_IRUGO, de, + dev->procent =3D proc_create_data(name, S_IFREG | S_IRUGO, bus->procdir, &isapnp_proc_bus_proc_ops, dev); - if (!e) + if (!dev->procent) return -ENOMEM; - proc_set_size(e, 256); + proc_set_size(dev->procent, 256); return 0; } =20 --=20 2.25.1 --wpqdbbx7thmklwzk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEDSQZGCDcREXgcOjQtGmOOZV75b4FAmCJudUACgkQtGmOOZV7 5b7ZGQv+OsD9HAhDMBbsq6Ute4rDohSUul6M4rW7LUnq+WnRUnvrNCr2LmgavQCT 2t6y8PDlb2lREPK3/I8bbIky5uX5d+/sC83qNpoKzhvYbepC/fptg/33OFIe3hbR gbPrRmkDkqM8yhE/fOkQYSLGBnvFSzjSulh3VhcQlLkLsG5MmOHFzuyMsO0ANp58 0JzH181yuYUF9A+Q7+xoizF570q4Q9vmi88N5u7TEey3JLOwqMa9bu0ynGYHpzIn DLFMfpZQNsOLX6Fy/mztzx0FZLb8H9xoHv7g0ypQExfIA/BPWcpPjs88AC0lhgTL QxquiBbR6s37zM4ktMjwxOzu1bCHJK0SdmkXxWi1hlFuylxaDMbZI4tjfNjq3KsC FZRuD31uKt7XQ/Q+8UZwoq2Bo4M3KIU8LaPy238Ef5p9L6QKS56+DKiu/LCEMCSV 6g8ASBxTB7mg3sxJiumP+xe9KKYEGETfwqLyC1hJ5cDvTtGvMkBS4glM0X8Dp3W5 fbekUmGL =csKr -----END PGP SIGNATURE----- --wpqdbbx7thmklwzk--