Message ID | 9561641946f1404b931d97a576bfbb28@AcuMS.aculab.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-80219-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1659036dyb; Sun, 25 Feb 2024 08:57:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWiEfYZHvdGGTWBM7/Y3yOZtxB3Z089sTB9FASYeOcv7bPZysPwhh4VVA0lJWD1UEgnBQjJTedEexEVf7o0fsce7doEA== X-Google-Smtp-Source: AGHT+IEM9Jti4dhG8br1JfkOxfwaCSLGR9N0Rrz4SjLwOOB0oGw3wm3pIPtBcGpVz+QumNxZAfXu X-Received: by 2002:a17:907:1de0:b0:a3e:5ebf:345c with SMTP id og32-20020a1709071de000b00a3e5ebf345cmr4069048ejc.21.1708880266310; Sun, 25 Feb 2024 08:57:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708880266; cv=pass; d=google.com; s=arc-20160816; b=ZzayXyrx7BOoPa/f33aNmZGjPSGU+niLKU6oAGTs4DOukRvIv4UuIVGD/j5bAOTIcH qsYxVQHjINDg+7RmbEaMv5/VBuNgqAk5ke264FEBNZu5utRfsQxVOs1FXbrlpPVfhQvW 8knPX388HRVDZFgpoR4H9dUe9Xj0eRZyomcK0SunudTYv9376JjGlqjmkIrVaSqa0IRd GonTrHye/pUdLwDHeehuVKupM6hxbHR7QcNADqrml7iAgnhdaCaLkwPPuMLROcDSz8ud 4A1mYM1mw0hOYMp7CniE9CueWHx/hKwu4SvwDlry+NKsEMhpL00LqwhL2hhYGIug01PH pkSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=kLObBfzrrymijIw+aLKmED41fp+jo11zk4huTr4eB4w=; fh=nGE692sbVdRvha6RYbzMUXtm1nr/30sV7frdtDN2z14=; b=ovrGqace5GZIJ2bUeow1KEQhYASqsBbCV8/OHyvNGs8b4S1+1yhcPih0i+rH5W8Kb5 3Bx6j6tyqpjwFejCcD+yP2sEWWZClH/jmlGgXF2i89lxiFjIRHShLhPGoHB3J9C5TCRQ GYBh7EB7MEZmjx9jBbFf7ct0bX5dZZkot8objutB6JINP87t69IomXe40d1FJR97eON5 Ghm8Nz+0ZQLFjkUi9SFD8H/jwdmh9XBbnnkacG6wVFdacTtxSxCUDTffkxtGEJxqndv/ ocmz9SzSXXkht6lMhGUoRy8765ZHjbYrZZyku6gf72NpScalZ4L6ibMAo7eSCXELcZlO ICfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-80219-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80219-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m6-20020a1709060d8600b00a433c7a39fdsi349761eji.94.2024.02.25.08.57.46 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:57:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80219-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-80219-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80219-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id CC2811F21DA9 for <ouuuleilei@gmail.com>; Sun, 25 Feb 2024 16:57:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5818E1B948; Sun, 25 Feb 2024 16:56:23 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (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 2B1111802E for <linux-kernel@vger.kernel.org>; Sun, 25 Feb 2024 16:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.85.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708880181; cv=none; b=uJgxffw8Tx37FFkNgSsqYxgBpnRFqVwk5T62NpRcbkD+iJQzIOYTYbRdKW5WYjpaX6LzPVpFnZ4IA6kMVcGEd/F9gEOfzOS4g1O3f59udR+uX5gy1+7NXbynfCWpMU0UMcnN/2wIsvN/+JwFNw0q0iv6oRLCr0wEYqOv/KAP30E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708880181; c=relaxed/simple; bh=zOWFqzB7N0pb8vLD4U0rutFH4q0ufXT6YzwjVxhLXv0=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=am6ga1zFqipkVcxcrlHgfZIYr/5+ZmwKEjXc/p8MrLu3xCyT5cUXU7RrAB6V1DpJOJ7sLjriqqvjg4WS5VAdS1bfrXui5EuuLWRkHbwCvd3k/tnqAFSxZym4dIOiqNZWByV7NLmMuShtrFBuwfTJEGOwiTxtK1dgAdzV7BxIM4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.85.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-258-4eUIVhTQPOq-JwK6Hr19cA-1; Sun, 25 Feb 2024 16:56:17 +0000 X-MC-Unique: 4eUIVhTQPOq-JwK6Hr19cA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 25 Feb 2024 16:56:16 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sun, 25 Feb 2024 16:56:16 +0000 From: David Laight <David.Laight@ACULAB.COM> To: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>, "'Linus Torvalds'" <torvalds@linux-foundation.org>, 'Netdev' <netdev@vger.kernel.org>, "'dri-devel@lists.freedesktop.org'" <dri-devel@lists.freedesktop.org> CC: 'Jens Axboe' <axboe@kernel.dk>, "'Matthew Wilcox (Oracle)'" <willy@infradead.org>, 'Christoph Hellwig' <hch@infradead.org>, "'linux-btrfs@vger.kernel.org'" <linux-btrfs@vger.kernel.org>, "'Andrew Morton'" <akpm@linux-foundation.org>, 'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>, "'David S . Miller'" <davem@davemloft.net>, 'Dan Carpenter' <dan.carpenter@linaro.org>, "'Jani Nikula'" <jani.nikula@linux.intel.com> Subject: [PATCH next v2 10/11] block: Use a boolean expression instead of max() on booleans Thread-Topic: [PATCH next v2 10/11] block: Use a boolean expression instead of max() on booleans Thread-Index: AdpoC3sh/004JKwJQQKikvnz7Zkpuw== Date: Sun, 25 Feb 2024 16:56:16 +0000 Message-ID: <9561641946f1404b931d97a576bfbb28@AcuMS.aculab.com> References: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.com> In-Reply-To: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791890834252878882 X-GMAIL-MSGID: 1791890834252878882 |
Series |
minmax: Optimise to reduce .i line length
|
|
Commit Message
David Laight
Feb. 25, 2024, 4:56 p.m. UTC
blk_stack_limits() contains:
t->zoned = max(t->zoned, b->zoned);
These are bool, so can be replaced by bitwise or.
However it generates:
error: comparison of constant '0' with boolean expression is always true [-Werror=bool-compare]
inside the signedness check that max() does unless a '+ 0' is added.
It is a shame the compiler generates this warning for code that will
be optimised away.
Change so that the extra '+ 0' can be removed.
Signed-off-by: David Laight <david.laight@aculab.com>
---
block/blk-settings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Changes for v2:
- Typographical and spelling corrections to the commit messages.
Patches unchanged.
diff --git a/block/blk-settings.c b/block/blk-settings.c index 06ea91e51b8b..9ca21fea039d 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -688,7 +688,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, b->max_secure_erase_sectors); t->zone_write_granularity = max(t->zone_write_granularity, b->zone_write_granularity); - t->zoned = max(t->zoned, b->zoned); + t->zoned = t->zoned | b->zoned; return ret; } EXPORT_SYMBOL(blk_stack_limits);