From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44D04478843 for ; Fri, 15 May 2026 11:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778843414; cv=none; b=D1X7achE5KO1ZN3aClEpBWllsVIeG/zW6jhJTIbeT2WwFCKEYU4ktdYwS25QtPK2XXnJc18gUOdUMmWn4nf+fA/0eZIVXcAdPmLNzVRwtTmAFV6n0Q9YGGeolbtAmzRYCfd1CAPTFqP9LcEEnyDWQxE5r4RteNqxEAuaOley42o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778843414; c=relaxed/simple; bh=eyLj1Y8O3foCF54U8Qz86c9Ndu4lUoiNJ1e4LruAnnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JGj3kdByzdsvbiSPoORe3MpZ1jT6lodJAh5xgQdmhhQGacCZOTMAGGbcra5NpeE93jZQrk4KFZyKWyNs5ik5rVnxXeXucusUVP5FDLMsUjOviQlvOoC51XLTH+vBARbOM8IP0hqznjZiUwIWwJw4RaXzSH7CYT31E7U62Bmk+vA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=p6aJjsXw; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p6aJjsXw" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-c798fc1a28cso4293190a12.3 for ; Fri, 15 May 2026 04:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778843412; x=1779448212; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PlIr2DfZQIdjqO1PohDAMuDJ1pNth5joQyu5k813drM=; b=p6aJjsXw/9iH6YDyNytS0udeVf0hoZS1yfFPZF/jx2ZBjoSO/wINSzlmWa59+QYtj/ VbvIX4Xf7X7MrAUrZAjcWzgBBL0D4KgvTZ+qVvGveR6bR5JprzkN1PiUw4ZDhfRPZRhx rc3zgaNM546EZdhmOOAq2YElVFS854QwxMsDkEyhoovV41Bbjl777wwO/tISESnIokKq A6JG8tUGf5UY2VFtHbLDhjvnzJ1ksIzqWEzzJ633cI2LdG4Hb7UN5GAZ3tCcQ0KOCePp Q08pPtnQUCBiNtudZbyXONBXwY7DG5+MuQnNOLj/DTRa8spy5vVY0NgvIp15ilDfNfa9 BrUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778843412; x=1779448212; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PlIr2DfZQIdjqO1PohDAMuDJ1pNth5joQyu5k813drM=; b=BqdECy2H3iSppQJ67fRYivkMLIdKJXJCuy2BdrMF9RthiyGrVvtwA0HEwdOnLUykNX 6EO4EVd4wj2adopulLiJQhnnsPk9iH/0Xi6O3krPYF7bFSP7qfNLelcXemTg882/Kihr As+NsKnPyfKt56bmbkDmeSu3OYg2yZ6Rli0ekubDCTEnwJAGBqXUZesi/RyihrcjriHN Zg88A2rda8PHaSp1wkhPAfGKgY41ykSGKw+xsLaFoRf3nyqhUgvRKWxP+l3xTvqbXHUM zL0ZTxyCM+wuVOsMCTMhaLx7afHKD2TyDgIcXQN48BaLGrRLq08qY6IGRoDnApeLd3gB BZlg== X-Forwarded-Encrypted: i=1; AFNElJ+U3AEMnuOccerAP/dpsHqQf5RaDLHbEvFtX59lDlHFLZalZJyPDX/Hhm4i9BikWL0vBeyhLn4ZV+cYqxs=@vger.kernel.org X-Gm-Message-State: AOJu0YxP6Pf/hoduJbwLcvvdDd5qfopnnc+f7GznxltgfszirXsS92F9 CfyyVcUbApvIEaFMjiK4315PzmGKMIYwi+8UJpqs2y/Oe50ActkL+MTSvp63n8M/jnY= X-Gm-Gg: Acq92OFEYGZ4Ikfp61am9KU7rOqWIMy/RD6hdCRXN/P75N3XlLkJzPiXzFMHia4VDyy 0OX8w4Rl898ksJl0H/DSFQxSN++0FXi6l/mRgYL9mlrDrNXUBgXnY1dF9wlFufw2pXjd3GiGSUA E/dMGwlVYQZVgPnSVack0+phI7HSyU4GTQL+Qq+m0AB1xFmCwyQP8I/qEkrkCrlXVldnMa0TeZa zgTm6B2KFtFB7zq37Tc8jqNfNyA01xxeAxjwnijWWwOQf6kU0k4n6G5nK4vFuw2ircryR3dFOt0 4h+bD9mTnczwsDNjiZk86GupxKT5uUVact45SetTOgfxziP3Fr0y4U6/+K9UuTveGBz0JB2ifpn 1agjCucvQkCS5XEU6zg2w4xj4dh7tYJcasS5fq7SRzUlcGVpurTIu/0w8+OuPxvFlmjFHu/zJIl fYeEcR59coRp0HOnNCzPCQ6V7OavvwlYVlDXEQEnIS X-Received: by 2002:a17:902:f788:b0:2b0:61c2:8e83 with SMTP id d9443c01a7336-2bd7e88f4a9mr40644855ad.20.1778843412499; Fri, 15 May 2026 04:10:12 -0700 (PDT) Received: from localhost.localdomain ([2405:201:d008:80b:a00:27ff:feb6:42dd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5c264241sm54566645ad.36.2026.05.15.04.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 04:10:11 -0700 (PDT) From: Pramod Maurya To: bhelgaas@google.com Cc: kees@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, pramod.nexgen@gmail.com Subject: [PATCH v1 1/1] PCI: ibmphp: Simplify ibmphp_init_devno() to take struct slot * Date: Fri, 15 May 2026 07:09:44 -0400 Message-ID: <20260515110944.216993-2-pramod.nexgen@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260515110944.216993-1-pramod.nexgen@gmail.com> References: <20260515110944.216993-1-pramod.nexgen@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ibmphp_init_devno() takes a struct slot ** parameter but only ever dereferences it to access the slot's fields. No re-assignment of the pointer itself is performed, so the double indirection is unnecessary. Simplify the function to take a struct slot * instead, update all internal accesses from (*cur_slot)-> to cur_slot->, and update the single call site in ibmphp_ebda.c to pass tmp_slot directly instead of &tmp_slot. Signed-off-by: Pramod Maurya --- drivers/pci/hotplug/ibmphp.h | 3 ++- drivers/pci/hotplug/ibmphp_core.c | 30 +++++++++++++++--------------- drivers/pci/hotplug/ibmphp_ebda.c | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/pci/hotplug/ibmphp.h b/drivers/pci/hotplug/ibmphp.h index c248a09be7b5..e80c45eeaa73 100644 --- a/drivers/pci/hotplug/ibmphp.h +++ b/drivers/pci/hotplug/ibmphp.h @@ -733,7 +733,8 @@ struct controller { /* Functions */ -int ibmphp_init_devno(struct slot **); /* This function is called from EBDA, so we need it not be static */ +/* ibmphp_ebda.c calls this, so it cannot be static */ +int ibmphp_init_devno(struct slot *cur_slot); int ibmphp_do_disable_slot(struct slot *slot_cur); int ibmphp_update_slot_info(struct slot *); /* This function is called from HPC, so we need it to not be static */ int ibmphp_configure_card(struct pci_func *, u8); diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index aca86c092d4a..b122769baee1 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c @@ -109,7 +109,7 @@ static int __init get_max_slots(void) * Parameters: struct slot * Returns 0 or errors */ -int ibmphp_init_devno(struct slot **cur_slot) +int ibmphp_init_devno(struct slot *cur_slot) { struct irq_routing_table *rtable; int len; @@ -130,21 +130,21 @@ int ibmphp_init_devno(struct slot **cur_slot) return -1; } for (loop = 0; loop < len; loop++) { - if ((*cur_slot)->number == rtable->slots[loop].slot && - (*cur_slot)->bus == rtable->slots[loop].bus) { - (*cur_slot)->device = PCI_SLOT(rtable->slots[loop].devfn); + if (cur_slot->number == rtable->slots[loop].slot && + cur_slot->bus == rtable->slots[loop].bus) { + cur_slot->device = PCI_SLOT(rtable->slots[loop].devfn); for (i = 0; i < 4; i++) - (*cur_slot)->irq[i] = IO_APIC_get_PCI_irq_vector((int) (*cur_slot)->bus, - (int) (*cur_slot)->device, i); - - debug("(*cur_slot)->irq[0] = %x\n", - (*cur_slot)->irq[0]); - debug("(*cur_slot)->irq[1] = %x\n", - (*cur_slot)->irq[1]); - debug("(*cur_slot)->irq[2] = %x\n", - (*cur_slot)->irq[2]); - debug("(*cur_slot)->irq[3] = %x\n", - (*cur_slot)->irq[3]); + cur_slot->irq[i] = IO_APIC_get_PCI_irq_vector((int) cur_slot->bus, + (int) cur_slot->device, i); + + debug("cur_slot->irq[0] = %x\n", + cur_slot->irq[0]); + debug("cur_slot->irq[1] = %x\n", + cur_slot->irq[1]); + debug("cur_slot->irq[2] = %x\n", + cur_slot->irq[2]); + debug("cur_slot->irq[3] = %x\n", + cur_slot->irq[3]); debug("rtable->exclusive_irqs = %x\n", rtable->exclusive_irqs); diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index c1939b88e75b..0b018ae3b348 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c @@ -880,7 +880,7 @@ static int __init ebda_rsrc_controller(void) if (rc) goto error; - rc = ibmphp_init_devno(&tmp_slot); + rc = ibmphp_init_devno(tmp_slot); if (rc) goto error; tmp_slot->hotplug_slot.ops = &ibmphp_hotplug_slot_ops; -- 2.52.0