From: Takashi Iwai Subject: Re: [PATCH 3/3] pm_qos: get rid of the allocation in pm_qos_add_request() Date: Mon, 05 Jul 2010 08:41:00 +0200 Message-ID: References: <1277746434.10879.191.camel@mulgrave.site> <1277747088.10879.201.camel@mulgrave.site> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: Linux PM , markgross@thegnar.org, netdev@vger.kernel.org To: James Bottomley Return-path: Received: from cantor2.suse.de ([195.135.220.15]:33458 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863Ab0GEGlD (ORCPT ); Mon, 5 Jul 2010 02:41:03 -0400 In-Reply-To: <1277747088.10879.201.camel@mulgrave.site> Sender: netdev-owner@vger.kernel.org List-ID: Hi, sorry for the late reply, as I've been on vacation in the last week (and shut off mails intentionally :) At Mon, 28 Jun 2010 12:44:48 -0500, James Bottomley wrote: > > Since every caller has to squirrel away the returned pointer anyway, > they might as well supply the memory area. This fixes a bug in a few of > the call sites where the returned pointer was dereferenced without > checking it for NULL (which gets returned if the kzalloc failed). > > I'd like to hear how sound and netdev feels about this: it will add > about two more pointers worth of data to struct netdev and struct > snd_pcm_substream .. but I think it's worth it. If you're OK, I'll add > your acks and send through the pm tree. > > This also looks to me like an android independent clean up (even though > it renders the request_add atomically callable). I also added include > guards to include/linux/pm_qos_params.h I like the patch very well, too. But, just wondering... > @@ -262,6 +260,11 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, > if (!pm_qos_req) /*guard against callers passing in null */ > return; > > + if (pm_qos_request_active(pm_qos_req)) { > + WARN(1, KERN_ERR "pm_qos_update_request() called for unknown object\n"); > + return; > + } > + Is this correct...? Shouldn't it be a negative check? thanks, Takashi