Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2136009pxj; Sun, 13 Jun 2021 09:43:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoirCnIBJUOnE/42Ypr9OhO69TAnW3lO2OVczvfXe8PGgY6yRaVoL7HSW3j/9pXZmgfPsv X-Received: by 2002:a17:906:6bc7:: with SMTP id t7mr12139960ejs.267.1623602608629; Sun, 13 Jun 2021 09:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623602608; cv=none; d=google.com; s=arc-20160816; b=E4vn8hrjMXifBJ2z/cuC7PhK2LpYzip1bIVxH2T9GB/hTaC4TxWK2DhJ9A4vJJjMgu MFwObu96UhumnOD5fBf8WIB3WUxrLWNenfuzHjpgNgjUmVi641EyoTDhnXOeoBUiy3Dd g9p2X1miIkCYCeihd9q99T04sXMP3GIwjXF3Nqlk6pJbzRHY5Csq0K7nuGDGNQYHEoX2 SlinYJ3qzX+Orkyg8KGMvPGUKG/2ZhgWMj4OW8p+hAWuGMLtsorOCNyJL256A6ZMPF7Y 6Fi8v20bz/qHFPGCRLcJtOWbCMdGN5ExHszArWvQfDqUKErRjaKr8nlxKe8/38So3O5k i0lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zRPRNwiv+Qa7LFNhBGliyXNB+ILCSmwq5eW3TGTSNt4=; b=ercBD6C8GICKuAc8MiMjsl9OhIoFVs68vxYrlGCkB3eYASR1xfs3br+dd8jjMU5/rd 9xSwrqK4KT3VltX4oKYJr/3/Znlzos6uUpffXeY5nxo04NMNtihuT6dOXls6qtih3Ig3 tJ6N3wR6ZKJYN1VYoj8uC49CL4nTNTJC5gzFlR3KugOd6R+OB1d1ImG89pca0lyokLRJ SSVqX8+kHr8tYbXvrRfRy8UyJxsTTzcu1krYNweZ7p+q+jTmGDrIsf7px4PpPg47ue3W m3cUCPHJtuIBvCvxIqVYyYmtzXmvG3ZYZUAiqH3YJr1+TymMjbZPn1V8Uonpr1BX9ZLR Z9MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ir8CB+iH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 28si9074802ejk.601.2021.06.13.09.43.05; Sun, 13 Jun 2021 09:43:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ir8CB+iH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231951AbhFMQn5 (ORCPT + 99 others); Sun, 13 Jun 2021 12:43:57 -0400 Received: from mail-ed1-f43.google.com ([209.85.208.43]:40638 "EHLO mail-ed1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbhFMQnz (ORCPT ); Sun, 13 Jun 2021 12:43:55 -0400 Received: by mail-ed1-f43.google.com with SMTP id t3so43324183edc.7 for ; Sun, 13 Jun 2021 09:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zRPRNwiv+Qa7LFNhBGliyXNB+ILCSmwq5eW3TGTSNt4=; b=Ir8CB+iHpFkcvuC0iayj4871f+XLzvhX6J/Kt97Mt3KEOnhKF2FuoPmCgCXiyFHVZb a3vZ1bFlfJqYsgReA//8fKfvmfAw9UQ9L3/FROogtXl5Y+0Yg5/PdSLnMyCqRq9wloMj c8xEpAkHe1qMxWqPIzfxymaDwcEWycewdrirLQW5fQ1KX1FzjvOTpfvXdrZ1MU1hqc0c rMXOCxvDfsS2Hl/dVNhr7LxGEB6v70IW3ddxeuBeK6C1UCVhQEqVklTR+kXXr/isMR3L m8GVKj/SMqD9dU+fdcwhkuCbMXWfF9S5kS3y5eJj6PZqeVG10KUByzLXnFKoSlvftplU Q81w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zRPRNwiv+Qa7LFNhBGliyXNB+ILCSmwq5eW3TGTSNt4=; b=aMYahrn+XZSrVI/JUPmnKD5DrqCBhqrrPHw0agsw3o/+Je5QuzJ6g2LDe5f2Evmp4V pNixTgEwfuC8YAz0ijZhHF4bCzUSG0MNT5/XfKanpARr3fhbWRkZvy9GPVK4VoKRL04n 6wMyAZgpvOostQCS42p2fuUKM1ZfMDQ3j3Iu85M/GtrrrbEiNuLOrfZccDJTLC6aGhR8 gcnTDvmJbLVdS9pjtfy27JSB1LSWwpnndaocDHaTiDkdNgkKF8CeZ1MI10CnC41QsFvP /1mqJs+tY07dtHtAkAmkchSXyK8bRq8bhmJFa3K8FS+uJD7c5nfY+4bWmupIBUPoRjKI B0ug== X-Gm-Message-State: AOAM530ZvsoJR6FmpUwzC43znMSO3soR/kwqFy69BIVhNvsMjYJjKPxf U5yQgDRlQjv+SzBw12zmAYQ1Z0S8YthVmUzkjnQ= X-Received: by 2002:aa7:c7cd:: with SMTP id o13mr13362281eds.269.1623602438426; Sun, 13 Jun 2021 09:40:38 -0700 (PDT) MIME-Version: 1.0 References: <20210613122858.1433252-1-fbihjmeric@gmail.com> In-Reply-To: From: Jhih Ming Huang Date: Mon, 14 Jun 2021 00:40:27 +0800 Message-ID: Subject: Re: [PATCH v2] rtw_security: fix cast to restricted __le32 To: Greg KH Cc: fabioaiuto83@gmail.com, ross.schm.dev@gmail.com, maqianga@uniontech.com, marcocesati@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 13, 2021 at 8:34 PM Greg KH wrote: > > On Sun, Jun 13, 2021 at 08:28:58PM +0800, Jhih-Ming Huang wrote: > > This patch fixes the sparse warning of fix cast to restricted __le32. > > > > Last month, there was a change for replacing private CRC-32 routines with > > in-kernel ones. > > In that patch, we replaced getcrc32 with crc32_le in calling le32_to_cpu. > > le32_to_cpu accepts __le32 type as arg, but crc32_le returns unsigned int. > > That how it introduced the sparse warning. > > As crc32_le returns a u32 which is in native-endian format, how can you > cast it to le32? Why do you cast it to le32? Isn't that going to be > incorrect for big endian systems? > > thanks, > > greg k-h Thanks for the fast reply. Yes, you are right. I did not notice that le32_to_cpu already handles both of the cases. So it seems the warning from sparse is false positives, am I right? thanks --jmhuang