Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2562595lqp; Mon, 25 Mar 2024 02:41:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkxD/AK0yTnRT7sHpGQYPmZo769yvKGhFAeGQor+RSbBTAxorSVCs7kFt4n2qQI3gaZwa1ym5iQplz9xIN33FJ1oKnIMp5Hv1lYuDaIQ== X-Google-Smtp-Source: AGHT+IGNP+TA2xjvk3P2CtcJ3bv8iYGIjKCgP0HT7JYxqM5k8T+PcMSlHbhbxPCKHIBMYGIqUtA3 X-Received: by 2002:a17:90b:f08:b0:29c:6c79:7e92 with SMTP id br8-20020a17090b0f0800b0029c6c797e92mr4052235pjb.19.1711359686982; Mon, 25 Mar 2024 02:41:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711359686; cv=pass; d=google.com; s=arc-20160816; b=uNCH7GUv2b2BKVjqeZq0fZ+RdBj6ayRIi8MUYDBpPttdUrFcLeyUsY6fpvVfKJs2hg /ynJvlrjP/+Cfmxaoij5MIb3cyBiTEiq2k1hEeHrXXXktXKTaUcFAbFI/UCOxpO6J18p fNkbMjUlzRjUxo5UyEiutUTTJ04I04QbVxBc54ggv0XJ0xcDazV541Fd2h+EKcxQHXCC oJQgTWpw6iQzCja+JQJmc30StO1uogB0HS4zRMD9ruBYb9p+AqKybrxCGG1vzCcodEpD zFUbjzKX7gWST1aNU9RM+ZeaXCpYmN/N5ezuoKjU+KR4qZZLdrGgc2oUC1/dasojHr5s ceTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PRly/F5B4kOA26bva8vFYZQK+a6jVYWCu3O8IVCE+Rw=; fh=HBVRuy5tbdj0JGMxfckQmFnqetpQsbY3omNnyb3a4sM=; b=RvuEadaMjJRWZHGdu4on7ftwMuIeoUFCtxTW1Hcb7HtGxgWkp75rcarUPbYjKmLgsO sMMwcNfklSko6c3eA40onAd0t9OImRmP000wiZq3GIP+XjwMx1jClyPpSd4IrmmsRlHx JV5k8XduDb91Hh1K7aVwfBtXaJ7Hia2e7U1Dej9cklwRC7Urk2QeIp0aBefSFGx+GuYY BbOfrOmMUUS//FvNtGEb8ikWg0vVTy5Ckt4kvqbDEnYfP4loqJW5Y7M3Oc+YhAHT6ToS UXt76g/8ySE3+Qap9YaZ5A/yw0YJksd4LWq81vHRe90IvFKwWyN0fqUa92INQOIMLQCk c7BA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DHvBdHIW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115802-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h23-20020a17090aa89700b002a04dbed2c6si4772230pjq.131.2024.03.25.02.41.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:41:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115802-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DHvBdHIW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115802-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id ACC84B30E58 for ; Mon, 25 Mar 2024 08:06:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86C0E373FAC; Mon, 25 Mar 2024 03:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DHvBdHIW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 230435337A; Sun, 24 Mar 2024 23:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321989; cv=none; b=WwfxnmTSUfNg9z/hHavmCaNNqGOp4gg4fMCaDEAwsCgMHFs91/etVMY50+lbN/ZNjijQO5qYHSk8GdEeQcgCHuHWfWQRKl/xKd4eUJxY7VZIZ3aD2UejZJRX++m5jbSbTjukFy7kG/6XF276FSiXjkW90aRU08tcGghIwJuHv8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321989; c=relaxed/simple; bh=T01oWxM0cSn3XoUwfsJfAhLxhamBBQ3mV/cshIUH00o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FwfSXxPSFPfN6lXyUGW1hKtbYdBCWjWsqBxs51std6eYRry3IYfwgA4xWDgFfMPgBMJ/Hz+Db4mTUqssx4LHlOuxZDQg2dhdf5+7dYa2YuBC6tQV14bjiIUlCaxCdMPiAfNk1q5ANekzmb1nhi8ecSGveIMOOa+ltmFehzt4YiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DHvBdHIW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D552C43390; Sun, 24 Mar 2024 23:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321989; bh=T01oWxM0cSn3XoUwfsJfAhLxhamBBQ3mV/cshIUH00o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHvBdHIW9aCFCJ9g9zj3Vrm9mCydqIRGvauLE2Y+WfpgytPGkXQBRDjbo/oNngeXA ZzZa3bNjCDCQ/l0L0QbxDcTzb37TmRQaSdSlTTukBu7ANU8idy5oH1hD/rlJnBB3WI uxHnwWZ5ob+vMFoK6uSZ/Pth8NZ2ZMjoK36z3KNhKe5zX5yicV2S+bjlITKSXUi8Rp yXgLeg/7DASDYg6a5g5jfe6i7LOEbzFApb7UD1WXA84ojW2r7P/4hjMlOvwZs/cvct RNO8falwItxajA9X0Fn8cQIhpT46L0Q/yJbu36V3AfM8sXA/XH445oBCUE2L8hOCkB V7+7LkWiEF8hg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Jan=20H=C3=B6ppner?= , Stefan Haberland , Jens Axboe , Sasha Levin Subject: [PATCH 6.1 061/451] s390/dasd: Use dev_*() for device log messages Date: Sun, 24 Mar 2024 19:05:37 -0400 Message-ID: <20240324231207.1351418-62-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jan Höppner [ Upstream commit 79ae56fc475869d636071f66d9e4ef2a3819eee6 ] All log messages in dasd.c use the printk variants of pr_*(). They all add the name of the affected device manually to the log message. This can be simplified by using the dev_*() variants of printk, which include the device information and make a separate call to dev_name() unnecessary. The KMSG_COMPONENT and the pr_fmt() definition can be dropped. Note that this removes the "dasd: " prefix from the one pr_info() call in dasd_init(). However, the log message already provides all relevant information. Signed-off-by: Jan Höppner Reviewed-by: Stefan Haberland Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20240208164248.540985-10-sth@linux.ibm.com Signed-off-by: Jens Axboe Stable-dep-of: c3116e62ddef ("s390/dasd: fix double module refcount decrement") Signed-off-by: Sasha Levin --- drivers/s390/block/dasd.c | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 2f6976671496f..029bb9e15ad90 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -8,9 +8,6 @@ * Copyright IBM Corp. 1999, 2009 */ -#define KMSG_COMPONENT "dasd" -#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt - #include #include #include @@ -3390,8 +3387,7 @@ static void dasd_generic_auto_online(void *data, async_cookie_t cookie) ret = ccw_device_set_online(cdev); if (ret) - pr_warn("%s: Setting the DASD online failed with rc=%d\n", - dev_name(&cdev->dev), ret); + dev_warn(&cdev->dev, "Setting the DASD online failed with rc=%d\n", ret); } /* @@ -3478,8 +3474,11 @@ int dasd_generic_set_online(struct ccw_device *cdev, { struct dasd_discipline *discipline; struct dasd_device *device; + struct device *dev; int rc; + dev = &cdev->dev; + /* first online clears initial online feature flag */ dasd_set_feature(cdev, DASD_FEATURE_INITIAL_ONLINE, 0); device = dasd_create_device(cdev); @@ -3492,11 +3491,10 @@ int dasd_generic_set_online(struct ccw_device *cdev, /* Try to load the required module. */ rc = request_module(DASD_DIAG_MOD); if (rc) { - pr_warn("%s Setting the DASD online failed " - "because the required module %s " - "could not be loaded (rc=%d)\n", - dev_name(&cdev->dev), DASD_DIAG_MOD, - rc); + dev_warn(dev, "Setting the DASD online failed " + "because the required module %s " + "could not be loaded (rc=%d)\n", + DASD_DIAG_MOD, rc); dasd_delete_device(device); return -ENODEV; } @@ -3504,8 +3502,7 @@ int dasd_generic_set_online(struct ccw_device *cdev, /* Module init could have failed, so check again here after * request_module(). */ if (!dasd_diag_discipline_pointer) { - pr_warn("%s Setting the DASD online failed because of missing DIAG discipline\n", - dev_name(&cdev->dev)); + dev_warn(dev, "Setting the DASD online failed because of missing DIAG discipline\n"); dasd_delete_device(device); return -ENODEV; } @@ -3526,8 +3523,8 @@ int dasd_generic_set_online(struct ccw_device *cdev, /* check_device will allocate block device if necessary */ rc = discipline->check_device(device); if (rc) { - pr_warn("%s Setting the DASD online with discipline %s failed with rc=%i\n", - dev_name(&cdev->dev), discipline->name, rc); + dev_warn(dev, "Setting the DASD online with discipline %s failed with rc=%i\n", + discipline->name, rc); module_put(discipline->owner); module_put(base_discipline->owner); dasd_delete_device(device); @@ -3536,16 +3533,15 @@ int dasd_generic_set_online(struct ccw_device *cdev, dasd_set_target_state(device, DASD_STATE_ONLINE); if (device->state <= DASD_STATE_KNOWN) { - pr_warn("%s Setting the DASD online failed because of a missing discipline\n", - dev_name(&cdev->dev)); + dev_warn(dev, "Setting the DASD online failed because of a missing discipline\n"); rc = -ENODEV; dasd_set_target_state(device, DASD_STATE_NEW); if (device->block) dasd_free_block(device->block); dasd_delete_device(device); - } else - pr_debug("dasd_generic device %s found\n", - dev_name(&cdev->dev)); + } else { + dev_dbg(dev, "dasd_generic device found\n"); + } wait_event(dasd_init_waitq, _wait_for_device(device)); @@ -3556,10 +3552,13 @@ EXPORT_SYMBOL_GPL(dasd_generic_set_online); int dasd_generic_set_offline(struct ccw_device *cdev) { + int max_count, open_count, rc; struct dasd_device *device; struct dasd_block *block; - int max_count, open_count, rc; unsigned long flags; + struct device *dev; + + dev = &cdev->dev; rc = 0; spin_lock_irqsave(get_ccwdev_lock(cdev), flags); @@ -3580,11 +3579,10 @@ int dasd_generic_set_offline(struct ccw_device *cdev) open_count = atomic_read(&device->block->open_count); if (open_count > max_count) { if (open_count > 0) - pr_warn("%s: The DASD cannot be set offline with open count %i\n", - dev_name(&cdev->dev), open_count); + dev_warn(dev, "The DASD cannot be set offline with open count %i\n", + open_count); else - pr_warn("%s: The DASD cannot be set offline while it is in use\n", - dev_name(&cdev->dev)); + dev_warn(dev, "The DASD cannot be set offline while it is in use\n"); rc = -EBUSY; goto out_err; } @@ -3947,8 +3945,8 @@ static int dasd_handle_autoquiesce(struct dasd_device *device, if (dasd_eer_enabled(device)) dasd_eer_write(device, NULL, DASD_EER_AUTOQUIESCE); - pr_info("%s: The DASD has been put in the quiesce state\n", - dev_name(&device->cdev->dev)); + dev_info(&device->cdev->dev, + "The DASD has been put in the quiesce state\n"); dasd_device_set_stop_bits(device, DASD_STOPPED_QUIESCE); if (device->features & DASD_FEATURE_REQUEUEQUIESCE) -- 2.43.0