From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 D808042F6E1 for ; Tue, 21 Jul 2026 06:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784616897; cv=none; b=WhW7MmbwFDoRSx7sj1MqwLh94Yk6fVqjJ4yA/jTIbYkMyAj/iVqyFmb9kTp9HfCqxCZHisflErb2KfCHWGCR8YhniXBIqqa+RI+M3G+aVG1IRqR3WDHWZI5vtMyX8tbQaLX1m2QLmaigPT2dlONJ3+Qxif4BCQcAqWeMGdMH+ZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784616897; c=relaxed/simple; bh=DZukzCQ7CZkay93mS9H4jkJ+htZvTV7aL2cJyc7/2CA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fFYX0Y/CnJIVW+HMWK6dspoL7+NkyTMjSmoiaapoK0HIenoXRGfhzkovomSePkB3V29pk1pxds9fdRlf0B9cPeylGpD4ljm+iQMonayAgqqAMvIYg3e0ifWvhGs3E14LNQMuTg0/YSyswmyEP9PdzgDY73uHKlCFDSSCV1jYZPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=TRp4Tdb5; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TRp4Tdb5" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2cf6d65d8a7so22145995ad.0 for ; Mon, 20 Jul 2026 23:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784616895; x=1785221695; 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:content-type; bh=Xc02KBsQrd1xdK8Ho0VEf5G63Rz5XQrKjQwFcbcQ37E=; b=TRp4Tdb53zpmXKorIc41xp1t8wmTayjsPM4PK5fPlj1LSUfXfcSXEPOmVz/58B7vKZ iDUEJRXDZ/SSSqXFjHvPSk3EKVH0FBDIlcx4Gx8tvzKd9kqrrAPSffOt/NAOH/u5l1pQ aKgfclmZXnBQ9fswEwto2MwK0vlbPfOyucXbo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784616895; x=1785221695; 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:content-type; bh=Xc02KBsQrd1xdK8Ho0VEf5G63Rz5XQrKjQwFcbcQ37E=; b=klVHBcD8ZdVHCSGDUlei1g9pVdMFSC6WjWW6Qj1bewcbo2RbQSqZ8xEwx/wO5OCPJI F3amoMVmdaWLuSFSrils7rTH+jT/YUzZ5wxIkXYtsEGXgr6+r1Gw0XUeXU/lUmH31r7K oVTYAEqbC+nrjQ7ugc+3ETjvEpnHWIb1d4yl5A7N+QJ4WMJFYm7j9ZKnHD82k62k8uZs BSYIH6XpVsqJAs3RNKO+xi2cKfwbmUSZKos+Wclp12LhVu3dD71K9ao2Ok2+xDjI0QJI pvL24ytbITDjiXmr6R8Fv0YST4dACF6SU0SodNMkmT7Ae0f2mjWBeFTu6f+vErdXiRJh N6VQ== X-Forwarded-Encrypted: i=1; AHgh+RoNM/vLuqEqh8k4CnXDzCI98u86tna9XzmVi8BvcbYolUBxxSGS1AR2lLNXldh0DmZWtGUbaJXICK/C1sw=@vger.kernel.org X-Gm-Message-State: AOJu0YxcXE0JW6E0q8dJ2TSoaZ9nm+QM13g0swNKoPf0S9aBppYSQArx mGJMNRXIO1rSiTOWHVNthfBI39B/07P2f5poy8vqvcdEAIuELKf3dyQPEKPNoYka+Q== X-Gm-Gg: AR+sD10t5STrFceEZ6+2mMrtwjxRVtp0N1GJRGYZyB+5HK9YVcVSp4Vom9TF54a2V4u 2ltUc91RyBmiNxOOgFc35pBRxhHwkAuampCOeW/3jJ81IQALWEuBd2E/kxB3gJthgjCp0FXNNhA 1BhliULmwfCbezhVfxGLlWBaf9IfzJLrjMopigNMEUOgyZWEWOlxiFPa163xpm+Eit9ZLsoPYZG Md2+DdmgQ3QqK6lHJOHjclN3ix62FYaHgxhRAZo3TOIgND0vnJ77sIgwK2sVQpqf2tkxlxrgf4G MEQJ9hemLMbRqhEzWIr+45Tnkt8N/Vcscbx7S5l1TklL2gWrHGKwQAPj3M0gyurm0yQviZ385Ir YNm23JN0fyxH1oYJu/Yg4quGHMRcloCgtMGxmxGvrhaI/aXmoTY2r7axckPZCRYl6osk51A5HlI xsW1e+8T854ZBz2bcnJoYDbpHhhwiKjdmW7R9B/tWI4/+6ENVVjKOdHpY4eNQ= X-Received: by 2002:a17:903:41c3:b0:2c7:1200:bd7e with SMTP id d9443c01a7336-2cf3486b0b1mr185750155ad.18.1784616895361; Mon, 20 Jul 2026 23:54:55 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448ee77sm69716005ad.4.2026.07.20.23.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 23:54:54 -0700 (PDT) From: Chen-Yu Tsai To: Bartosz Golaszewski , Greg Kroah-Hartman , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , "Rafael J. Wysocki" , Danilo Krummrich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Chen-Yu Tsai , linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Alan Stern Subject: [PATCH v6 04/16] usb: hub: Use assign_bit() in usb_hub_set_port_power() Date: Tue, 21 Jul 2026 14:53:59 +0800 Message-ID: <20260721065413.2306137-5-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721065413.2306137-1-wenst@chromium.org> References: <20260721065413.2306137-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit usb_hub_set_port_power() open-codes assign_bit(). Just use the assign_bit() macro instead. This makes subsequent additions to usb_hub_set_port_power() easier to read. This change does not introduce any functional changes. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Chen-Yu Tsai --- Attributing suggestion to Andy, since the change was originally requested as part of a review. Changes since v4: - New patch (split out from "usb: hub: Power on connected M.2 E-key connectors with power sequencing API") (Andy) --- drivers/usb/core/hub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 2cfe09a141d8..715f26f05a31 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -10,6 +10,7 @@ * Released under the GPLv2 only. */ +#include #include #include #include @@ -899,10 +900,7 @@ int usb_hub_set_port_power(struct usb_device *hdev, struct usb_hub *hub, if (ret) return ret; - if (set) - set_bit(port1, hub->power_bits); - else - clear_bit(port1, hub->power_bits); + assign_bit(port1, hub->power_bits, set); return 0; } -- 2.55.0.229.g6434b31f56-goog