Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1099938lqj; Mon, 3 Jun 2024 10:04:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBqm5JGqeMjnJkiaITFWjCjUwsrUISRq0jfOVnsFjPxPgGrDTR0FSgpwZc6ef8fKdqDAwhWUTQynNyEMSzugv1JtG3qjWeYXj+hDs6GA== X-Google-Smtp-Source: AGHT+IGnPafhWFzD5lfeuZN4lnnRK18JLlS6sgYlTQP5+YWaND8X7C9zp16FL62grfoGaSRDte/P X-Received: by 2002:a17:902:ecce:b0:1f6:32ef:3e00 with SMTP id d9443c01a7336-1f692f6ebd3mr4167185ad.0.1717434280600; Mon, 03 Jun 2024 10:04:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717434280; cv=pass; d=google.com; s=arc-20160816; b=PVeMGVQrP1Em/O8tMm3Ir1yZA8mJHc7Ie1eZZHqGctYZzfhceARe3FZKqoO1byh+9Z 8u64aG8n7dWANW62hYtOCFN3XNZVHZNbFs8vp1JY4qKN00Utn0ySB6QEgBsqNy4yJ4mR NfAuuYF6emMbxQ4FkHAG544HmdUD4rAZBAqjJjJJAPHd3LpV8LLOfwfIrZWH2589ab/K VXM6hrj1a+479tOq6sjOvqOb7facd/p2nSjZGO380hewf6OrUSkoZ8DYMGGsn1ApkmIf J8aIew2dBN5r+dCz4j252hMR050gqcEa5w3ZXfsN/vDZBVOQwHdzdjVwwbq8u8eW8dLu ZiOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=JtY12Dsp1tQBEk/6vfbTHTst26MVwHCkWKlqOeK2IPQ=; fh=1eSWQaer5t+93IcvOn28N4OBOCBwng/+13ILG7aYGl8=; b=BgVj6zhAEmKySnzxFHWJeuWzef/VDWrwsvWURO0oDH+6TWqVZZgGGddGEUwW2Zq/SQ 40BSmuNoyfe0sSXOv+uaf9Gt7MhOJWQ/Wj7aDylHDbEBAAHRAZ5wYl/ExJ/Mavmv8yFc QA2quJlmbl7nCrdDzIAjQusoZL/jpGXub36uhmN4vE2nk5grb06bnY0aociExGTiCOe3 UDG+m5t97d1EMboha8E5uDE7ui2ni3zUU5mDhdlTuu5+Gs8vMLpZ62pF0c50/RZVrKfO ZphYMr3kJEUS80WO/Pwsu0DkovmowUpYsQsdF+UbhQgNVu37fJD5qKJ/oBSzBQTMMqtC LFOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=aEbsEkmu; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-199480-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199480-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f637210cf9si62854795ad.89.2024.06.03.10.04.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 10:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199480-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=aEbsEkmu; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-199480-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199480-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DCDFBB2159B for ; Mon, 3 Jun 2024 17:04:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25635136E09; Mon, 3 Jun 2024 17:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="aEbsEkmu" Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 198F3135A6F; Mon, 3 Jun 2024 17:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434270; cv=none; b=o6gvRNOrsBrnD2LAApQMu6apnQv3T/YpIJoZp6tNIWcQ03XYDglR+FjzOjedXB/BKk5m5yenZvjBR2yBCEs2X6YStt3TzUOBOGp9GWbpy3qFot9jPCYoBNgVw2y3ChQOlV3CXjaeLO3wiul4jQBze+PW2qdSQCWoXYCSNNBTiME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434270; c=relaxed/simple; bh=E3oU8M74cdXayBkUvHSW5fNZ5YRYFFx9Gb/AKu/gim8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hcEwVT/n58/G+8Z8k284QjpbgDb+/YDoD9doYg0GD7232L47Qp1j4/U/g6UiNS1ZnA6LXJUOMh+WIQD1yNfCl/h+P9SVjP8K0hPzjpb4LP2pwzAHVnGBG1ZjIMexNqdhYoYvD5Y9f79csrOZopP8JK6PVbzXSDrfaHaZL5NrOhs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=aEbsEkmu; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4VtKlP3PFXzlgMVb; Mon, 3 Jun 2024 17:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1717434127; x=1720026128; bh=JtY12Dsp1tQBEk/6vfbTHTst 26MVwHCkWKlqOeK2IPQ=; b=aEbsEkmu1IKfdgF91m8UlP2hhbJQP6PmNRrkPIf5 uMJZRhEETTpG146movR80k0eNKOcLCboIi+0MWcxFDo+seiVOYZRTqsbDCaSZ9SG Ma3AjQ0HnMy3ZUmJbgJ/29IVBg9pXuBJhUEie7+58pwi7P/b+NX4AgNrDTx2l+f9 X7Oy5dSPeWxsOBY5E1vuamsrFf12emaY04d3u7pOz6+gVjBmDlMr19aLe1qnGp28 Lm7tGKC/p4qQj50dVjsPVzC5EKl2xp2Bgtb2DDpzea20Gzm51+JSS43xPYw+b2N8 1X+gEh8mm837cDSlghj4Jy3E3qr/v+j4+2y0xA8MLGB3SA== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id fZxuwoU9O47G; Mon, 3 Jun 2024 17:02:07 +0000 (UTC) Received: from [192.168.50.14] (c-73-231-117-72.hsd1.ca.comcast.net [73.231.117.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4VtKlM0Q6TzlgMVV; Mon, 3 Jun 2024 17:02:06 +0000 (UTC) Message-ID: <28fc5c30-ece5-4436-b066-3142147a4547@acm.org> Date: Mon, 3 Jun 2024 10:02:03 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] null_blk: fix validation of block size To: Andreas Hindborg , Jens Axboe Cc: Andreas Hindborg , Keith Busch , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240601202351.691952-1-nmi@metaspace.dk> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20240601202351.691952-1-nmi@metaspace.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/1/24 13:23, Andreas Hindborg wrote: > + ((dev->blocksize & (dev->blocksize - 1)) != 0)) { Please use is_power_of_2() instead of open-coding it. Bart.