From patchwork Thu Dec 8 09:26:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 9466069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E203E607D4 for ; Thu, 8 Dec 2016 09:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD4FE28536 for ; Thu, 8 Dec 2016 09:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1B7128533; Thu, 8 Dec 2016 09:26:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB25528532 for ; Thu, 8 Dec 2016 09:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbcLHJ0e (ORCPT ); Thu, 8 Dec 2016 04:26:34 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33057 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbcLHJ0d (ORCPT ); Thu, 8 Dec 2016 04:26:33 -0500 Received: by mail-oi0-f68.google.com with SMTP id f201so49401024oib.0 for ; Thu, 08 Dec 2016 01:26:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wc5ATaBn85nEJ3tSjTBV4s2gHWORYy+ibx4/1ZB36wc=; b=gt62aFOD/FwoFqEZ8XwsC/letJyovcZo9xVAP0KO9yUTeeXd9NQO5RCTo4EP619wBX 37zwZW0lASgDNrTrXNuZjUnnpknG1sXZ+gtup/gWG5uO1nagUOZD13rHs6J+NdRHtqwl L62J5TvU/ivR5I48JQbjSOlb/7tI8IqPK2pXf6jId30LXgFNl4EmJHtCXDmE24SKHfGl Kb6rqQfxctn7c+Zi/ftoZKQ5YZF47x/rz+dCg4/C+tUBsC/2uBzh2aF84EonKbMFpRNV K2RPr9kF51Z4oxiUt/H/Bw3bI43vdaJTVzdLPweawfMVqv8CgZXWfcsRj0pspUP8Z3+a EZ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wc5ATaBn85nEJ3tSjTBV4s2gHWORYy+ibx4/1ZB36wc=; b=lff07p/x39csksNTjhf+ziRuOmLoOffqwNMOHYJje8D/AJqPJf7Uv+Y0Wl+LuVnrHp OwL7lUBY8TA+LvtRCUoqXo2aCgdHWaU60r2tHWyzNlDq8TP0HoUE1ET/7YxH/uZ6iI70 F0bt8ck1r9nVsBRCGQkgqI1ue0i/qP0xsi0CKP18UhNXlaSb9MGYfHfklk+qazT/I4Da 1iuCI8MBl8M3xaxuEAgqUezwkBZBjrnKNg4tfGWEVZ09dUlLapcFqUn5FeLgq9bwBXEM c3yJGnkW0czJ6ud1wXkyqt2JF1PDoLkzbOkTlE5x+OQSsisb2TnYQJznYScdXZ4xcG4K hVgg== X-Gm-Message-State: AKaTC01aWumyN8btuSddDXhBRJAJ8jLAju95MDgfWYDb075GRJQDpPD5T/Hf1aYWvu6SywLvErve4MA6gDd2aw== X-Received: by 10.202.80.149 with SMTP id e143mr34166521oib.93.1481189192567; Thu, 08 Dec 2016 01:26:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.241.4 with HTTP; Thu, 8 Dec 2016 01:26:32 -0800 (PST) In-Reply-To: <572c702f-589f-2d5a-9e13-45223191db85@sandisk.com> References: <9ff07804-492c-c67a-e729-b31e0f863027@sandisk.com> <572c702f-589f-2d5a-9e13-45223191db85@sandisk.com> From: Or Gerlitz Date: Thu, 8 Dec 2016 11:26:32 +0200 Message-ID: Subject: Re: [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions To: Bart Van Assche , Saeed Mahameed Cc: Eli Cohen , "linux-rdma@vger.kernel.org" , Matan Barak Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Dec 6, 2016 at 3:19 AM, Bart Van Assche wrote: > This patch does not change any functionality. Hi Bart, Matan came up with a fix (below) which solves all these sparse complaints in both drivers (mlx5 IB and core) while basically not touching the code, we will be going with that fix to 4.11, thanks, I will add reported by pointing to you. Doug, in case you picked that, I guess you have to drop it. Or. iff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 9f48936..0abdc66 100644 } while (0) --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -67,10 +67,11 @@ /* insert a value to a struct */ #define MLX5_SET(typ, p, fld, v) do { \ + typeof( v ) _v = v; \ BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \ *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \ cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \ - (~__mlx5_dw_mask(typ, fld))) | (((v) & __mlx5_mask(typ, fld)) \ + (~__mlx5_dw_mask(typ, fld))) | (((_v) & __mlx5_mask(typ, fld)) \ << __mlx5_dw_bit_off(typ, fld))); \