From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFE6CC4360C for ; Tue, 8 Oct 2019 12:01:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9D81206C2 for ; Tue, 8 Oct 2019 12:01:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="f6JAs83o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730852AbfJHMBj (ORCPT ); Tue, 8 Oct 2019 08:01:39 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:48094 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730332AbfJHMBi (ORCPT ); Tue, 8 Oct 2019 08:01:38 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x98BxTvQ106900; Tue, 8 Oct 2019 12:01:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=corp-2019-08-05; bh=5OOQQoMP5M7pfQCwNLUFb0PmrXeN3ZnqGaV2mHo830o=; b=f6JAs83oegGIJYiemESAvutFpfcpL02t5XhnSeYWzVU5uV6fQGVBMfGQIf9Cbs3Gr0Vb SzBD+jCc66siEIvmi3eSBDHWbsIJjySo96yNfpTK+RG+x6WdubJxEmByffavP0H2ziEy ulvCNNmqeTDNnrpCR8pkmlogY6dCXZZJrb+scGQV/TDscUTzaAbafkJqq92qGJ/oawWl qpSy6fsD99PFVCQmgCgfY6JN+ArLiGYu47IbAAj0bqzGZAWdB7b8chdWsfBpdPG2y3Yy +4GSjQt3RnYqSWzu7blZGG+bGdz7kys8wrzk5JhCKW1FdsEz3ARAAjXaptjrKuW6nU6n tA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2vek4qcsfn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 12:01:27 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x98BwGl3022146; Tue, 8 Oct 2019 12:01:27 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2vg20656gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 12:01:26 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x98C1PY1006067; Tue, 8 Oct 2019 12:01:25 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Oct 2019 05:01:25 -0700 Date: Tue, 8 Oct 2019 15:01:16 +0300 From: Dan Carpenter To: Jerome Pouiller Cc: "devel@driverdev.osuosl.org" , Greg Kroah-Hartman , Stephen Rothwell , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 4/7] staging: wfx: correctly cast data on big-endian targets Message-ID: <20191008120116.GF25098@kadam> References: <20191008094232.10014-1-Jerome.Pouiller@silabs.com> <20191008094232.10014-5-Jerome.Pouiller@silabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191008094232.10014-5-Jerome.Pouiller@silabs.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910080117 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910080117 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 09:43:00AM +0000, Jerome Pouiller wrote: > From: Jérôme Pouiller > > When built for a big-endian target, original code caused error: > > include/uapi/linux/swab.h:242:29: note: expected '__u32 * {aka unsigned int *}' but argument is of type 'struct hif_mib_protected_mgmt_policy *' > > Fixes: f95a29d40782 ("staging: wfx: add HIF commands helpers") > Reported-by: kbuild test robot > Reported-by: Stephen Rothwell > Signed-off-by: Jérôme Pouiller > --- > drivers/staging/wfx/hif_tx_mib.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h > index 167c5dec009f..4f132348f5fa 100644 > --- a/drivers/staging/wfx/hif_tx_mib.h > +++ b/drivers/staging/wfx/hif_tx_mib.h > @@ -145,7 +145,7 @@ static inline int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) > } > if (!required) > val.unpmf_allowed = 1; > - cpu_to_le32s(&val); > + cpu_to_le32s((uint32_t *) &val); Again, this is fine for now, but in the future there shouldn't be a space after the cast. It's to mark that it's a high precedence operation. cpu_to_le32s((uint32_t *)&val); regards, dan carpenter