Module Name:    src
Committed By:   riastradh
Date:           Wed Jul  5 10:58:47 UTC 2023

Modified Files:
        src/sbin/nvmectl: firmware.c wdc.c

Log Message:
Revert "nvmectl(8): Ensure A divides S before aligned_alloc(A, S)."

C17 lifted this restriction.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sbin/nvmectl/firmware.c src/sbin/nvmectl/wdc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/nvmectl/firmware.c
diff -u src/sbin/nvmectl/firmware.c:1.5 src/sbin/nvmectl/firmware.c:1.6
--- src/sbin/nvmectl/firmware.c:1.5	Tue Jul  4 20:40:43 2023
+++ src/sbin/nvmectl/firmware.c	Wed Jul  5 10:58:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: firmware.c,v 1.5 2023/07/04 20:40:43 riastradh Exp $	*/
+/*	$NetBSD: firmware.c,v 1.6 2023/07/05 10:58:46 riastradh Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: firmware.c,v 1.5 2023/07/04 20:40:43 riastradh Exp $");
+__RCSID("$NetBSD: firmware.c,v 1.6 2023/07/05 10:58:46 riastradh Exp $");
 #if 0
 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/firmware.c 329824 2018-02-22 13:32:31Z wma $");
 #endif
@@ -123,7 +123,6 @@ update_firmware(int fd, uint8_t *payload
 	off = 0;
 	resid = payload_size;
 
-	__CTASSERT((NVME_MAX_XFER_SIZE % PAGE_SIZE) == 0);
 	if ((chunk = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE)) == NULL)
 		errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE);
 
Index: src/sbin/nvmectl/wdc.c
diff -u src/sbin/nvmectl/wdc.c:1.5 src/sbin/nvmectl/wdc.c:1.6
--- src/sbin/nvmectl/wdc.c:1.5	Tue Jul  4 20:40:43 2023
+++ src/sbin/nvmectl/wdc.c	Wed Jul  5 10:58:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.5 2023/07/04 20:40:43 riastradh Exp $	*/
+/*	$NetBSD: wdc.c,v 1.6 2023/07/05 10:58:46 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 Netflix, Inc
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: wdc.c,v 1.5 2023/07/04 20:40:43 riastradh Exp $");
+__RCSID("$NetBSD: wdc.c,v 1.6 2023/07/05 10:58:46 riastradh Exp $");
 #if 0
 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/wdc.c 329824 2018-02-22 13:32:31Z wma $");
 #endif
@@ -125,7 +125,7 @@ wdc_do_dump(int fd, char *tmpl, const ch
 	fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644);
 	if (fd2 < 0)
 		err(1, "open %s", tmpl);
-	buf = aligned_alloc(page_size, roundup(NVME_MAX_XFER_SIZE, page_size));
+	buf = aligned_alloc(page_size, NVME_MAX_XFER_SIZE);
 	if (buf == NULL)
 		errx(1, "Can't get buffer to read dump");
 	offset = 0;

Reply via email to