From mboxrd@z Thu Jan 1 00:00:00 1970 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 798D6C433EF for ; Thu, 30 Jun 2022 00:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbiF3Auy (ORCPT ); Wed, 29 Jun 2022 20:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiF3Auw (ORCPT ); Wed, 29 Jun 2022 20:50:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0942403ED; Wed, 29 Jun 2022 17:50:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9C6FCB827B6; Thu, 30 Jun 2022 00:50:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E5E0C34114; Thu, 30 Jun 2022 00:50:41 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="Rio6hS73" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1656550239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lAj+UsLxPeGR3JIzKkMAY3UQ4Fc7rVtE34gVa7F5Mk0=; b=Rio6hS73DikBrANqdWBHqlvUAZr9HeM3Tw2P2RT7GwzMWfx1mEoPnAX9y2tYS3dnyLa61K G9F/AphVS3+hx/JuleNTfayYZfXj8oeQUQ6MZ4LtXRluQmG0UQvBPWFw0KqujncUNs3GUB +IL/7OeJsmgFDXKFSsmPdhgTbsSjW5k= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id c29fd627 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 30 Jun 2022 00:50:39 +0000 (UTC) Date: Thu, 30 Jun 2022 02:50:34 +0200 From: "Jason A. Donenfeld" To: Joe Perches Cc: Kalesh Singh , Christoph Hellwig , Greg Kroah-Hartman , Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , Theodore Ts'o , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Alex Xu (Hello71)" , Paolo Abeni , Rob Herring , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Shuah Khan , LKML , wireguard@lists.zx2c4.com, netdev@vger.kernel.org, rcu , "open list:KERNEL SELFTEST FRAMEWORK" , sultan@kerneltoast.com, android-kernel-team , John Stultz , Saravana Kannan , rafael@kernel.org Subject: Re: [PATCH] remove CONFIG_ANDROID Message-ID: References: <20220629163007.GA25279@lst.de> <306dacfb29c2e38312943fa70d419f0a8d5ffe82.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <306dacfb29c2e38312943fa70d419f0a8d5ffe82.camel@perches.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 29, 2022 at 05:36:57PM -0700, Joe Perches wrote: > > > +static ssize_t pm_userspace_autosleeper_show(struct kobject *kobj, > > > + struct kobj_attribute *attr, char *buf) > > > +{ > > > + return sprintf(buf, "%d\n", pm_userspace_autosleeper_enabled); > > This should use sysfs_emit no? Probably, yea. Note that I just copy and pasted a nearby function, pm_async_show, `:%s/`d the variable name, and then promptly `git diff | clip`d it and plonked it into my email. Looking at the file, it uses sprintf all over the place in this fashion. So you may want to submit a cleanup to Rafael on this if you're right about sysfs_emit() being universally preferred. Jason