From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755870AbbE2KG4 (ORCPT ); Fri, 29 May 2015 06:06:56 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22112 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755633AbbE2KGl (ORCPT ); Fri, 29 May 2015 06:06:41 -0400 Date: Fri, 29 May 2015 13:06:21 +0300 From: Dan Carpenter To: Riley Andrews Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , devel@driverdev.osuosl.org Subject: Re: [PATCH 03/13] android: binder: refactor binder_thread_write Message-ID: <20150529100621.GG28762@mwanda> References: <1432854511-33320-1-git-send-email-riandrews@android.com> <1432854511-33320-4-git-send-email-riandrews@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432854511-33320-4-git-send-email-riandrews@android.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is ok. Reviewed-by: Dan Carpenter On Thu, May 28, 2015 at 04:08:21PM -0700, Riley Andrews wrote: > +static void binder_call_inc_dec_ref(struct binder_thread *thread, > + uint32_t target, uint32_t cmd) > +{ > + struct binder_proc *proc = thread->proc; > + struct binder_ref *ref; > + const char *debug_string; > + > + if (target == 0 && binder_context_mgr_node && > + (cmd == BC_INCREFS || cmd == BC_ACQUIRE)) { > + ref = binder_get_ref_for_node(proc, binder_context_mgr_node); > + if (ref->desc != target) { > + binder_user_error("%d:%d tried to acquire reference to desc 0, got %d instead\n", > + proc->pid, thread->pid, ref->desc); > + return; Presumably we never hit this error condition. In the original code we printed an error and continued but now we bail on error. Presumably this is a theoretical bug fix which doesn't affect real life so I will allow it. But in the future don't mix behaviour changes with clean up patches. > + } > + } else { > + ref = binder_get_ref(proc, target); > + } > + if (!ref) { In the original code this was "if (ref == NULL)". Please don't mix these kinds of cleanups with moving code around because it makes it harder for me to review. Do that in a separate patch. regards, dan carpenter