From nobody Thu Jan 1 23:04:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4140CDB47E for ; Wed, 18 Oct 2023 04:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbjJREgu (ORCPT ); Wed, 18 Oct 2023 00:36:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjJREgr (ORCPT ); Wed, 18 Oct 2023 00:36:47 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 120C310C for ; Tue, 17 Oct 2023 21:36:43 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1caa7597af9so1356155ad.1 for ; Tue, 17 Oct 2023 21:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697603803; x=1698208603; 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; bh=RHxyLBB0wPgbMWDUQIUDr8gw84TaXtQbB/1F2tMN8JQ=; b=KC8PuQb0AUIAZKLPYgjkUs+fI6Gb6Nujf+e0Rd420K1vz0aOqwDblyAxhL2sT8qw3t ddMYlqcZ4jrFqc9JxUXX6ufxzTOcsavhEUPITQswmGXg3IVW5nOp9skL0zdb8KxLm3e0 4kTFBrXd9EzE8SLI+PChAooL05BdA0A0rGHNLcmIAEnO9uGwM8EWTj3cydoup7jbHE/h cRtEKWhKEyNwgl/F9jTjTasSp2NBEjLeJ3GlKR4Q2zBuDFAOq9CQulafw6p90rCSiVB9 JCMGtiq3wHEztIDuYdnhvuIxvbJW+l9JPFG8batgoectJ9UXdxTDmW283BGeiZ31IqvZ wBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697603803; x=1698208603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RHxyLBB0wPgbMWDUQIUDr8gw84TaXtQbB/1F2tMN8JQ=; b=cKrb++Qa5+mkYAegASJwL1bPFt/1qP8h1hSSF7I+D0n1NBLBW1LG09XqACYS+n5SYU wp0xKRlG74ZRFuAdATpa4buRp0QyM+CbrM4pqojSyb4V6VYq3sODSJEkes4IgSLDZbiz t5aJ834yOVRA8kAbUaqhysSMY38YvAo7sHUbrCa+OdXTS0BCpJ0SM0tKtgCWmPHjxQv+ YzTz02Szi6Hoe97AYhi7FPqmP9AfDOPUWUOTQF6MlEzmYJWKhNVWymb5ObJ+BH7uv8tC BJerOCLCXhVkh/lD3mtPw5kwuJJ+V8yhTyfjDAFpBZ37TXQzP1R9PUSp68D0kNXhUowk rzWg== X-Gm-Message-State: AOJu0YxiDQBTZFX099Zd83L+w3CEgD9ttCn0aPxY3al1CNsB3cbs/JBP iP2FY1fm2nIuPfhmLg+s0Vg= X-Google-Smtp-Source: AGHT+IFOxivqRPJUS6793T1PKJPSvDQXaj0O/wGjeaXs6FMLLxjQw7VbNP57Nu5A6xDv17BA2eShnQ== X-Received: by 2002:a17:902:d490:b0:1c9:f418:c07b with SMTP id c16-20020a170902d49000b001c9f418c07bmr4516645plg.66.1697603803285; Tue, 17 Oct 2023 21:36:43 -0700 (PDT) Received: from Negi ([68.181.16.134]) by smtp.gmail.com with ESMTPSA id u16-20020a170902e81000b001b9c5e07bc3sm2424660plg.238.2023.10.17.21.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 21:36:42 -0700 (PDT) From: Soumya Negi To: Martyn Welch , Manohar Vanga , Greg Kroah-Hartman Cc: outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Soumya Negi Subject: [PATCH 1/2] staging: vme_user: Replace printk() with pr_*(),dev_*() Date: Tue, 17 Oct 2023 21:36:32 -0700 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" vme.c uses printk() to log messages. To improve and standardize message formatting, use logging mechanisms pr_err()/pr_warn() and dev_err()/dev_warn() instead. Retain the printk log levels of the messages during replacement. Issue found by checkpatch.pl Signed-off-by: Soumya Negi --- drivers/staging/vme_user/vme.c | 175 ++++++++++++++++++--------------- 1 file changed, 94 insertions(+), 81 deletions(-) diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index 6519a7c994a0..e8c2c1e77b7d 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -9,6 +9,8 @@ * Copyright 2004 Motorola Inc. */ =20 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -62,7 +64,7 @@ static struct vme_bridge *find_bridge(struct vme_resource= *resource) return list_entry(resource->entry, struct vme_lm_resource, list)->parent; default: - printk(KERN_ERR "Unknown resource type\n"); + pr_err("Unknown resource type\n"); return NULL; } } @@ -84,24 +86,25 @@ void *vme_alloc_consistent(struct vme_resource *resourc= e, size_t size, struct vme_bridge *bridge; =20 if (!resource) { - printk(KERN_ERR "No resource\n"); + pr_err("No resource\n"); return NULL; } =20 bridge =3D find_bridge(resource); if (!bridge) { - printk(KERN_ERR "Can't find bridge\n"); + pr_err("Can't find bridge\n"); return NULL; } =20 if (!bridge->parent) { - printk(KERN_ERR "Dev entry NULL for bridge %s\n", bridge->name); + pr_err("Dev entry NULL for bridge %s\n", bridge->name); return NULL; } =20 if (!bridge->alloc_consistent) { - printk(KERN_ERR "alloc_consistent not supported by bridge %s\n", - bridge->name); + dev_err(bridge->parent, + "alloc_consistent not supported by bridge %s\n", + bridge->name); return NULL; } =20 @@ -124,24 +127,25 @@ void vme_free_consistent(struct vme_resource *resourc= e, size_t size, struct vme_bridge *bridge; =20 if (!resource) { - printk(KERN_ERR "No resource\n"); + pr_err("No resource\n"); return; } =20 bridge =3D find_bridge(resource); if (!bridge) { - printk(KERN_ERR "Can't find bridge\n"); + pr_err("Can't find bridge\n"); return; } =20 if (!bridge->parent) { - printk(KERN_ERR "Dev entry NULL for bridge %s\n", bridge->name); + pr_err("Dev entry NULL for bridge %s\n", bridge->name); return; } =20 if (!bridge->free_consistent) { - printk(KERN_ERR "free_consistent not supported by bridge %s\n", - bridge->name); + dev_err(bridge->parent, + "free_consistent not supported by bridge %s\n", + bridge->name); return; } =20 @@ -184,7 +188,7 @@ size_t vme_get_size(struct vme_resource *resource) case VME_DMA: return 0; default: - printk(KERN_ERR "Unknown resource type\n"); + pr_err("Unknown resource type\n"); return 0; } } @@ -225,7 +229,7 @@ int vme_check_window(u32 aspace, unsigned long long vme= _base, /* User Defined */ break; default: - printk(KERN_ERR "Invalid address space\n"); + pr_err("Invalid address space\n"); retval =3D -EINVAL; break; } @@ -288,14 +292,14 @@ struct vme_resource *vme_slave_request(struct vme_dev= *vdev, u32 address, =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); goto err_bus; } =20 /* Loop through slave resources */ list_for_each_entry(slave_image, &bridge->slave_resources, list) { if (!slave_image) { - printk(KERN_ERR "Registered NULL Slave resource\n"); + dev_err(bridge->parent, "Registered NULL Slave resource\n"); continue; } =20 @@ -362,20 +366,20 @@ int vme_slave_set(struct vme_resource *resource, int = enabled, int retval; =20 if (resource->type !=3D VME_SLAVE) { - printk(KERN_ERR "Not a slave resource\n"); + pr_err("Not a slave resource\n"); return -EINVAL; } =20 image =3D list_entry(resource->entry, struct vme_slave_resource, list); =20 if (!bridge->slave_set) { - printk(KERN_ERR "Function not supported\n"); + dev_err(bridge->parent, "Function not supported\n"); return -ENOSYS; } =20 if (!(((image->address_attr & aspace) =3D=3D aspace) && ((image->cycle_attr & cycle) =3D=3D cycle))) { - printk(KERN_ERR "Invalid attributes\n"); + pr_err("Invalid attributes\n"); return -EINVAL; } =20 @@ -411,14 +415,14 @@ int vme_slave_get(struct vme_resource *resource, int = *enabled, struct vme_slave_resource *image; =20 if (resource->type !=3D VME_SLAVE) { - printk(KERN_ERR "Not a slave resource\n"); + pr_err("Not a slave resource\n"); return -EINVAL; } =20 image =3D list_entry(resource->entry, struct vme_slave_resource, list); =20 if (!bridge->slave_get) { - printk(KERN_ERR "vme_slave_get not supported\n"); + dev_err(bridge->parent, "vme_slave_get not supported\n"); return -EINVAL; } =20 @@ -438,21 +442,21 @@ void vme_slave_free(struct vme_resource *resource) struct vme_slave_resource *slave_image; =20 if (resource->type !=3D VME_SLAVE) { - printk(KERN_ERR "Not a slave resource\n"); + pr_err("Not a slave resource\n"); return; } =20 slave_image =3D list_entry(resource->entry, struct vme_slave_resource, list); if (!slave_image) { - printk(KERN_ERR "Can't find slave resource\n"); + pr_err("Can't find slave resource\n"); return; } =20 /* Unlock image */ mutex_lock(&slave_image->mtx); if (slave_image->locked =3D=3D 0) - printk(KERN_ERR "Image is already free\n"); + pr_err("Image is already free\n"); =20 slave_image->locked =3D 0; mutex_unlock(&slave_image->mtx); @@ -484,14 +488,14 @@ struct vme_resource *vme_master_request(struct vme_de= v *vdev, u32 address, =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); goto err_bus; } =20 /* Loop through master resources */ list_for_each_entry(master_image, &bridge->master_resources, list) { if (!master_image) { - printk(KERN_WARNING "Registered NULL master resource\n"); + dev_warn(bridge->parent, "Registered NULL master resource\n"); continue; } =20 @@ -511,7 +515,7 @@ struct vme_resource *vme_master_request(struct vme_dev = *vdev, u32 address, =20 /* Check to see if we found a resource */ if (!allocated_image) { - printk(KERN_ERR "Can't find a suitable resource\n"); + dev_err(&vdev->dev, "Can't find a suitable resource\n"); goto err_image; } =20 @@ -561,21 +565,21 @@ int vme_master_set(struct vme_resource *resource, int= enabled, int retval; =20 if (resource->type !=3D VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + pr_err("Not a master resource\n"); return -EINVAL; } =20 image =3D list_entry(resource->entry, struct vme_master_resource, list); =20 if (!bridge->master_set) { - printk(KERN_WARNING "vme_master_set not supported\n"); + dev_warn(bridge->parent, "vme_master_set not supported\n"); return -EINVAL; } =20 if (!(((image->address_attr & aspace) =3D=3D aspace) && ((image->cycle_attr & cycle) =3D=3D cycle) && ((image->width_attr & dwidth) =3D=3D dwidth))) { - printk(KERN_WARNING "Invalid attributes\n"); + pr_warn("Invalid attributes\n"); return -EINVAL; } =20 @@ -611,14 +615,14 @@ int vme_master_get(struct vme_resource *resource, int= *enabled, struct vme_master_resource *image; =20 if (resource->type !=3D VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + pr_err("Not a master resource\n"); return -EINVAL; } =20 image =3D list_entry(resource->entry, struct vme_master_resource, list); =20 if (!bridge->master_get) { - printk(KERN_WARNING "%s not supported\n", __func__); + dev_warn(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -650,12 +654,12 @@ ssize_t vme_master_read(struct vme_resource *resource= , void *buf, size_t count, size_t length; =20 if (!bridge->master_read) { - printk(KERN_WARNING "Reading from resource not supported\n"); + dev_warn(bridge->parent, "Reading from resource not supported\n"); return -EINVAL; } =20 if (resource->type !=3D VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + pr_err("Not a master resource\n"); return -EINVAL; } =20 @@ -664,7 +668,7 @@ ssize_t vme_master_read(struct vme_resource *resource, = void *buf, size_t count, length =3D vme_get_size(resource); =20 if (offset > length) { - printk(KERN_WARNING "Invalid Offset\n"); + pr_warn("Invalid Offset\n"); return -EFAULT; } =20 @@ -698,12 +702,12 @@ ssize_t vme_master_write(struct vme_resource *resourc= e, void *buf, size_t length; =20 if (!bridge->master_write) { - printk(KERN_WARNING "Writing to resource not supported\n"); + dev_warn(bridge->parent, "Writing to resource not supported\n"); return -EINVAL; } =20 if (resource->type !=3D VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + pr_err("Not a master resource\n"); return -EINVAL; } =20 @@ -712,7 +716,7 @@ ssize_t vme_master_write(struct vme_resource *resource,= void *buf, length =3D vme_get_size(resource); =20 if (offset > length) { - printk(KERN_WARNING "Invalid Offset\n"); + pr_warn("Invalid Offset\n"); return -EFAULT; } =20 @@ -749,12 +753,12 @@ unsigned int vme_master_rmw(struct vme_resource *reso= urce, unsigned int mask, struct vme_master_resource *image; =20 if (!bridge->master_rmw) { - printk(KERN_WARNING "Writing to resource not supported\n"); + dev_warn(bridge->parent, "Writing to resource not supported\n"); return -EINVAL; } =20 if (resource->type !=3D VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + pr_err("Not a master resource\n"); return -EINVAL; } =20 @@ -812,21 +816,21 @@ void vme_master_free(struct vme_resource *resource) struct vme_master_resource *master_image; =20 if (resource->type !=3D VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + pr_err("Not a master resource\n"); return; } =20 master_image =3D list_entry(resource->entry, struct vme_master_resource, list); if (!master_image) { - printk(KERN_ERR "Can't find master resource\n"); + pr_err("Can't find master resource\n"); return; } =20 /* Unlock image */ spin_lock(&master_image->lock); if (master_image->locked =3D=3D 0) - printk(KERN_ERR "Image is already free\n"); + pr_err("Image is already free\n"); =20 master_image->locked =3D 0; spin_unlock(&master_image->lock); @@ -854,18 +858,19 @@ struct vme_resource *vme_dma_request(struct vme_dev *= vdev, u32 route) struct vme_resource *resource =3D NULL; =20 /* XXX Not checking resource attributes */ - printk(KERN_ERR "No VME resource Attribute tests done\n"); + pr_err("No VME resource Attribute tests done\n"); =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); goto err_bus; } =20 /* Loop through DMA resources */ list_for_each_entry(dma_ctrlr, &bridge->dma_resources, list) { if (!dma_ctrlr) { - printk(KERN_ERR "Registered NULL DMA resource\n"); + dev_err(bridge->parent, + "Registered NULL DMA resource\n"); continue; } =20 @@ -920,7 +925,7 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resour= ce *resource) struct vme_dma_list *dma_list; =20 if (resource->type !=3D VME_DMA) { - printk(KERN_ERR "Not a DMA resource\n"); + pr_err("Not a DMA resource\n"); return NULL; } =20 @@ -1098,12 +1103,13 @@ int vme_dma_list_add(struct vme_dma_list *list, str= uct vme_dma_attr *src, int retval; =20 if (!bridge->dma_list_add) { - printk(KERN_WARNING "Link List DMA generation not supported\n"); + dev_warn(bridge->parent, + "Link List DMA generation not supported\n"); return -EINVAL; } =20 if (!mutex_trylock(&list->mtx)) { - printk(KERN_ERR "Link List already submitted\n"); + pr_err("Link List already submitted\n"); return -EINVAL; } =20 @@ -1131,7 +1137,8 @@ int vme_dma_list_exec(struct vme_dma_list *list) int retval; =20 if (!bridge->dma_list_exec) { - printk(KERN_ERR "Link List DMA execution not supported\n"); + dev_err(bridge->parent, + "Link List DMA execution not supported\n"); return -EINVAL; } =20 @@ -1160,12 +1167,13 @@ int vme_dma_list_free(struct vme_dma_list *list) int retval; =20 if (!bridge->dma_list_empty) { - printk(KERN_WARNING "Emptying of Link Lists not supported\n"); + dev_warn(bridge->parent, + "Emptying of Link Lists not supported\n"); return -EINVAL; } =20 if (!mutex_trylock(&list->mtx)) { - printk(KERN_ERR "Link List in use\n"); + pr_err("Link List in use\n"); return -EBUSY; } =20 @@ -1175,7 +1183,7 @@ int vme_dma_list_free(struct vme_dma_list *list) */ retval =3D bridge->dma_list_empty(list); if (retval) { - printk(KERN_ERR "Unable to empty link-list entries\n"); + pr_err("Unable to empty link-list entries\n"); mutex_unlock(&list->mtx); return retval; } @@ -1200,19 +1208,19 @@ int vme_dma_free(struct vme_resource *resource) struct vme_dma_resource *ctrlr; =20 if (resource->type !=3D VME_DMA) { - printk(KERN_ERR "Not a DMA resource\n"); + pr_err("Not a DMA resource\n"); return -EINVAL; } =20 ctrlr =3D list_entry(resource->entry, struct vme_dma_resource, list); =20 if (!mutex_trylock(&ctrlr->mtx)) { - printk(KERN_ERR "Resource busy, can't free\n"); + pr_err("Resource busy, can't free\n"); return -EBUSY; } =20 if (!(list_empty(&ctrlr->pending) && list_empty(&ctrlr->running))) { - printk(KERN_WARNING "Resource still processing transfers\n"); + pr_warn("Resource still processing transfers\n"); mutex_unlock(&ctrlr->mtx); return -EBUSY; } @@ -1290,8 +1298,9 @@ void vme_irq_handler(struct vme_bridge *bridge, int l= evel, int statid) if (call) call(level, statid, priv_data); else - printk(KERN_WARNING "Spurious VME interrupt, level:%x, vector:%x\n", - level, statid); + dev_warn(bridge->parent, + "Spurious VME interrupt, level:%x, vector:%x\n", level, + statid); } EXPORT_SYMBOL(vme_irq_handler); =20 @@ -1319,17 +1328,18 @@ int vme_irq_request(struct vme_dev *vdev, int level= , int statid, =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); return -EINVAL; } =20 if ((level < 1) || (level > 7)) { - printk(KERN_ERR "Invalid interrupt level\n"); + pr_err("Invalid interrupt level\n"); return -EINVAL; } =20 if (!bridge->irq_set) { - printk(KERN_ERR "Configuring interrupts not supported\n"); + dev_err(bridge->parent, + "Configuring interrupts not supported\n"); return -EINVAL; } =20 @@ -1337,7 +1347,7 @@ int vme_irq_request(struct vme_dev *vdev, int level, = int statid, =20 if (bridge->irq[level - 1].callback[statid].func) { mutex_unlock(&bridge->irq_mtx); - printk(KERN_WARNING "VME Interrupt already taken\n"); + dev_warn(bridge->parent, "VME Interrupt already taken\n"); return -EBUSY; } =20 @@ -1368,17 +1378,18 @@ void vme_irq_free(struct vme_dev *vdev, int level, = int statid) =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); return; } =20 if ((level < 1) || (level > 7)) { - printk(KERN_ERR "Invalid interrupt level\n"); + pr_err("Invalid interrupt level\n"); return; } =20 if (!bridge->irq_set) { - printk(KERN_ERR "Configuring interrupts not supported\n"); + dev_err(bridge->parent, + "Configuring interrupts not supported\n"); return; } =20 @@ -1415,17 +1426,18 @@ int vme_irq_generate(struct vme_dev *vdev, int leve= l, int statid) =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); return -EINVAL; } =20 if ((level < 1) || (level > 7)) { - printk(KERN_WARNING "Invalid interrupt level\n"); + pr_warn("Invalid interrupt level\n"); return -EINVAL; } =20 if (!bridge->irq_generate) { - printk(KERN_WARNING "Interrupt generation not supported\n"); + dev_warn(bridge->parent, + "Interrupt generation not supported\n"); return -EINVAL; } =20 @@ -1452,14 +1464,15 @@ struct vme_resource *vme_lm_request(struct vme_dev = *vdev) =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); goto err_bus; } =20 /* Loop through LM resources */ list_for_each_entry(lm, &bridge->lm_resources, list) { if (!lm) { - printk(KERN_ERR "Registered NULL Location Monitor resource\n"); + dev_err(bridge->parent, + "Registered NULL Location Monitor resource\n"); continue; } =20 @@ -1514,7 +1527,7 @@ int vme_lm_count(struct vme_resource *resource) struct vme_lm_resource *lm; =20 if (resource->type !=3D VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + pr_err("Not a Location Monitor resource\n"); return -EINVAL; } =20 @@ -1545,14 +1558,14 @@ int vme_lm_set(struct vme_resource *resource, unsig= ned long long lm_base, struct vme_lm_resource *lm; =20 if (resource->type !=3D VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + pr_err("Not a Location Monitor resource\n"); return -EINVAL; } =20 lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_set) { - printk(KERN_ERR "vme_lm_set not supported\n"); + dev_err(bridge->parent, "vme_lm_set not supported\n"); return -EINVAL; } =20 @@ -1581,14 +1594,14 @@ int vme_lm_get(struct vme_resource *resource, unsig= ned long long *lm_base, struct vme_lm_resource *lm; =20 if (resource->type !=3D VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + pr_err("Not a Location Monitor resource\n"); return -EINVAL; } =20 lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_get) { - printk(KERN_ERR "vme_lm_get not supported\n"); + dev_err(bridge->parent, "vme_lm_get not supported\n"); return -EINVAL; } =20 @@ -1618,14 +1631,14 @@ int vme_lm_attach(struct vme_resource *resource, in= t monitor, struct vme_lm_resource *lm; =20 if (resource->type !=3D VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + pr_err("Not a Location Monitor resource\n"); return -EINVAL; } =20 lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_attach) { - printk(KERN_ERR "vme_lm_attach not supported\n"); + dev_err(bridge->parent, "vme_lm_attach not supported\n"); return -EINVAL; } =20 @@ -1651,14 +1664,14 @@ int vme_lm_detach(struct vme_resource *resource, in= t monitor) struct vme_lm_resource *lm; =20 if (resource->type !=3D VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + pr_err("Not a Location Monitor resource\n"); return -EINVAL; } =20 lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_detach) { - printk(KERN_ERR "vme_lm_detach not supported\n"); + dev_err(bridge->parent, "vme_lm_detach not supported\n"); return -EINVAL; } =20 @@ -1683,7 +1696,7 @@ void vme_lm_free(struct vme_resource *resource) struct vme_lm_resource *lm; =20 if (resource->type !=3D VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + pr_err("Not a Location Monitor resource\n"); return; } =20 @@ -1720,12 +1733,12 @@ int vme_slot_num(struct vme_dev *vdev) =20 bridge =3D vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + pr_err("Can't find VME bus\n"); return -EINVAL; } =20 if (!bridge->slot_get) { - printk(KERN_WARNING "vme_slot_num not supported\n"); + dev_warn(bridge->parent, "vme_slot_num not supported\n"); return -EINVAL; } =20 --=20 2.42.0 From nobody Thu Jan 1 23:04:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE97ACDB47E for ; Wed, 18 Oct 2023 04:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjJREhB (ORCPT ); Wed, 18 Oct 2023 00:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjJREgw (ORCPT ); Wed, 18 Oct 2023 00:36:52 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD3810B for ; Tue, 17 Oct 2023 21:36:49 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6bce254ba56so2681160b3a.1 for ; Tue, 17 Oct 2023 21:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697603808; x=1698208608; 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; bh=GSddBUAe956x9GyHNcmiKlaDE7dW5RFLQMzOpH7UipA=; b=IEL+E+NLdS0EgThTg0TeqEgvdFKwJD+b4d7B52kP7+X2I9w7fcjWm4jSTqOw3zoFKG i/rlQ+reCqz8NDRgeIH9H0xdKJhex/nydYPlG7pSShvtODYMRpsJFHW0ugxfi4Nar7Cx bX5gdpqQDa378nukU+qMcJnKdtIcqYjeuGw3kHilazlNVsVX96f578KxyTuDnw3WpZUi w8FmQvgwGu6vzAGkbXHZIyjuxeXmDKlUyZDdERRGqFQgpqrYFoe61CiwPf0DEPdoSRvL teiMZL0C9DNX6/q6q80Hn9Ecrxi0xnI5iKnrn3OSpSt/HQPNmxGj7C+6cmroF6Bw2o3N bbPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697603808; x=1698208608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GSddBUAe956x9GyHNcmiKlaDE7dW5RFLQMzOpH7UipA=; b=oAIwHrDOz5KYJdTwuGjw7y2UdgIyajbYKNuEEEHpuKXVJd3VYMzXqM5aj9VV2jX9G/ YphszUqwowV9ho/NbgFI4S0UkNPew1hW8QflzIpb59xpMVZbzV4Z/5CxCsvA11ov4eDX TDPCBeAYrdP/h4X4eW7Z6y1TPv7sil8yQA7MB1h8PhlBp1B2hM3E5eg0xTlhRtNBPNI8 oqckAbugPA7/+1oQAj//hPrEJo0OKto7DvthHX+GMFHfRva08BhRDXzWyUC/A7UOw/yJ IbMNeXmRN0UlAYAZVQnoReNuOmZ4wvzyoFV3cW8Zq6FuYmesVMWV6XfoE08Yy0TnPfHD R3DQ== X-Gm-Message-State: AOJu0YwWkORITMIbcqv5nZ5AcEhS4rYPtfTZHeDzu10dpuKJVq+FTwB9 uo7Wyy/cMCE9iLiLMLVifYQteSYJsOOxQQ== X-Google-Smtp-Source: AGHT+IGCaQ0E9lrWBwLhwhSx+BpUyciw5QPK+upLQ3W33LPDXkewu/finbRuG18hTKEHJkZnWNI66w== X-Received: by 2002:a05:6a20:7494:b0:161:2bed:6b3a with SMTP id p20-20020a056a20749400b001612bed6b3amr3987395pzd.17.1697603808486; Tue, 17 Oct 2023 21:36:48 -0700 (PDT) Received: from Negi ([68.181.16.134]) by smtp.gmail.com with ESMTPSA id q5-20020a170902788500b001ca222edc16sm2422852pll.135.2023.10.17.21.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 21:36:47 -0700 (PDT) From: Soumya Negi To: Martyn Welch , Manohar Vanga , Greg Kroah-Hartman Cc: outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Soumya Negi Subject: [PATCH 2/2] staging: vme_user: Use __func__ instead of function name Date: Tue, 17 Oct 2023 21:36:33 -0700 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Replace function names in message strings with __func__ to fix all checkpatch warnings like: WARNING: Prefer using '"%s...", __func__' to using 'vme_lm_get', this function's name, in a string Signed-off-by: Soumya Negi Acked-by: Andi Shyti =20 --- drivers/staging/vme_user/vme.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index e8c2c1e77b7d..11c1df12b657 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -422,7 +422,7 @@ int vme_slave_get(struct vme_resource *resource, int *e= nabled, image =3D list_entry(resource->entry, struct vme_slave_resource, list); =20 if (!bridge->slave_get) { - dev_err(bridge->parent, "vme_slave_get not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -572,7 +572,7 @@ int vme_master_set(struct vme_resource *resource, int e= nabled, image =3D list_entry(resource->entry, struct vme_master_resource, list); =20 if (!bridge->master_set) { - dev_warn(bridge->parent, "vme_master_set not supported\n"); + dev_warn(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -1565,7 +1565,7 @@ int vme_lm_set(struct vme_resource *resource, unsigne= d long long lm_base, lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_set) { - dev_err(bridge->parent, "vme_lm_set not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -1601,7 +1601,7 @@ int vme_lm_get(struct vme_resource *resource, unsigne= d long long *lm_base, lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_get) { - dev_err(bridge->parent, "vme_lm_get not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -1638,7 +1638,7 @@ int vme_lm_attach(struct vme_resource *resource, int = monitor, lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_attach) { - dev_err(bridge->parent, "vme_lm_attach not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -1671,7 +1671,7 @@ int vme_lm_detach(struct vme_resource *resource, int = monitor) lm =3D list_entry(resource->entry, struct vme_lm_resource, list); =20 if (!bridge->lm_detach) { - dev_err(bridge->parent, "vme_lm_detach not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 @@ -1738,7 +1738,7 @@ int vme_slot_num(struct vme_dev *vdev) } =20 if (!bridge->slot_get) { - dev_warn(bridge->parent, "vme_slot_num not supported\n"); + dev_warn(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } =20 --=20 2.42.0