Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2359879lqp; Sun, 24 Mar 2024 15:39:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWwWZR559n0heg0iHRTKspIK6CwSHq8INWoztaGPUPDIkGJVxBq1JqapfXthHG8IOB5RdOYXe0qm8eQm8a57zmB30wT87+N0WLgmvRfA== X-Google-Smtp-Source: AGHT+IH2GwIF2lb17mdMmssNs6hkD18gSBp0Fv3orfBHjMBmrSdJ5YKdpK4rW6iThbnKbDtHywuQ X-Received: by 2002:ac8:5795:0:b0:431:23c8:7aa3 with SMTP id v21-20020ac85795000000b0043123c87aa3mr5963159qta.13.1711319959066; Sun, 24 Mar 2024 15:39:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711319959; cv=pass; d=google.com; s=arc-20160816; b=McD11a8LxxsFeplPdCpzqG6rsX+x3PR2c30HZwv0mNggJFN6KsdDoP3ZFskQg3lrfp 1pbEiUVm1bGXjPHTDLtN+juloKesQO19TIfHiVR5ZbvaeC99L2pUlOah5kXvCAq+nzV+ 8pcgQQeZtLQa8FcMAY8S+vTMtI+UbriJZ6EkgmwEAcKloou+w6ufknfsSu1ooh8bmujB D8BzrzH8yKgGl3hva1LCM/3mPaSfnHeFzZR88DJRjgEz7Jp8qCqabf8B9V4/vxyNnwQ0 ZolZKtHsPTLE2pHRfCbSjXzkBalEjp9mrE6m0VPOn4zUYVescbjh4PaSy0IXzvgF0uY4 4arA== 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=4sddmLQcCNc4xzeIcqWXXLeVBjFx6ivpzgwWbdVG6fc=; fh=HBVRuy5tbdj0JGMxfckQmFnqetpQsbY3omNnyb3a4sM=; b=NynI+o/nJNZDwCKurgxRDXLqZajDn4n4+VXQi6wahdTTEh6u7LnHgvxwRK2XRMgIrF 1rN+bQZnWKnhoguTP7CI4OhgWfsJ/yQkaD7HhYruv7DaOx2W/3Moy0FLwZ06+27PmeB4 +5VzaclOItVmrdYMxJEVuNdqDNNx8ivUh7YC7opCl5UVTQhuwAsWB/1BySuIbpMO+66C 8bAsJWjvn+DVbnV8gkMAyea/5U9QtSz8sdj/GjZpCfuFq2nJCxeo6+wuRFJKmVvMrQ9+ wgqR9gn8PFkbx5OcPfnuTtcU/LLhj4TfIB7D4qhoFn1bya7eHXjTw80wYroIwA2GCE3y aJJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JH3rKjVH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cm24-20020a05622a251800b00430df37ffa5si4632897qtb.279.2024.03.24.15.39.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JH3rKjVH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112903-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B69391C21172 for ; Sun, 24 Mar 2024 22:39:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA50659B48; Sun, 24 Mar 2024 22:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JH3rKjVH" 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 899295789F; Sun, 24 Mar 2024 22:35:13 +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=1711319713; cv=none; b=bcFfLootJwItr5dBa6fM6YZ2xEFEG5y9yYZcr/DcvyFFiduJvstOxTdHyTAWDudeEhR5r08NVg5GQjECItEl2Cv/SH+9uCrHA7LwC0fwIqNVJKRIbWypxalu1gf+41/cva1wESAS1KjefvBXyceVHT3YYIrLXGgbD2vNRBBbUCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319713; c=relaxed/simple; bh=bFPh+6OA+JYDyi7jFiN5kCZbCRHA5RJ6L5tddcxC0pA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n1oE2NfnV7FGUXY4+y1Z32O/OLnksAo1gO+Y1cdvYZLGMyhIcxKih9o4Pq4VOpVtofvZbCMrl3htFgr3rBVLPRla+sG4ExOCNPszIdbcnNErJxm4AxLbZIOIB9KJlUoXxiTdXSMGTkPyptmV9KNS59rZOOU9/vBBA4rGmymEjVQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JH3rKjVH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7FEAC433F1; Sun, 24 Mar 2024 22:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319713; bh=bFPh+6OA+JYDyi7jFiN5kCZbCRHA5RJ6L5tddcxC0pA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JH3rKjVH8Y6bsNTiH2jRaQ0XHJwDkHjp1dQg6QnaIgLIG4e7fLjeMN7Gt7Ua7N+3T kmlzHIps6xyyYwY6rrZ2u72Q5YDXQVBYE7hHlLoPo69BGP5hrbjEdr0UUSOqF876Cf UxbTH4QT2pzjm64X6lN3u1do24wS9KqqPJuYomLzcDS6J9H5IKf5MGCKs95u4nsqn7 qPPts4A6SAplvTiCvHPaFx4sMVzOwdVmLX5EBQs2PSENkDrMGbU1TVz4IWDltg2spR rr23FozmvgazXTFgpkIDymZd92P7MbxXdLFfoUOyLv9RJXKnzKdh0N4BOFij5onP9u OsrC7pJVkMSyQ== 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.8 016/715] s390/dasd: Use dev_*() for device log messages Date: Sun, 24 Mar 2024 18:23:15 -0400 Message-ID: <20240324223455.1342824-17-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 7327e81352e9c..4a7d70426a6e6 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 @@ -3402,8 +3399,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); } /* @@ -3490,8 +3486,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); @@ -3504,11 +3503,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; } @@ -3516,8 +3514,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; } @@ -3538,8 +3535,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); @@ -3548,16 +3545,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)); @@ -3568,10 +3564,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); @@ -3592,11 +3591,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; } @@ -3956,8 +3954,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