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 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C171BC433FF for ; Mon, 5 Aug 2019 21:15:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F480214C6 for ; Mon, 5 Aug 2019 21:15:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IPgMHj+E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730600AbfHEVPR (ORCPT ); Mon, 5 Aug 2019 17:15:17 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41596 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730572AbfHEVPQ (ORCPT ); Mon, 5 Aug 2019 17:15:16 -0400 Received: by mail-pf1-f195.google.com with SMTP id m30so40274232pff.8 for ; Mon, 05 Aug 2019 14:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:subject:from:cc:to:user-agent:date; bh=6keXzspKhAmzHHzUYun2hJRtsp74WGjMcjc/4i8xe0o=; b=IPgMHj+EcmPJ2dDH01EyZqip1NHlIJQNthd6U1205Ff0WJvlhkvwc8qLu8636IzfIV d1eP/tAlFQNp1tuEqKZBk2JCAGKEQ1YBKU3PAVAInp/d9O+WHourXyWS556U3XvXkbWy 6HvgO1wLh5JtSyn4/J3b+laIkLf/HYISi8P4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:subject:from:cc:to :user-agent:date; bh=6keXzspKhAmzHHzUYun2hJRtsp74WGjMcjc/4i8xe0o=; b=a3xehRoKmNxUhrf00QfWJwGoek+UhSyCeBV6JEwLe8Bf7CvkK5U3mjBdr4awOHpnB1 vIwCgKN+/rEgz/3x2QG5tXPCYSabm9AZJwbRmbQ8cNEJhdKYcm38z/mNRjdUNFICIeSe oxDll2OyPzjeRRb5l/VgKPPCtLLC+cZmRAnD371MoS5VNzGpMGtY7SuE/xcIoWVh4Oxz AMzKpIDUPJrgmnJRQP0Z1Eq/cxwJmbnOAUOz4i5uXGliZqTbGt0Je6xpkWCUgFhZySEG BJpK/xFh3gUO3aVoFZZlG6U4gVG95vZ1tbw9G40DQukEfNaJQ/07eplUT2tXYPgTGHyf uQUg== X-Gm-Message-State: APjAAAVg9Kl+NaR3+6ODqgKdy0XcpjGxNlpuY3Mvv1ODKrA1195jQSso Oev0XfgBCZgBMkTHUZp9Vee3gg== X-Google-Smtp-Source: APXvYqxUCVPnWbjyu68XCc3fQ5aGD1/GCroeo2qy0DJlXwm8x/Cq36U/Awi4tu3dV9++yFSmFeBFVA== X-Received: by 2002:a17:90a:208d:: with SMTP id f13mr19474353pjg.68.1565039716253; Mon, 05 Aug 2019 14:15:16 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id i126sm99416306pfb.32.2019.08.05.14.15.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 14:15:15 -0700 (PDT) Message-ID: <5d489c63.1c69fb81.f26ec.f009@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20190805175848.163558-1-trong@android.com> <20190805175848.163558-2-trong@android.com> <5d48976e.1c69fb81.a6781.3565@mx.google.com> Subject: Re: [PATCH v7 1/3] PM / wakeup: Drop wakeup_source_init(), wakeup_source_prepare() From: Stephen Boyd Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Viresh Kumar , "Rafael J. Wysocki" , Hridya Valsaraju , Sandeep Patil , Kalesh Singh , Ravi Chandra Sadineni , LKML , Linux PM , "Cc: Android Kernel" To: Tri Vo User-Agent: alot/0.8.1 Date: Mon, 05 Aug 2019 14:15:14 -0700 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Quoting Tri Vo (2019-08-05 14:11:55) > On Mon, Aug 5, 2019 at 1:54 PM Stephen Boyd wrote: > > > > Quoting Tri Vo (2019-08-05 10:58:46) > > > @@ -96,13 +79,23 @@ EXPORT_SYMBOL_GPL(wakeup_source_prepare); > > > struct wakeup_source *wakeup_source_create(const char *name) > > > { > > > struct wakeup_source *ws; > > > + const char *ws_name; > > > > > > - ws =3D kmalloc(sizeof(*ws), GFP_KERNEL); > > > + ws =3D kzalloc(sizeof(*ws), GFP_KERNEL); > > > if (!ws) > > > - return NULL; > > > + goto err_ws; > > > + > > > + ws_name =3D kstrdup_const(name, GFP_KERNEL); > > > + if (!ws_name) > > > > Does this intentionally change this function to return an error if > > 'name' is NULL? Before, wakeup_source_prepare() would just assign > > ws->name to NULL, but now it errors out. I don't see how it's good or > > useful to allow NULL for the wakeup source name, but it is what it is. >=20 > Yes, the change to not allow ws->name to be NULL is intentional. Ok. It would be good to mention it in the commit text so we don't think it was a bug when looking back a few months later.