Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2208861iof; Tue, 7 Jun 2022 23:15:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZAQvvSYlWRpSfi7KadgkjE70p2B42qoaZ3zgW2RTA3fyx7W35UbjZ2sWINIin/tczxkBh X-Received: by 2002:a17:90b:2482:b0:1e8:a80b:c5bf with SMTP id nt2-20020a17090b248200b001e8a80bc5bfmr6698509pjb.14.1654668945598; Tue, 07 Jun 2022 23:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668945; cv=none; d=google.com; s=arc-20160816; b=egdkOG2ybWTsaWO6O2dEwH+QEKO4f3aucT4FHd56QiNKHeXjIjA9n4pfpvJRohkQ7f bQn+erI5rGMY+OK4MyZ2kmT1BpZDr4SnJt8xfwoRP3oGVJqj4SzLMrhQjas+Rm6qWMjI BnnxSXCX3/dSWIbozl6YiYb7Yq8O+fyWVdhjkg/EvHYprjvbNK4WHvOFBeu/0fOM6Nrk iKAQnfLhA8mJy+ZUG32Xj/vX2kYFZTXfngO6WAdumPLnVw8J60WD9t7dwyc3u32unf+B jFt1BSjIRtsrmzZebPGnI97LrnHz2Mpa/5CZaKlBgiKD+I675H6XE+RGHNh+unTEA8Tv MAAQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=OAR2/RmOjZbYj98rO6ac1mg+RH5GE5HBqimT+k5kjhE=; b=mhs7F8cBPmd6cQZeuqvA7pAXb+9VYsG5NNvBANYuXEaIvtWB0iOCNETdV+kfTRoFbA KHGwcjaDCVMt7Dzxp3h79d92TVgrlE55hO5UNs2qJw6EDJvkitclqVhzC1tzFDcDWIJ2 DvdLZ1XSBXtJk7i3V2MW2uddj/uqOXccO0Rsrebb02uS2DEpMXYnY9C/TM8c8wZzPxA5 9ud9ZoDkCyNPKx1YRA2hTtMIU+BcTQY0ZHgSaEHpO8RLVqOzZdDJAhhVuYcK8ApUJh6u Nc1BGGokeXKlyOUICDAGBMqJdiDe57R39sqNJBMWBGoqeO+OsIWP3e74XDR574wiGIO6 7oCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M3MPEpZW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bd8-20020a170902830800b00158eabc46casi10277789plb.604.2022.06.07.23.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:15:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M3MPEpZW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69F8422C2FD; Tue, 7 Jun 2022 22:37:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234762AbiFHByE (ORCPT + 99 others); Tue, 7 Jun 2022 21:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1584071AbiFGXrm (ORCPT ); Tue, 7 Jun 2022 19:47:42 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC39F262D61 for ; Tue, 7 Jun 2022 15:20:52 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id e9so6345877pju.5 for ; Tue, 07 Jun 2022 15:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OAR2/RmOjZbYj98rO6ac1mg+RH5GE5HBqimT+k5kjhE=; b=M3MPEpZWkUQnUQtZkqtKjHgTaFJPCuP8yD6txsdbih3NMKLrTcEvP0q/avKLCBU41/ /3puSqoegNDh7Vw58ZqTAqzFQvXNZo4vjupzMO9x6vGIuef2mPLe7QDoK12FQf8TRNCU QXDScL4D3ps9PbPDGeE2keSpUqUtL0+rZ+N+gpkGis57IM+IWoIh39TagtQ/5ncRsRFB rUvPu3HI3WC7nwKIGFJgWkBm9tDiJ/IAkD64f5OZO24Fdg3LlE9AH/BANr5RyATboyZA RGUeSYZ4GkusZ++xgV7AaoVhJFjcoyb3Xlm3XaDEUfvY6itgyXI7eYERZqVVaMGoHmtS VyuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OAR2/RmOjZbYj98rO6ac1mg+RH5GE5HBqimT+k5kjhE=; b=uY2eFttuil6IY13dYCgnakF3cZ/I9gWphLY1mBk52Yw2ezC0fFK61mvPAYWBiYnGuA m/NnxsubIR4i/2YcNo89vmmy3+CiTnWneZQibnwNHvsIKxbVIe53jPgKy6hDKyE+8v86 sBqUbOOmWg5Vem/N+vxqybccUcXYRse9QzjcjejBaXsHP5p/XNAomevBg8JrHjGOGWZc ByjJq9l8HH+O7THLc2PnmCcygM9QQVABsjZ4ZRfZR1WwmX8XoT3eprQeoWFqWGqX88RU gJCSz+0m5tPMPBktgQExKcKRnTqRyOfMlHt749bNGHfwwjNdkcCK0J4ZgcVoVyP3KsOo XDqA== X-Gm-Message-State: AOAM531J4/FtWOf3muo2dRA2NzluiZRlUQCgL0qvBKr6v5GkZv8zgsuz sF5J9iXduU9Y7IJtr0Zoo6w= X-Received: by 2002:a17:903:1247:b0:156:25b4:4206 with SMTP id u7-20020a170903124700b0015625b44206mr31259117plh.146.1654640450835; Tue, 07 Jun 2022 15:20:50 -0700 (PDT) Received: from penguin.lxd ([2620:0:1000:2514:216:3eff:fe31:a1ca]) by smtp.googlemail.com with ESMTPSA id p10-20020a170902780a00b001640aad2f71sm13286969pll.180.2022.06.07.15.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 15:20:50 -0700 (PDT) From: Justin Stitt To: Andrew Morton Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Justin Stitt Subject: [PATCH] include/uapi/linux/swab.h: add __u16 cast to __swab16 conditional Date: Tue, 7 Jun 2022 15:20:06 -0700 Message-Id: <20220607222006.22719-1-jstitt007@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org if __HAVE_BUILTIN_BSWAP16__ is defined then __swab16 utilizes a __u16 cast. This same cast should be used if __HAVE_BUILTIN_BSWAP16__ is not defined as well. This should fix loads (at least a few) clang -Wformat warnings specifically with `ntohs()` Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Justin Stitt --- include/uapi/linux/swab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h index 7272f85d6d6a..f6be3f2e6fee 100644 --- a/include/uapi/linux/swab.h +++ b/include/uapi/linux/swab.h @@ -102,7 +102,7 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val) #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x)) #else #define __swab16(x) \ - (__builtin_constant_p((__u16)(x)) ? \ + (__u16)(__builtin_constant_p((__u16)(x)) ? \ ___constant_swab16(x) : \ __fswab16(x)) #endif -- 2.30.2