Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp220271pxj; Tue, 18 May 2021 01:40:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr9zXp3OwBTNWLsPCRuIyucD0y7s3GiJez5cE1l5alHUvUIArbGMLjuzvYlZACOdbEX6sN X-Received: by 2002:a92:c8d2:: with SMTP id c18mr3256437ilq.54.1621327205243; Tue, 18 May 2021 01:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621327205; cv=none; d=google.com; s=arc-20160816; b=L7TDbWt2FNbmHS5r/9IzLkwvFp5FuI2NL/4HHYqOBUlfAn7YS8uF0OKTrtPovu9S8e xB7XaeHCzUfRGOstfvc2iHn+CN/V5GdLZsUG0XpdzjnnvUsI+aeqXkKHl6eS2ovIwRe6 OL4hy+z970klK0gENvONecPPyL9WoCWlVZ2gYRBMhh8xd6pZ2xyB0ofyTWWiVMAqDF4x XKKkvOvBjiLOqXDiw/NgcCuZlkbsh1jJA0hybmDjOXj3ckmw8h8fhRZ7H23lH+JZg4tq +ZD7w7KqBrs9o6Yb/q2oaTiJQ91yDmmszlq5vB+GH7/kBG7orlqBvWin0cfOPWRDK68M MU7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=He+qVgUj6KmNb1BGjrbB0Gl63WV0jKVgGssDWDzSwlg=; b=YtgCe2+m+gJ3AlIwcIgfkIWtJ4WAqo3hNEF+sTcBcaca1KfuuqoI081YkvzxjdQ8YV OfqOtZKYs4+tXn5kEz6ZP+xmgVjPMq867XOfnfQR4Wrng3SV1Kork6yi5v7BrlqdUEsh 8zSsZnRqB7u+aC58vuecn1MNZYeo0aINN9nsC/6bC1Zo/7OQu1OPDTWQc7UFg1tYVKXW nPYS7aFGCuDuGYuQTA7lbh7Sly7EfDlfy2AU33gjCMS5e3GcwKyCddU4GjiwUkEaaCGq wzuftqsQR9Cj4WbQ5XBfRLS5BY8gcvzKgYbEo9BuWy6/D47fHURDVGouY3UWP9+vqs6G AjCQ== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v30si612511jal.60.2021.05.18.01.39.53; Tue, 18 May 2021 01:40:05 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240538AbhEQPAe (ORCPT + 99 others); Mon, 17 May 2021 11:00:34 -0400 Received: from mail-oo1-f51.google.com ([209.85.161.51]:42791 "EHLO mail-oo1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241301AbhEQOum (ORCPT ); Mon, 17 May 2021 10:50:42 -0400 Received: by mail-oo1-f51.google.com with SMTP id v13-20020a4ac00d0000b029020b43b918eeso1517914oop.9; Mon, 17 May 2021 07:49:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=He+qVgUj6KmNb1BGjrbB0Gl63WV0jKVgGssDWDzSwlg=; b=lv04GtrJVnx1tnGbc9q1GoskNBgxH34FIyTrv9OdzCIXiL+6UMjpsEHs22ecF3TkA6 uhZNaBsjQKb5rERcbNJh4jtMXCGnHUTNnsekQYyq8d72LUccC29xz0q6plYf/IOioBUT hsfJdkdFwDBqGDW+y/9XbvskGlF6PWDgrqpBJk4yRbH6Zmlkt3jKodXeP5K2es+cNm2l pfYmfi5nPkwbcn1d8KMbiayGJ0HligD3sVwU0ZkTw467lV2BDOy4vZzb9sxM7Wr6jv2e Uh2kJryzihapcC51l/o4a/hwlLG7rkQ8CfKGqscFTVPa4+nlIrU4nitzwlG9YbberTIl sw7g== X-Gm-Message-State: AOAM533Kr+Vo6t86eShRphjurqG19kOqQEBrSjpsinI1XKQoVCw1gne7 iQ5RdFN87FHppDLGVfjqa/F7CmRJnpAZC25TnE1cdeFe X-Received: by 2002:a4a:ab83:: with SMTP id m3mr251394oon.2.1621262966086; Mon, 17 May 2021 07:49:26 -0700 (PDT) MIME-Version: 1.0 References: <20210428193901.rqs64di4g2svpaeg@ubuntu> In-Reply-To: <20210428193901.rqs64di4g2svpaeg@ubuntu> From: "Rafael J. Wysocki" Date: Mon, 17 May 2021 16:49:15 +0200 Message-ID: Subject: Re: [PATCH v2] drivers: pnp: proc.c: Removed unnecessary variables To: Anupama K Patil Cc: Jaroslav Kysela , "Rafael J. Wysocki" , ACPI Devel Maling List , Linux Kernel Mailing List , B K Karthik Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 9:39 PM Anupama K Patil wrote: > > 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 = { > static int isapnp_proc_attach_device(struct pnp_dev *dev) > { > struct pnp_card *bus = dev->card; > - struct proc_dir_entry *de, *e; > char name[16]; > > - if (!(de = bus->procdir)) { > + if (!bus->procdir) { > sprintf(name, "%02x", bus->number); > - de = bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir); > - if (!de) > + bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir); > + if (!bus->procdir) > return -ENOMEM; > } > sprintf(name, "%02x", dev->number); > - e = dev->procent = proc_create_data(name, S_IFREG | S_IRUGO, de, > + dev->procent = 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; > } > > -- Applied as 5.14 material with edits in the subject and changelog, thanks!