lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 12 Mar 2013 10:52:04 +0100
From:	mirsal <mirsal@...sal.fr>
To:	Joe Perches <joe@...ches.com>
Cc:	Greg Kroah-Hartman <greg@...ah.com>,
	Arve Hjønnevåg <arve@...roid.com>,
	Brian Swetland <swetland@...gle.com>,
	devel@...verdev.osuosl.org, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v2 3/3] drivers: android: binder: Remove excessive
 indentation

On Mon, 2013-03-11 at 17:04 -0700, Joe Perches wrote:
> On Tue, 2013-03-12 at 00:26 +0100, Mirsal Ennaime wrote:
> > Remove one level of indentation from the binder proc page release code
> > by using slightly different control semantics.
> > 
> > This is a cosmetic patch which removes checkpatch "80-columns" warnings
> 
> More trivia:
> 
> > diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
> []
> > @@ -3001,17 +3001,20 @@ static void binder_deferred_release(struct binder_proc *proc)
> >  		int i;
> >  
> >  		for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
> > -			if (proc->pages[i]) {
> > -				void *page_addr = proc->buffer + i * PAGE_SIZE;
> > -				binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
> > -					"binder_release: %d: page %d at %p not freed\n",
> > -					proc->pid, i,
> > -					page_addr);
> > -				unmap_kernel_range((unsigned long)page_addr,
> > -					PAGE_SIZE);
> > -				__free_page(proc->pages[i]);
> > -				page_count++;
> > -			}
> > +			void *page_addr;
> > +
> > +			if (!proc->pages[i])
> > +				continue;
> > +
> > +			page_addr = proc->buffer + i * PAGE_SIZE;
> > +			binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
> > +				"binder_release: %d: page %d at %p not freed\n",
> > +				proc->pid, i,
> > +				page_addr);
> > +			unmap_kernel_range((unsigned long)page_addr,
> > +				PAGE_SIZE);
> 
> Please align single function call args to open parenthesis.
> Please fill to 80 chars where appropriate.

Fixed in v3, thanks!

> I think using %s, __func__ is better than embedded function names.
> 
> like:
> 			binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
> 				     "%s: %d: page %d at %p not freed\n",
> 				     __func__, proc->pid, i, page_addr);
> 			unmap_kernel_range((unsigned long)page_addr, PAGE_SIZE);

Indeed, however binder_release is not the name of the calling function,
nor is it further up the stack. You are probably right in that __func__
should be printed rather than binder_release as it is a bit misleading.

I'm adding a separate patch for this.

> Also for the binder folk:
> 
> I think it's odd to use pr_info in binder_debug.
> Why not use KERN_DEBUG or pr_debug/dynamic_debugging?
> 
> #define binder_debug(mask, x...) \
> 	do { \
> 		if (binder_debug_mask & mask) \
> 			pr_info(x); \
> 	} while (0)


I'd be happy to change it to use pr_debug if that is correct.

Best regards,

-- 
mirsal 

Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ