Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1580563
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Joe Perches <joe@perches.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Power: Supply: sbs-charger: simplfied bool function |
| Date | Tue, 14 Feb 2017 15:10:01 +0100 |
| Message-ID | <taLXP-2S6-5@gated-at.bofh.it> (permalink) |
| References | <taLEu-2wc-23@gated-at.bofh.it> |
| X-Session-Marker | 6A6F6540706572636865732E636F6D |
| X-Spam-Summary | 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1714:1730:1747:1777:1792:2198:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3351:3622:3865:3866:4321:5007:6119:7514:10004:10400:10848:11026:11232:11473:11658:11914:12043:12438:12555:12740:12760:12895:12986:13069:13311:13357:13439:14181:14659:14721:21080:21451:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none |
| X-He-Tag | nest21_63783b9571743 |
| X-Filterd-Recvd-Size | 1769 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| X-Mailer | Evolution 3.22.3-0ubuntu0.1 |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 26 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, nicolassaenzj@gmail.com |
| X-Original-Date | Tue, 14 Feb 2017 05:58:02 -0800 |
| X-Original-Message-ID | <1487080682.6214.25.camel@perches.com> |
| X-Original-References | <1487079790-724-1-git-send-email-danielperezdeandres@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1580563 |
Show key headers only | View raw
On Tue, 2017-02-14 at 14:43 +0100, Daniel Perez wrote:
> Simplified the syntax of a simple bool return value function.
>
> Signed-off-by: Daniel Perez <danielperezdeandres@gmail.com>
> ---
> drivers/power/supply/sbs-charger.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/power/supply/sbs-charger.c b/drivers/power/supply/sbs-charger.c
> index 353765a..3e40553 100644
> --- a/drivers/power/supply/sbs-charger.c
> +++ b/drivers/power/supply/sbs-charger.c
> @@ -137,10 +137,7 @@ static enum power_supply_property sbs_properties[] = {
>
> static bool sbs_readable_reg(struct device *dev, unsigned int reg)
> {
> - if (reg < SBS_CHARGER_REG_SPEC_INFO)
> - return false;
> - else
> - return true;
> + return reg < SBS_CHARGER_REG_SPEC_INFO ? false : true;
Any ternary with true false could be simplified.
Why not just
return reg >= SBS_CHARGER_REG_SPEC_INFO;
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] Power: Supply: sbs-charger: simplfied bool function Daniel Perez <danielperezdeandres@gmail.com> - 2017-02-14 14:50 +0100 Re: [PATCH] Power: Supply: sbs-charger: simplfied bool function Joe Perches <joe@perches.com> - 2017-02-14 15:10 +0100
csiph-web