Received: by 2002:ac8:3b51:0:b0:3f3:9eb6:4eb6 with SMTP id r17csp5094030qtf; Thu, 22 Jun 2023 08:15:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4e0IrwXiQFoaa+ARPSTC1qD/9ZZPp9BkJSrxqaSuXmYBPLy0oxGsXsGIeOwJUC1RI4EAAb X-Received: by 2002:a17:90a:2:b0:259:ea:2747 with SMTP id 2-20020a17090a000200b0025900ea2747mr12222807pja.5.1687446932443; Thu, 22 Jun 2023 08:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687446932; cv=none; d=google.com; s=arc-20160816; b=oRAsUd5WOFbfbB7Tpawa+6Z9EomzPT7REfaJ/6w+n851/DEMylnduzjISMTV98v4LK r2pPhvXYLLokxHpPBjThXiBkH3BUfqGZ4BkPAXWLA/ukjZHCjwWo+ciFVWvhz3Xex4/I AAmaZft65lekMu5EyuiHG5+YKqKztMSP7J7dzdwiaDuOEcM8ABt4rjrOWsr8uy+oqa46 Cx/GXXsInl8dbxsTcV+jeKTg9oV+1mPeIiGvxAZS0cPUKU5WnNuPRiLXLwmLxIiMYKkW Z+80oRDuemmTuL/niRDha12gPg4osWHObPZUir+CLhJRCu7qjf39P2HGFhytu7pK4sUr iEGw== 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:references :mime-version:in-reply-to:date:dkim-signature; bh=6HP4+YvUJVAPeSikWLLN9lmrDsE6bkUx0eYDaGV1KtY=; b=inEWHQCAz/zjWabsvTqSsDcATz85g3NVxZg+JPKeBx3SN5rXfTyTi9OMlH87SHZNTC JA3rX4BPrP237x9Fegn4jDCAIt7lIL+r2m0GaD783zTYXArdeztEKnFCEocaBANsikYr M8zTq2F5MzdcV2I4SNB+qZzjjSrN7nqolKVFqfgLNZSbYZvkd+SLkXDLzeHYtzu/5qYW ydcsvkV6g72Busvxg0NrY+RO9UkPtuHYaP0W04oB12jd1Gy04b6T0aafMBQxatLHGzKL REjJ9C9rw8QY32JJyd7wBe+XhxjiePrgYLS+V3PEG3wHiyFT3r6C+Pwyg1ffTCFR8/Lk Vnvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=KVoocYmn; 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 e70-20020a636949000000b0055381e05230si6355862pgc.576.2023.06.22.08.15.12; Thu, 22 Jun 2023 08:15:32 -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=KVoocYmn; 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 S232364AbjFVPFu (ORCPT + 99 others); Thu, 22 Jun 2023 11:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbjFVPFC (ORCPT ); Thu, 22 Jun 2023 11:05:02 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F521FC2 for ; Thu, 22 Jun 2023 08:04:55 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5704e551e8bso88215067b3.3 for ; Thu, 22 Jun 2023 08:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687446294; x=1690038294; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=6HP4+YvUJVAPeSikWLLN9lmrDsE6bkUx0eYDaGV1KtY=; b=KVoocYmnlhWTcw1lpk8n+2IXXtKbUtQpLc1W6m42G16fgk/46hQ24ls0r0EQJLHur8 yi/2LxA0+duj7u/xyHLD2V+A9au+OpYQ5X5LOBaK7Eus9D3VJSr++d3qxu5VPTKcnYLd KsVUSfEZTrtYiWxSoHnHUbjM+rBdnkc/8HdJ7hYuGnau5poq/Xk/4LUpIXMeDp/4/5f4 P3lmmusCUD0TDns0/jFuTafZF1gDDAsvnosK9q/2mMD4M0M11llif0owUxVojq9vx+kX 5kmYk5e+yeRWtOKTvav3QYIHC3ZzjYLPL7f+yvmDTFP621TuKCGjiYHqAqskSEgoK9D7 4KAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687446294; x=1690038294; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6HP4+YvUJVAPeSikWLLN9lmrDsE6bkUx0eYDaGV1KtY=; b=JrBj6UDwwM2Fe3QYyA7tNx+HZnd+OGj6VQcnnGLG9g5NaMW93QI9lyM+u9IpoWm+MT foDuIGATD0n4KMTPcUneXKo5ygP3GXjC1F7z4TorZNWaQa3b+BJMCnorjdVcC8nWWd3+ msKspjbKoK9GKYbRTFq4lxgu8lGBRsDcog28ZV8tYZ6lS2AB/J1qn6XVl6+YBggIzDom nK0+lkeW6UFCtJ6HcCGO+NFr6RHbYiDoZfPWiOuxRJYX9Z8NEVLDTJqoUC+lg1VFKsqf zez+W8iEaELlleyjYIBVFm7MLX55aFzmlxbhxLviWRY3+Fuuy3eiXGT8kxrAfdVMXzWx 801A== X-Gm-Message-State: AC+VfDzjV497wacQ0KlxB0W9c2Mh/X53tlLsDNgB641FcLbMBRIZaGRH gfYpp1/p9kdAhb5qgqXTkNhpcpXjEGCt X-Received: from kyletso-p620lin01.ntc.corp.google.com ([2401:fa00:fc:202:b1ba:4098:b043:5e54]) (user=kyletso job=sendgmr) by 2002:a81:4318:0:b0:565:9bee:22e0 with SMTP id q24-20020a814318000000b005659bee22e0mr7091813ywa.0.1687446294377; Thu, 22 Jun 2023 08:04:54 -0700 (PDT) Date: Thu, 22 Jun 2023 23:04:23 +0800 In-Reply-To: <20230622150423.3726894-1-kyletso@google.com> Mime-Version: 1.0 References: <20230622150423.3726894-1-kyletso@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230622150423.3726894-4-kyletso@google.com> Subject: [PATCH 3/3] usb: typec: Use sysfs_emit_at when concatenating the string From: Kyle Tso To: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: badhri@google.com, linux-usb@vger.kernel.org, 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,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 The buffer address used in sysfs_emit should be aligned to PAGE_SIZE. Use sysfs_emit_at instead to offset the buffer. Fixes: a7cff92f0635 ("usb: typec: USB Power Delivery helpers for ports and partners") Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index e7312295f8c9..9c1dbf3c00e0 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -1288,9 +1288,9 @@ static ssize_t select_usb_power_delivery_show(struct device *dev, for (i = 0; pds[i]; i++) { if (pds[i] == port->pd) - ret += sysfs_emit(buf + ret, "[%s] ", dev_name(&pds[i]->dev)); + ret += sysfs_emit_at(buf, ret, "[%s] ", dev_name(&pds[i]->dev)); else - ret += sysfs_emit(buf + ret, "%s ", dev_name(&pds[i]->dev)); + ret += sysfs_emit_at(buf, ret, "%s ", dev_name(&pds[i]->dev)); } buf[ret - 1] = '\n'; -- 2.41.0.162.gfafddb0af9-goog