Re: [PATCH 03/13] revert: Don't check lone argument in get_encoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ramkumar Ramachandra wrote:

> The get_encoding function has only one callsite, and its caller makes
> sure that a NULL argument isn't passed.  Don't unnecessarily double
> check the same argument in get_encoding.

Yes, this one's pretty good, though I suspect the actual reason for
the patch is not just dead code elimination.

The patch itself gives reason to be comfortable: the "while" loop
right after the removed "if" checks the value of *p immediately, so if
callers start passing NULL, it will be pretty obvious.

I suspect the actual motivation is to avoid access to the "commit"
global, in preparation for making it local.  A nice side-benefit is
removing a translated message.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]