From patchwork Sun Oct 28 11:17:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 194686 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C32322C008D for ; Sun, 28 Oct 2012 22:18:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205Ab2J1LSw (ORCPT ); Sun, 28 Oct 2012 07:18:52 -0400 Received: from latitanza.investici.org ([82.94.249.234]:56343 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169Ab2J1LSv (ORCPT ); Sun, 28 Oct 2012 07:18:51 -0400 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 6C0DA981AD; Sun, 28 Oct 2012 11:18:48 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 6C0DA981AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1351423130; bh=k9oIcthBM5aWWzqcqilaB0bXBZE2e/EWU4C215pkM6g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=NEH9y/laf1H0emb1FsNU/Y4vg1pRMnTUKa6uuedOFi82RXl6vsHctidTZFx+hmw6y yYRXhywVdOAHHf1xG85wNdR3Yl6vqRAwbwSO3pd+yhyso5bu04vuNxDlfzTVYXiACR /cT0oB0OvGHMXKLOmOdKYP0fNp9j0y2EssFHOapI= From: Antonio Quartulli To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli Subject: [PATCH 14/16] batman-adv: properly convert flag into a boolean value Date: Sun, 28 Oct 2012 12:17:15 +0100 Message-Id: <1351423037-5292-15-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1351423037-5292-1-git-send-email-ordex@autistici.org> References: <1351423037-5292-1-git-send-email-ordex@autistici.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In order to properly convert a bitwise AND to a boolean value, the whole expression must be prepended by "!!". Signed-off-by: Antonio Quartulli --- net/batman-adv/translation-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 0ac39d5..c61209f 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -2420,7 +2420,7 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv, if (!tt_global_entry) goto out; - ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM; + ret = !!(tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM); batadv_tt_global_entry_free_ref(tt_global_entry); out: return ret;