Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12542602rwd; Fri, 23 Jun 2023 07:31:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49JndiU30e+0gpVnydVABKKMD3GoTJtb9cty92B0uZ3Kg1VC+53I87KkicD1A6MdqaHb1G X-Received: by 2002:a17:902:ecc7:b0:1b1:4801:f516 with SMTP id a7-20020a170902ecc700b001b14801f516mr26102722plh.68.1687530668847; Fri, 23 Jun 2023 07:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687530668; cv=none; d=google.com; s=arc-20160816; b=lTOi3BgRLeIb1rzZ09H40a20Y2j1zWpKZ7jFpcIaZUPukLX+tY9apSPL3kUTviI3qg MVhGCeje9MJMfPd0DthdlY3thbVUgXONffFkxiZQWnlobgehoNPcIIcidIm9OhqjkGlr KLyhBRtbaXZaj85S22Slo/JuAaI59w1mmBgALNdSoBa888yU+NKBXlk8xebLhY/Tka2f X+pC7SoH8WWj7gk0UI2cJWuom64E8ky6o2aKatbA231B1t9Rg5/orTkaitFpyp/1jEsM YuI38V++4aU5huPm9YLA0c99QhXF0Cb2/WD0L+LSwC1Va8cmWI/KF47bEuQxQ0WDXA0m ixUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=icSfLnxI7/48qNwmGJBkSMxp3qwuKIwJ3BuTt1ZLjoY=; b=yucOYHAd6aNiV15jJw3LU+xEJNuNTLVT+ljGc/O4nH2lM3PAaeeH+wtLE7kO1XqWm5 4LYFCtI4XswJFyLuTrj88Kjgc797QMLsWv9nZ39jcN0/StWfD27R7qS2FVPj1/LANix6 3fq2r/V0kgTUjiLRogDrnnO/66RQ7/8oWMWxRjCFfL+vApB3Z8+/gkinUF073DvBOnQF Zpet6asAZMAhl4CB+gM+6AagV9myNFnloc+mN4+e6/SuIfRc0758wOEzy1KM8Dc+CKT9 gtmSlV5yVIFHvE4zLCUw5/xCsr5QyMe7MxXpm7eimdeTV9aQGpO2WmsxnpM3vgQe0fgn QcFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=3snnT+h8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k10-20020a170902c40a00b001b23b699747si10409949plk.10.2023.06.23.07.30.56; Fri, 23 Jun 2023 07:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=3snnT+h8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231159AbjFWOVO (ORCPT + 99 others); Fri, 23 Jun 2023 10:21:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232057AbjFWOVG (ORCPT ); Fri, 23 Jun 2023 10:21:06 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D028C270D for ; Fri, 23 Jun 2023 07:21:03 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-565a33c35b1so10324977b3.0 for ; Fri, 23 Jun 2023 07:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687530063; x=1690122063; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=icSfLnxI7/48qNwmGJBkSMxp3qwuKIwJ3BuTt1ZLjoY=; b=3snnT+h8qhuo8YOgeQaIWdH9iGFHWdleURDxWax4fNp0K49eARf65mJlWzgZwNQf7+ oK3E77Srn8QU9HpY4vZF0+pXOttih+245iUd86WOeG+iiR3e5pJIB6jsqzMIYINupFNh GDeq61eDKEvupmJb5LtYFhsaNUTMOw9kvtjxlrbJrUrXowWQZ0W2VFYiYNnVF5ZYnwXf EeGMB+jL+XYQoUdBMg5RmKtMuybsKEdW9JNezHfE7kNGu/suaSBUx38g5ssN5bSaxHsM Xhvwe7OyZIGS2UsctPrXl98grBeRmfCzXag78HRHA2Wkr7bPHjpPXcbB8ifM3UpAOW9P Ui0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687530063; x=1690122063; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=icSfLnxI7/48qNwmGJBkSMxp3qwuKIwJ3BuTt1ZLjoY=; b=SmPBUB+UO/AZsujgLFO+h/+/5k/xWbNmQQVew8o+f3MqxizJtgQJJjNluAXs9+hMUU Iuu+tW32P/hD2nFDoVdEMZZkP5Nopm6JHCOgs22P+NJCxwhmi1VhlMfTZ7OucC4sLlZg Qq6+cmsklubhYEYI4vEtDZaLYrxR5SHqJlMSF+XSz+PpkI8ctubkChLIFPZMzrHI2rkT kp9p4IBidBQpe6B1rNzb6ake3el3mjD21MdR0gjtB8JwEI6/YAhgu2l1kZ2iFjLVTZPL 3WQhSCTacWIPCEvtJO/+nExqvpILcswmt0UQh48Z5CycwDf7jYpek7rN+VEG+orQGOPG MxuQ== X-Gm-Message-State: AC+VfDwHTOzYIFSyu2rT5D23g7f8WCMQ0RWh/lbvPIjJUmM6QXTAEEi2 +Tam+AQxWO/HCnISrjLBbiZb9FSx3kqM X-Received: from kyletso-p620lin01.ntc.corp.google.com ([2401:fa00:fc:202:5d47:84a:2819:bba4]) (user=kyletso job=sendgmr) by 2002:a81:ac42:0:b0:573:8316:8d04 with SMTP id z2-20020a81ac42000000b0057383168d04mr4567622ywj.4.1687530063033; Fri, 23 Jun 2023 07:21:03 -0700 (PDT) Date: Fri, 23 Jun 2023 22:20:54 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230623142054.3945121-1-kyletso@google.com> Subject: [PATCH] sysfs: Replace %p with %pK in the warning of sysfs_emit* From: Kyle Tso To: gregkh@linuxfoundation.org, rafael@kernel.org Cc: badhri@google.com, linux-kernel@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to Documentation/core-api/printk-formats.rst, kernel pointers need to be printed with %pK format specifier to respect kptr_restrict in sysctl. Also replace the function names in the strings with %s and __func__ as checkpatch.pl suggested. Signed-off-by: Kyle Tso --- fs/sysfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index a12ac0356c69..56712f0886ef 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -732,7 +732,7 @@ int sysfs_emit(char *buf, const char *fmt, ...) int len; if (WARN(!buf || offset_in_page(buf), - "invalid sysfs_emit: buf:%p\n", buf)) + "invalid %s: buf:%pK\n", __func__, buf)) return 0; va_start(args, fmt); @@ -760,7 +760,7 @@ int sysfs_emit_at(char *buf, int at, const char *fmt, ...) int len; if (WARN(!buf || offset_in_page(buf) || at < 0 || at >= PAGE_SIZE, - "invalid sysfs_emit_at: buf:%p at:%d\n", buf, at)) + "invalid %s: buf:%pK at:%d\n", __func__, buf, at)) return 0; va_start(args, fmt); -- 2.41.0.162.gfafddb0af9-goog