Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp974290iog; Wed, 29 Jun 2022 14:19:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vqSqjeLlvWx6Q3nC861FRvGvGTVnASrCiZDIp2nx8p2QxWZOkdc2pAOxLVd8S6Fxp7u5BJ X-Received: by 2002:a63:8f56:0:b0:40c:9877:9f51 with SMTP id r22-20020a638f56000000b0040c98779f51mr4519648pgn.206.1656537579654; Wed, 29 Jun 2022 14:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656537579; cv=none; d=google.com; s=arc-20160816; b=lCgSYTt5YtYuTaPe7lUTs1gZoQo63/d8xIBV388g5SckyrfIYmrtBdcV+jViuU2y2P iIioMwG98/9qkJJk0n/+S/IBOJwrd7JxB+X+8HpHMpF/mA8tjOBN30YF+4RRNfd+ZYGW khJ/ZbMmLceIAvYutAc42H/0F1m+S3dCvxQlAA3OG4hcN2KzvdbmG4QP+DD4t/b2vqCg evMLpWaugSfxntCmTYJUsm9msMu6pA9pHX5AcLQO67VIz8MMX1mlu+IOhyMbZ2lLMts3 7bzf7qh9tnJCX+glrHg1Ou0tnsgSq+e4wg2phdNuMix7os7yspGWZ/ztVYdOkDHxX9b2 jhLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xd+WDpUg9VILJaYqpPu6lYwgg3jpofY4wsBImKzmFvc=; b=jOPNURhb6jMpxX5wFdfHspSm1VaY+MvlFuH+dkcLbUgIKonjr+LdfERY3uteaoJm1L uwTVi8NgFloGwAdab+1k3+A6G5lNS710Wj/X6+tNu9P7t5oPEODthyq3JTdjdgvxBgTH 55gCMPOeNQdmfn56Ytvi4mcJRrzdsRyLIPUA2LuvoOn/xEvWaVBaDo2mb/WoXgvFWA8X WAsxOKvOBmZJPpNRiZaiWR8fU05tESd1+skxckgzvt8ksNHMlxHN0ZNUpATK4760+NgL VyrW1S7rpWhYSBGfJy8lGWrbRHidsLniAYmjWR6hr+DmrNt0RkajvsOTvBMIzEvBaDA2 3TKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bwSjtGek; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a1709026b8200b0016a0529c312si22880713plk.142.2022.06.29.14.19.28; Wed, 29 Jun 2022 14:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bwSjtGek; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbiF2VRi (ORCPT + 99 others); Wed, 29 Jun 2022 17:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbiF2VRi (ORCPT ); Wed, 29 Jun 2022 17:17:38 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A68D83FD86 for ; Wed, 29 Jun 2022 14:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656537457; x=1688073457; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g/luvEaLinQrCM+LWbxbhgfJFVtoq5zUGl3Wlh5mxFg=; b=bwSjtGekalZElIA/IrC3GqV2tHpwGM6cYrFdu5gfi0qK398GaVwOQWUg /vncuzGjgiGF3m5fLeLgUIh9ZZUoMYLiBc0Otqluele8VLwsn3liuNYqP ru3br4BQNDPXHgrRsn1leVlxScIPwdenhrdSLvX1bpNd2gnQMIrvFJRCn tZGT0jsn/5rZ5Rkj1Tpf+uo9kl5unagvy4BX7FK988Rk5May3fMYAcm5M IWNTQv9rtDl0UFgE9Nk6IlYNJJet6V85N22n/snd39NU06QjuziwFa7xo RUtzptV1RS12/tM7EPzKqiDfXLCdXOySydnUVxzWGHD1t6xf6HGTMpth7 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="282898076" X-IronPort-AV: E=Sophos;i="5.92,232,1650956400"; d="scan'208";a="282898076" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 14:16:50 -0700 X-IronPort-AV: E=Sophos;i="5.92,232,1650956400"; d="scan'208";a="647585413" Received: from bshamoun-mobl2.amr.corp.intel.com (HELO bgi1-mobl2.amr.corp.intel.com) ([10.212.96.196]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 14:16:49 -0700 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: luiz.von.dentz@gmail.com, brian.gix@intel.com Subject: [PATCH BlueZ v2 2/2] core: Fix signed vs unsigned compare Date: Wed, 29 Jun 2022 14:16:40 -0700 Message-Id: <20220629211640.65822-2-brian.gix@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220629211640.65822-1-brian.gix@intel.com> References: <20220629211640.65822-1-brian.gix@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org __time_t is not a portable data type, and can cause sign mismatch on some compares. Fixes: CC src/bluetoothd-device.o src/device.c: In function ‘device_is_name_resolve_allowed’: src/device.c:4092:17: error: comparison of integer expressions of different signedness: ‘__time_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare] if (now.tv_sec >= device->name_resolve_failed_time + ^~ cc1: all warnings being treated as errors --- src/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 7b451e458..b91e5dc58 100644 --- a/src/device.c +++ b/src/device.c @@ -4088,8 +4088,8 @@ bool device_is_name_resolve_allowed(struct btd_device *device) /* now >= failed_time + name_request_retry_delay, meaning the * period of not sending name request is over. */ - if (now.tv_sec >= device->name_resolve_failed_time + - btd_opts.name_request_retry_delay) + if (now.tv_sec >= (time_t)(device->name_resolve_failed_time + + btd_opts.name_request_retry_delay)) return true; return false; -- 2.36.1