Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9469603pxu; Mon, 28 Dec 2020 17:41:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNBpXBTd2g+qtT9x1aCEk2r7kvfJQrK11RDIiyPn8Pd6AH3yApaXK4x6LXqfpSEnlf5s1u X-Received: by 2002:a17:907:20dc:: with SMTP id qq28mr43641393ejb.403.1609206079218; Mon, 28 Dec 2020 17:41:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609206079; cv=none; d=google.com; s=arc-20160816; b=Mw9S19uBs0oeEDYW3VCkkGH3nc4LpRN+5cjZS5NxZmZL1BmXnH+AJ8K19DWUOU38XZ WH+EDWENct556+3/KmVXsXhKf7rdrqTgHRm5/SryTOfk9AErfqUQ2fH2kyC+kjyiMl49 wfSLSIQuh5u1RM0dIvR19RtUYcXXUhuiIacpLgqVgiCn/Fg8wrPOHNH5Ve7H119J2Szu lronH4hG8aRGAhCM37PdX+2NbyPJnyICCSFdC7l2zEgeQvFCHa9RvQ88VdyLO07IDfMB TjH87V09F7UaHylT3j4yijHvVNpnh1UmFDMnKf1yM1ejRXYey6MjdJn3q1SGG6QFgYZG 0qJg== 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=mefs6IO4fpe1pJKV+4QYYGcjGLqpTJy7UHVzYhuwOPM=; b=YLYCoiytbTj1cG//TAwRiUKjTJMT/7gyZZswD2UjzNS8y69WhLLNGT+qIE3APEJDoQ Aj26tlqElAmKbexuuUOX7lyfBm4OgpnpnG2poRq8B6BQgcU4ZFxfAHqtvIt7kj9jDNTx KE6Louf5AngyPZVLX702zR1rI04QPei/tr/D7FPQ7IBO7Day2zZAk3v2kS4SXOSABqiH XuVGiPW0xRXmVtRQjK0V0LYQhyEzpzwoO4zLnXcClWf8H0GXY8S1UJPbFVMAbWvwZ4gY Lx1MEuZGPoFXLTrZyEy+sdnh7t8mwpNeWX3m1I1mnxCo1Mouwh/EzT90C7J8fMdAdyrH gd/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EoiNO5aW; 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 gb19si18007991ejc.496.2020.12.28.17.40.56; Mon, 28 Dec 2020 17:41:19 -0800 (PST) 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=EoiNO5aW; 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 S1730682AbgL1Wzx (ORCPT + 99 others); Mon, 28 Dec 2020 17:55:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729386AbgL1ULi (ORCPT ); Mon, 28 Dec 2020 15:11:38 -0500 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F62C061793 for ; Mon, 28 Dec 2020 12:10:58 -0800 (PST) Received: by mail-il1-x12e.google.com with SMTP id u12so10415039ilv.3 for ; Mon, 28 Dec 2020 12:10:57 -0800 (PST) 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=mefs6IO4fpe1pJKV+4QYYGcjGLqpTJy7UHVzYhuwOPM=; b=EoiNO5aWPDY6DDlLbkKtYaD0AJcJJv1vwvgPz2VtM7nXfBTE7EAzUNQB2mXXTvKn56 Dxrm2NWgqQbxkV19pFy7gq736xDdcXuuTRQXNRdjl/C+fLEYX5WfsRR1WSvYiocpZhvg kbu+ouZptM7RrRwxICWDHP+0achtv8v3AhuusVerdg8zpEgHHrdQ2lKHFvvpobFHSxvC CnkDG59+ybucb0MK3j4Jf4tIOiBebZZk0vE7cPpoQ9qfKuStmDWYZ1Rhw8CT8XP/+5xr yoPvgmyJc/sFdQQ73ple+dBazch1q+XTYeePoCYx9kKErSgJjAmgByiaUHVKArlTsiUA F30Q== 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=mefs6IO4fpe1pJKV+4QYYGcjGLqpTJy7UHVzYhuwOPM=; b=RWvSjpPafBAcNRxWTCxiojFgUe6ftwlMrixgLQSkV1+DkSGOxr3Tq6oagOtSMbwF+H nOHUBBur/f9IBaQrNjHDDHuKlnUj1ieowj9Y2iTf6QTXQNGR9rK4oa5Bpyqtl2CfsDJ2 ZVdEnfIzc2b9l9Yxv+u8JX1hf7BBh99flpc5qH8TtuHn/I00Ll3mMgNtpAD1+/Wcj4PC 7MzEiVNC5Oz9W8yXW3qZNnsrVo8YT0Q/zi29TldzY9Vhc6PvLXoC2ERC4C79Zw/5fTZ9 Y1ZraH9EC24loDXLDGGloF/03SM9ooheyFQgv4DwCrl1ak3AzxRahcvqamhPz5sUcajD OPlQ== X-Gm-Message-State: AOAM532cVW8zTi63GckApXiCEtjtJ1cvLWoZ6moKpjNmYdR/eN20s919 hmSe3wln1YlxVmYNPY/kkdAxIsAHOyYJYbAzd8CXmC+jkDVAPQ== X-Received: by 2002:a92:9881:: with SMTP id a1mr45981613ill.238.1609186257298; Mon, 28 Dec 2020 12:10:57 -0800 (PST) MIME-Version: 1.0 References: <20201228194343.88880-1-yury.norov@gmail.com> <20201228195016.GD4077@smile.fi.intel.com> In-Reply-To: <20201228195016.GD4077@smile.fi.intel.com> From: Yury Norov Date: Mon, 28 Dec 2020 12:10:46 -0800 Message-ID: Subject: Re: [PATCH] drm/komeda: use bitmap API to convert U32 to bitmap To: Andy Shevchenko Cc: Carsten Haitzler , Liviu Dudau , Linux Kernel Mailing List , Andrew Morton , Rasmus Villemoes Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 28, 2020 at 11:49 AM Andy Shevchenko wrote: > > On Mon, Dec 28, 2020 at 11:43:43AM -0800, Yury Norov wrote: > > The commit be3e477effba636ad25 ("drm/komeda: Fix bit > > check to import to value of proper type") fixes possible > > out-of-bound issue related to find_first_bit() usage, but > > does not address the endianness problem. > > Hmm... Can you elaborate? > > ... > > > u32 comp_mask) > > > - unsigned long comp_mask_local = (unsigned long)comp_mask; > > Here we convert u32 to unsigned long (LSB is kept LSB since it happens in > native endianess). > > > - id = find_first_bit(&comp_mask_local, 32); > > Here it takes an address to unsigned long and tries only lower 32 bits. > > Are you telling that find_first_bit() has an issue? It seems you're right, there's no issue with endianness in existing code. In fact, the line > > - unsigned long comp_mask_local = (unsigned long)comp_mask; is an opencoded version of bitmap_from_arr32(dst, src, 32). Maybe it would be better to use the bitmap API here, but existing code is correct. Sorry for the noise. Yury