From nobody Fri Dec 19 18:52:47 2025 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 E6EE11FEC63; Sun, 24 Mar 2024 23:02:37 +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=1711321359; cv=none; b=N0naq1vYtBzk23q0EcFa7srpntU33HH1ko/rZygcZZdORdBxjxpxI2LO8EHTGv2nb0Q7jWukiAOfk/O/haONXQCelGBMEuwVl3yb4a6yv9aM92SPcbtWUeA/2mq0LphtH6mda9aBJitTtJBZkfysdchyD/SGqlIw8KR5BxMBdM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321359; c=relaxed/simple; bh=iH8ah7eXZyotmaETHj9KsAjfEUDrdDwPbT1nWVVgCc0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cw6zCDJJ4Fm90LRoAcJrCxY8+KXK0GcxmnzyAfsHDV0hfq+lSZ+q066j7RbgrRLaZpJYDlIQwSLF/JSvS//bqraJpUh9Uy5kAjgZZYiPXc2YlojNdh69PkemFtz7L5j2mUUiKzbg1IHh/0QnI4t3PhoCvHJ8TIRrbzzmSJGA06A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jsXzgGh0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jsXzgGh0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE17FC43394; Sun, 24 Mar 2024 23:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321357; bh=iH8ah7eXZyotmaETHj9KsAjfEUDrdDwPbT1nWVVgCc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jsXzgGh0dOJGhVwNEXCHxbIuZMW6guyWIZqc2iyT+ANbdTV8AqK/IIKcxs3fT7CXE ymeVHPijaLQNTrsjc2NVN2piSeZ1JjdKfGnGcKwW015iTYxhW6jjBOzcSREUXphllg qEkZgzpCR9Mn3iGWY3qCIo7jCqMy9ZWoGi2PaNQjSHksDs6fAmtjTRtBEjYeg50nmc 1V+hcJJQzFcKIDDUO9RI015OJEUFP/wNHI/i8al1obvAhL1BsZxvc9bNJ39lLsKqgA bRG7+Y47q8B/rUPa3h6hokgkcP29HoS2iq9jSZ7c01ZFDusxqznJsQQ3J6PYqV2uz9 Zl7v8xWiFfjLw== 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.6 082/638] s390/dasd: Use dev_*() for device log messages Date: Sun, 24 Mar 2024 18:51:59 -0400 Message-ID: <20240324230116.1348576-83-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324230116.1348576-1-sashal@kernel.org> References: <20240324230116.1348576-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: quoted-printable From: Jan H=C3=B6ppner [ 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=C3=B6ppner 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 decreme= nt") 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 5b11ee9234573..96f4c94865846 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -8,9 +8,6 @@ * Copyright IBM Corp. 1999, 2009 */ =20 -#define KMSG_COMPONENT "dasd" -#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt - #include #include #include @@ -3406,8 +3403,7 @@ static void dasd_generic_auto_online(void *data, asyn= c_cookie_t cookie) =20 ret =3D ccw_device_set_online(cdev); if (ret) - pr_warn("%s: Setting the DASD online failed with rc=3D%d\n", - dev_name(&cdev->dev), ret); + dev_warn(&cdev->dev, "Setting the DASD online failed with rc=3D%d\n", re= t); } =20 /* @@ -3494,8 +3490,11 @@ int dasd_generic_set_online(struct ccw_device *cdev, { struct dasd_discipline *discipline; struct dasd_device *device; + struct device *dev; int rc; =20 + dev =3D &cdev->dev; + /* first online clears initial online feature flag */ dasd_set_feature(cdev, DASD_FEATURE_INITIAL_ONLINE, 0); device =3D dasd_create_device(cdev); @@ -3508,11 +3507,10 @@ int dasd_generic_set_online(struct ccw_device *cdev, /* Try to load the required module. */ rc =3D 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=3D%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=3D%d)\n", + DASD_DIAG_MOD, rc); dasd_delete_device(device); return -ENODEV; } @@ -3520,8 +3518,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 disc= ipline\n", - dev_name(&cdev->dev)); + dev_warn(dev, "Setting the DASD online failed because of missing DIAG d= iscipline\n"); dasd_delete_device(device); return -ENODEV; } @@ -3542,8 +3539,8 @@ int dasd_generic_set_online(struct ccw_device *cdev, /* check_device will allocate block device if necessary */ rc =3D discipline->check_device(device); if (rc) { - pr_warn("%s Setting the DASD online with discipline %s failed with rc=3D= %i\n", - dev_name(&cdev->dev), discipline->name, rc); + dev_warn(dev, "Setting the DASD online with discipline %s failed with rc= =3D%i\n", + discipline->name, rc); module_put(discipline->owner); module_put(base_discipline->owner); dasd_delete_device(device); @@ -3552,16 +3549,15 @@ int dasd_generic_set_online(struct ccw_device *cdev, =20 dasd_set_target_state(device, DASD_STATE_ONLINE); if (device->state <=3D DASD_STATE_KNOWN) { - pr_warn("%s Setting the DASD online failed because of a missing discipli= ne\n", - dev_name(&cdev->dev)); + dev_warn(dev, "Setting the DASD online failed because of a missing disci= pline\n"); rc =3D -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"); + } =20 wait_event(dasd_init_waitq, _wait_for_device(device)); =20 @@ -3572,10 +3568,13 @@ EXPORT_SYMBOL_GPL(dasd_generic_set_online); =20 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 =3D &cdev->dev; =20 rc =3D 0; spin_lock_irqsave(get_ccwdev_lock(cdev), flags); @@ -3596,11 +3595,10 @@ int dasd_generic_set_offline(struct ccw_device *cde= v) open_count =3D 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 =3D -EBUSY; goto out_err; } @@ -3960,8 +3958,8 @@ static int dasd_handle_autoquiesce(struct dasd_device= *device, if (dasd_eer_enabled(device)) dasd_eer_write(device, NULL, DASD_EER_AUTOQUIESCE); =20 - 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); =20 if (device->features & DASD_FEATURE_REQUEUEQUIESCE) --=20 2.43.0