Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3216737ybh; Mon, 5 Aug 2019 14:16:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1jbY2EjFVtNsTgCC+XevLl28DSK5FpE14RNKaMxenymB5E2ApkZe5HDRRZSn9Po2FxQli X-Received: by 2002:a17:902:4b:: with SMTP id 69mr145529987pla.89.1565039773134; Mon, 05 Aug 2019 14:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565039773; cv=none; d=google.com; s=arc-20160816; b=uwPR70XuYyPbpyayQQWzL348SZf68IRTHv02k/QQMaiAgPbp1BhLBZ7+MsVhkMOjGs SurN1lz4hNiGxOBubI+cY33rL4H5XREtXOgTcJTz3ZDEaRMXIE4Djux+p3c78WMSVUnm CAwfR2XMgzgiYN9Y9RifoUl0AH6opnrvdyTE9eCifNLuf4fne33BTxpa7m6CjmBWqHFm +Pw0phAsaxRcAE34c+RkSuKy7wURO2FcizEvVe5nl0UntlsDxzegwFwfp+KrqfeBfjPZ PSWLF5Wpl088xPsK4cy06VzkS8w8IJqgzg5eXFQOaX75kxiOqbjN13i8N9eUg9mdPg6T u7Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=6keXzspKhAmzHHzUYun2hJRtsp74WGjMcjc/4i8xe0o=; b=fe3M1tebqrYR7XS4dOfMY2RUr44Ev0NQTmN3Gr6musGAdifnZcS0PFtdc4ZG+dr41M YucRE/SOlC/IXLn5h5OxKLtw6orgXgYX2KvxTGR8PKjctY9MgNJ2kbo7lVbWxgPPGHBX XKiR8K7vU2BJbK7Gy98eqN3V+teToZCKvnILskw2+rfeo6pBBtPG3Px/W3sWxETfSyt5 GvrukwHNuJNwqLlAnxIEmyCHq0dvxiFSigkXMrBRD0Vv3n6vUn2eACb2yoG4WYotMnjP 5H60k4qpzWfujQ7hcWn5QI9mi+Th4MM2oA9m9/le/AgEClxw1rp0vTDoAEd3yC2/2Zf1 teXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IPgMHj+E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id co12si41406739plb.197.2019.08.05.14.15.57; Mon, 05 Aug 2019 14:16:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IPgMHj+E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730742AbfHEVPR (ORCPT + 99 others); Mon, 5 Aug 2019 17:15:17 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42985 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729383AbfHEVPQ (ORCPT ); Mon, 5 Aug 2019 17:15:16 -0400 Received: by mail-pf1-f195.google.com with SMTP id q10so40247939pff.9 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=aVAqH3pPR3AVisd5IqauV6V9jnrTdhHq8+aNjc6oMWjBFS586OwJG8dCywyky332rC 01nPTexfZGCH/wqpC/R0cQ1gxXxZ8/SIzg2NR4ZH8NsVMATxa6Q4+wyFH3h0lOxyqL4L 6G82plw73i/SSaepDBwe9LpHkAZ9qI0D3QaKURwrrl1rfQ/B8IA1lcf0/gn2n4vtPWX8 h8NfAbrp7+ZQjf2Lv/LL11vjWEWLTO14hvsD+y3xWp9V+OzVtUJkhWSLwL92v3UNFs+3 JUhYrAquqVLStJLww7QgdtgWr7hDIptjzfefOckpMFFyQmE1AbPXxaIOU+GPkSlG0IZr jlNA== X-Gm-Message-State: APjAAAUZk9br3e25U8QMYOjU2ol9+eaaMZDReaTbDEaZmFUlmjEoEfhr /et/IcEBJrsmf8WD0YnQMRg2DQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.