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 lists.zx2c4.com (lists.zx2c4.com [165.227.139.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CEF45C433EF for ; Thu, 30 Jun 2022 03:02:37 +0000 (UTC) Received: by lists.zx2c4.com (OpenSMTPD) with ESMTP id 4e678e8f; Thu, 30 Jun 2022 03:02:35 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lists.zx2c4.com (OpenSMTPD) with ESMTPS id 36870b6f (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO) for ; Thu, 30 Jun 2022 03:02:33 +0000 (UTC) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B48B762046; Thu, 30 Jun 2022 03:02:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADC3C3411E; Thu, 30 Jun 2022 03:02:27 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="cEfq2bbY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1656558145; 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=lAxoLbADZAhu/fbtT19sYsfwjIQHx+7cL3zp8zm5ylc=; b=cEfq2bbYg+E0cJPmGbfqowUlZyBsEFMB+Tx0GAvzVTKBOF7AJsVTfIV6F3UeLWUpu2xbSL REcWxgdTxNMimTFAsv2fXTf8VAIjeKWpDKecdvNtTMkrU9267h6JnxgCkrxxlSMx660w+6 xigc6asOchBZ4Fie7h+gI+in3P0RKaw= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 44cb7fda (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 30 Jun 2022 03:02:25 +0000 (UTC) Date: Thu, 30 Jun 2022 05:02:19 +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: <306dacfb29c2e38312943fa70d419f0a8d5ffe82.camel@perches.com> <1a1f24707a03c2363e29ef91905e9f206fb6a0b5.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1a1f24707a03c2363e29ef91905e9f206fb6a0b5.camel@perches.com> X-BeenThere: wireguard@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: wireguard-bounces@lists.zx2c4.com Sender: "WireGuard" On Wed, Jun 29, 2022 at 06:44:14PM -0700, Joe Perches wrote: > On Thu, 2022-06-30 at 02:50 +0200, Jason A. Donenfeld wrote: > > 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. > > Perhaps: > > (trivial refactored and added a missing newline in autosleep_show) > > --- > kernel/power/main.c | 102 ++++++++++++++++++++++++++-------------------------- > 1 file changed, 52 insertions(+), 50 deletions(-) You should probably post a proper patch to the PM people. At least I'm not going to look at that here, as it's not really relevant at all to this discussion. Jason