Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754164AbbFCKbj (ORCPT ); Wed, 3 Jun 2015 06:31:39 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:35590 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754125AbbFCKbY (ORCPT ); Wed, 3 Jun 2015 06:31:24 -0400 MIME-Version: 1.0 In-Reply-To: <1433260130-1604-3-git-send-email-sergei@s15v.net> References: <1433260130-1604-3-git-send-email-sergei@s15v.net> Date: Wed, 3 Jun 2015 12:31:22 +0200 Message-ID: Subject: Re: [PATCH] kdbus: kdbus_item_validate(): remove duplicated code From: David Herrmann To: Sergei Zviagintsev Cc: Greg Kroah-Hartman , Daniel Mack , David Herrmann , Djalal Harouni , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 41 Hi On Tue, Jun 2, 2015 at 5:48 PM, Sergei Zviagintsev wrote: > KDBUS_ITEM_PAYLOAD_VEC and KDBUS_ITEM_PAYLOAD_OFF cases use literally > the same code, so merge them. > > Signed-off-by: Sergei Zviagintsev > --- > ipc/kdbus/item.c | 6 ------ > 1 file changed, 6 deletions(-) Reviewed-by: David Herrmann Thanks David > diff --git a/ipc/kdbus/item.c b/ipc/kdbus/item.c > index 745ad5495096..1ee72c2ad7c3 100644 > --- a/ipc/kdbus/item.c > +++ b/ipc/kdbus/item.c > @@ -96,12 +96,6 @@ int kdbus_item_validate(const struct kdbus_item *item) > break; > > case KDBUS_ITEM_PAYLOAD_VEC: > - if (payload_size != sizeof(struct kdbus_vec)) > - return -EINVAL; > - if (item->vec.size == 0 || item->vec.size > SIZE_MAX) > - return -EINVAL; > - break; > - > case KDBUS_ITEM_PAYLOAD_OFF: > if (payload_size != sizeof(struct kdbus_vec)) > return -EINVAL; > -- > 1.8.3.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/