From patchwork Wed Mar 3 12:20:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 392059 Delivered-To: patches@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp5078119jap; Wed, 3 Mar 2021 04:20:57 -0800 (PST) X-Received: by 2002:a19:ae07:: with SMTP id f7mr15414032lfc.551.1614774057194; Wed, 03 Mar 2021 04:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614774057; cv=none; d=google.com; s=arc-20160816; b=xwh9oXYiVMUXG5JisokpXZNHSEqa7ujFCmOT9MHalPCKFfTZu/SVuGaunAdibVT+EV 0N4JGeEuHo/ddSl0w1L2/4MxwHQZYdf6F6VmI1uw3bT2/dnDZeCPGwffl2qsIWOhkYem xbdUzNTp3PlDCH1mldNoOet+cntpNGMjBsJA+LwQA4+es4+tIBC2VdsSX27ybaHAAcj5 z5ncsyEmrAeMNjoNQ5P66Zf1ImUSGE8R4qA39NMV8C2chsgYdmSrjY02UMLEPgJHvGsF qGNMFeGWlnBoaHQl6vB/FcfbddYJCleFgOszYzmgj2PHw3L1assGPRUT9XTN87TdsBCZ l5yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Vf8w2DOx9jzNzEvSal2fcDgyCGSYzKizUYKhFMSZIWY=; b=j9allkqT5RcP7MR8KuOM/GNQ+4q9UD3mh4QM2bxD0BUHY3ApoJ/fMvjnLTosKqCQYa HFn8zacZBmU0qwWOESM3ltVxgNeL7YwJMIHVpzPcsQ8Smoq/23XdM3zcYB30ySwHe9vy KpVXKDWaiK9PUYFwjg0BLQrXzGZ7xWLrWm3b0CM71vQFyrDbClGSWmzUkjXOUIa8ymNs ZxA2KfX6pklT3prwlmrtVBIAyyWWT5F8drAuWFfoU+KqNTytLpKvmAoiWBT0E5+pG/PU EjL7Tu5Wm3E+trejWmUDQDTP3YdiKrZKDxZ6OGwT3Tqc1zHUhBXKv0uNYJy8z357o9d8 qu2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b+YOBur+; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id d14sor5827930lfg.134.2021.03.03.04.20.57 for (Google Transport Security); Wed, 03 Mar 2021 04:20:57 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b+YOBur+; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vf8w2DOx9jzNzEvSal2fcDgyCGSYzKizUYKhFMSZIWY=; b=b+YOBur+UNT3fr1MydkfahrEEu0JFWr+GUvB+DTkjYwK3771dYvme0s6U/30Qq2qVU aGyBROFh+WGe8PSdgsVYxWFKg/xBEe13a2dYCdKNBCdPhAKCNjgUNl97HkNkwNZluNMB 9jXhYjoCW8IRDeNORW4rAqeKcEnNtUGSVw2Rer0Utm4lRD/wkuX/Jwiji31TkuBx7xm1 b9N+DmuUo0YQWje6iiV0e9loryhhKnXDI0Fcgy9csg4UgsaeIPANALzEQi5g7SPKzkuC Uqi6y1VTOsGtTrdsxUqLWAKM0zy+v/tx1OCd3GG5hoE2kux5vbGhKOqUC/xB/r5JQS8T dw2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vf8w2DOx9jzNzEvSal2fcDgyCGSYzKizUYKhFMSZIWY=; b=IiHqFYV4xkZLUKWbK3pYY5UGhrFMEOZhuKdkyp/nqFyJBdcjCEBLNCxhOafKeWkxuF it911LwqjsQAVmtvBoSUqUaY9O/L5lPpkZowvnRDMU/XIln9rxtGbiEbHWHe7sozX6Hl BgmqTPdTSqNlHc5c21H6aJThwNAlBahZbYfVMNlMRLKIwy7xuZSZmktMGroTP8eHhr5p t+V5H0i7/p0NcgEY+0VwXyRozsdzAd4YwE1enAZW2hCZuSEmuyCEc3ucyubsHMHg84/3 diGfYKOXenaomUYcRocUWad8RcuMtnBYDDJQxYtk0p+aFBCxMrpA7GqspgdEvNMwVUI+ qu2g== X-Gm-Message-State: AOAM531gDFtSUO9SBC4iWUl6O5fzjqWd2SUQL7hQimwLUSyMPJESrGm9 rb5bjIGsEufkScVeAbaVLBbHNMv8 X-Google-Smtp-Source: ABdhPJyejyZYo5gNNlhWEICEam/nrx5cNRlHDqbjVPosD7259wOXYQnbJgEu1XQs1VsA48M6VuUiPg== X-Received: by 2002:a19:4101:: with SMTP id o1mr14056347lfa.16.1614774056786; Wed, 03 Mar 2021 04:20:56 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-155-4-129-234.NA.cust.bahnhof.se. [155.4.129.234]) by smtp.gmail.com with ESMTPSA id d3sm811519lfq.249.2021.03.03.04.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 04:20:55 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] mmc: block: Simplify logging during probe about added partitions Date: Wed, 3 Mar 2021 13:20:48 +0100 Message-Id: <20210303122049.151986-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210303122049.151986-1-ulf.hansson@linaro.org> References: <20210303122049.151986-1-ulf.hansson@linaro.org> MIME-Version: 1.0 To simplify the code, move the logging into the common mmc_blk_alloc_req() and drop the rather useless information about the partition type/id. Signed-off-by: Ulf Hansson --- drivers/mmc/core/block.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index dc6b2e8f4f95..39308b35a1fb 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2261,6 +2261,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, { struct mmc_blk_data *md; int devidx, ret; + char cap_str[10]; devidx = ida_simple_get(&mmc_blk_ida, 0, max_devices, GFP_KERNEL); if (devidx < 0) { @@ -2365,6 +2366,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, blk_queue_write_cache(md->queue.queue, true, true); } + string_get_size((u64)size, 512, STRING_UNITS_2, + cap_str, sizeof(cap_str)); + pr_info("%s: %s %s %s %s\n", + md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), + cap_str, md->read_only ? "(ro)" : ""); + return md; err_putdisk: @@ -2407,7 +2414,6 @@ static int mmc_blk_alloc_part(struct mmc_card *card, const char *subname, int area_type) { - char cap_str[10]; struct mmc_blk_data *part_md; part_md = mmc_blk_alloc_req(card, disk_to_dev(md->disk), size, default_ro, @@ -2417,11 +2423,6 @@ static int mmc_blk_alloc_part(struct mmc_card *card, part_md->part_type = part_type; list_add(&part_md->part, &md->part); - string_get_size((u64)get_capacity(part_md->disk), 512, STRING_UNITS_2, - cap_str, sizeof(cap_str)); - pr_info("%s: %s %s partition %u %s\n", - part_md->disk->disk_name, mmc_card_id(card), - mmc_card_name(card), part_md->part_type, cap_str); return 0; } @@ -2558,9 +2559,8 @@ static int mmc_blk_alloc_rpmb_part(struct mmc_card *card, string_get_size((u64)size, 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); - pr_info("%s: %s %s partition %u %s, chardev (%d:%d)\n", - rpmb_name, mmc_card_id(card), - mmc_card_name(card), EXT_CSD_PART_CONFIG_ACC_RPMB, cap_str, + pr_info("%s: %s %s %s, chardev (%d:%d)\n", + rpmb_name, mmc_card_id(card), mmc_card_name(card), cap_str, MAJOR(mmc_rpmb_devt), rpmb->id); return 0; @@ -2876,7 +2876,6 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card, static int mmc_blk_probe(struct mmc_card *card) { struct mmc_blk_data *md, *part_md; - char cap_str[10]; /* * Check that the card supports the command class(es) we need. @@ -2897,12 +2896,6 @@ static int mmc_blk_probe(struct mmc_card *card) if (IS_ERR(md)) return PTR_ERR(md); - string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, - cap_str, sizeof(cap_str)); - pr_info("%s: %s %s %s %s\n", - md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), - cap_str, md->read_only ? "(ro)" : ""); - if (mmc_blk_alloc_parts(card, md)) goto out;